Re: ORDER BY and LIMIT not propagated on inherited

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matteo Beccati <php(at)beccati(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: ORDER BY and LIMIT not propagated on inherited
Date: 2005-09-02 14:40:54
Message-ID: 14074.1125672054@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Matteo Beccati <php(at)beccati(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Matteo Beccati 2005-09-02 15:00:50 Re: ORDER BY and LIMIT not propagated on inherited
Previous Message Michael Fuhr 2005-09-02 13:36:10 Re: Advise about how to delete entries