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

From: Samuel Gendler <sgendler(at)ideasculptor(dot)com>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [noob] How to optimize this double pivot query?
Date: 2012-10-02 09:21:53
Message-ID: CAEV0TzBd8vUSY1adZhkB6QwwKeG0OQaT-rDs-mp4aDbHEJO2BQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, Oct 1, 2012 at 11:46 PM, Thomas Kellerer <spam_eater(at)gmx(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Robert Buck 2012-10-02 09:45:32 Re: [noob] How to optimize this double pivot query?
Previous Message Thomas Kellerer 2012-10-02 06:46:11 Re: [noob] How to optimize this double pivot query?