Re: ORDER BY and LIMIT not propagated on inherited - Mailing list pgsql-performance

From Matteo Beccati
Subject Re: ORDER BY and LIMIT not propagated on inherited
Date
Msg-id 43189B0F.2000904@beccati.com
Whole thread Raw
In response to Re: ORDER BY and LIMIT not propagated on inherited  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: ORDER BY and LIMIT not propagated on inherited
List pgsql-performance
Simon Riggs wrote:
> Returning to Matteo's original query, what we are saying is that the new
> optimization for MIN/MAX queries doesn't work with inherited tables.
>
> It could do, by running optimize_minmax_aggregates() for each query that
> gets planned to see if a better plan exists for each child table.
>
> I think that's a TODO item.

Great. Of course I'm using ORDER BY ... LIMIT as a workaround to get the
index scan on pre-8.1, and because I'm used to it insted of the
previously not optimized MIN/MAX aggregates.

> Optimizing ORDER BY and LIMIT down looks like it would be harder to do
> in the general case, even if Matteo's simple transform looks good. I'm
> not sure it's a very common query type though...

If I can find some time, I'll try to write some hacks... I just need to
find out where to start ;)


Best regards
--
Matteo Beccati
http://phpadsnew.com/
http://phppgads.com/

pgsql-performance by date:

Previous
From: Chris Travers
Date:
Subject: Re: Massive performance issues
Next
From: Ramesh kumar
Date:
Subject: Re: ORDER BY and LIMIT not propagated on inherited