Re: [PERFORM] ORDER BY and LIMIT not propagated on inherited

2005-09-02 Thread Ramesh kumar
Hi all I have got lot of information from ur group. Now i want to relieve from this group. I kindly request all of you. Plz unsubcribe me. Thankz a lot Ramesh  On 9/3/05, Matteo Beccati <[EMAIL PROTECTED]> wrote: Simon Riggs wrote:> Returning to Matteo's original query, what we are saying is that t

Re: [PERFORM] ORDER BY and LIMIT not propagated on inherited

2005-09-02 Thread Matteo Beccati
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 t

Re: [PERFORM] ORDER BY and LIMIT not propagated on inherited

2005-09-02 Thread Simon Riggs
On Fri, 2005-09-02 at 12:20 +0200, Matteo Beccati wrote: > I'm using inherited tables to partition some data which can grow very > large. Recently I discovered that a simple query that on a regular table > would use an index was instead using seq scans (70s vs a guessed 2s). > The well known quer

Re: [PERFORM] ORDER BY and LIMIT not propagated on inherited

2005-09-02 Thread Jens-Wolfhard Schicke
The correct strategy IMHO would be applying the order by and limit for each child table (which results in an index scan, if possible), appending, then finally sorting a bunch of rows, and limiting again. This would be a win in some cases, and in many others a loss (ie, wasted sort steps). The h

Re: [PERFORM] ORDER BY and LIMIT not propagated on inherited

2005-09-02 Thread Matteo Beccati
Hi, The correct strategy IMHO would be applying the order by and limit for each child table (which results in an index scan, if possible), appending, then finally sorting a bunch of rows, and limiting again. This would be a win in some cases, and in many others a loss (ie, wasted sort steps)

Re: [PERFORM] ORDER BY and LIMIT not propagated on inherited

2005-09-02 Thread Tom Lane
Matteo Beccati <[EMAIL PROTECTED]> writes: > The correct strategy IMHO would > be applying the order by and limit for each child table (which results > in an index scan, if possible), appending, then finally sorting a bunch > of rows, and limiting again. This would be a win in some cases, and i

Re: [PERFORM] ORDER BY and LIMIT not propagated on inherited

2005-09-02 Thread Matteo Beccati
Simon Riggs wrote: The query plan generated when running the query on a table which has inheritance forces the planner to choose a seq_scan for each table. Wouldn't be a good thing to also promote ORDER BYs and LIMITs to each subscan (like WHERE does)? The tuple_fraction implied by LIMIT is a

Re: [PERFORM] ORDER BY and LIMIT not propagated on inherited

2005-09-02 Thread Simon Riggs
On Fri, 2005-09-02 at 12:20 +0200, Matteo Beccati wrote: > I'm using inherited tables to partition some data which can grow very > large. Recently I discovered that a simple query that on a regular table > would use an index was instead using seq scans (70s vs a guessed 2s). > The well known que