Re: Why does create_gather_merge_plan need make_sort?

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: James Coleman <jtc331(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Why does create_gather_merge_plan need make_sort?
Date: 2020-11-22 21:22:46
Message-ID: b86de02e-4dc3-5aa9-704b-45f47937cd64@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/20/20 11:24 PM, James Coleman wrote:
> While looking at another issue I noticed that create_gather_merge_plan
> calls make_sort if the subplan isn't sufficiently sorted. In all of
> the cases I've seen where a gather merge path (not plan) is created
> the input path is expected to be properly sorted, so I was wondering
> if anyone happened to know what case is being handled by the make_sort
> call. Removing it doesn't seem to break any tests.
>

Yeah, I think you're right this is dead code, essentially. We're only
ever calling create_gather_merge_path() with pathkeys matching the
subpath. And it's like that on REL_12_STABLE too, i.e. before the
incremental sort was introduced.

regards

--
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-11-22 21:31:13 Re: Why does create_gather_merge_plan need make_sort?
Previous Message Tom Lane 2020-11-22 20:58:05 Re: [bug+patch] Inserting DEFAULT into generated columns from VALUES RTE