View Single Post

   
  #4 (permalink)  
Old 04-18-2008, 12:21 PM
Tom Lane
 
Posts: n/a
Default Re: ORDER BY and LIMIT not propagated on inherited

Matteo Beccati <php@beccati.com> 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 in many others a loss (ie, wasted
sort steps). The hard part is determining when to apply it.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply With Quote