Re: [noob] How to optimize this double pivot query?

Поиск
Список
Период
Сортировка
От Samuel Gendler
Тема Re: [noob] How to optimize this double pivot query?
Дата
Msg-id CAEV0TzBd8vUSY1adZhkB6QwwKeG0OQaT-rDs-mp4aDbHEJO2BQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [noob] How to optimize this double pivot query?  (Thomas Kellerer <spam_eater@gmx.net>)
Ответы Re: [noob] How to optimize this double pivot query?
Список pgsql-sql


On Mon, Oct 1, 2012 at 11:46 PM, Thomas Kellerer <spam_eater@gmx.net> wrote:

That combined with the tablefunc module (which let's you do pivot queries) might
make your queries substantially more readable (and maybe faster as well).


I woud think that using the crosstab functions in tablefunc would solve the problem without needing a complete change of structure. I've built crosstabs over a whole lot more than 54K rows in far, far less time (and resulting in more than 35 columns, too) than the 11 seconds that was quoted here, without feeling the need to deal with hstore or similar.  In fact, wouldn't hstore actually make it more difficult to build a crosstab query than the schema that he has in place now?

--sam

В списке pgsql-sql по дате отправления:

Предыдущее
От: mephysto
Дата:
Сообщение: Help in accessing array
Следующее
От: Robert Buck
Дата:
Сообщение: Re: [noob] How to optimize this double pivot query?