Re: Top-N sorts verses parallelism

Jeff Janes <jeff.janes@gmail.com>

From: Jeff Janes <jeff.janes@gmail.com>
To: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2017-12-13T21:55:09Z
Lists: pgsql-hackers
On Tue, Dec 12, 2017 at 10:46 PM, Thomas Munro <
thomas.munro@enterprisedb.com> wrote:

> Hi hackers,
>
> The start-up cost of bounded (top-N) sorts is sensitive at the small
> end of N, and the
> comparison_cost * tuples * LOG2(2.0 * output_tuples) curve doesn't
> seem to correspond to reality.



Do we want the cost-estimate to be accurate for the worst case (which is
not terribly unlikely to happen, input order is opposite of desired output
order), or for the average case?

Cheers,

Jeff

Commits

  1. Re-fix wrong costing of Sort under Gather Merge.

  2. Push tuple limits through Gather and Gather Merge.

  3. Fix wrong costing of Sort under Gather Merge.