Re: Costing elided SubqueryScans more nearly correctly

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>
Subject: Re: Costing elided SubqueryScans more nearly correctly
Date: 2022-07-17 19:16:05
Message-ID: 224445.1658085365@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> I also notice that setrefs.c can elide Append and MergeAppend nodes
> too in some cases, but AFAICS costing of those node types doesn't
> take that into account.

I took a closer look at this point and realized that in fact,
create_append_path and create_merge_append_path do attempt to account
for this. But they get it wrong! Somebody changed the rules in
setrefs.c to account for parallelism, and did not update the costing
side of things.

The attached v2 is the same as v1 plus adding a fix for this point.
No regression test results change from that AFAICT.

regards, tom lane

Attachment Content-Type Size
cost-elided-subqueries-better-2.patch text/x-diff 18.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kenaniah Cerny 2022-07-17 19:27:17 Re: Proposal: allow database-specific role memberships
Previous Message Tom Lane 2022-07-17 18:54:48 Re: Use -fvisibility=hidden for shared libraries