Re: Remove some redundant set_cheapest() calls

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Remove some redundant set_cheapest() calls
Date: 2024-03-26 20:06:58
Message-ID: 3166037.1711483618@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Richard Guo <guofenglinux(at)gmail(dot)com> writes:
> I happened to notice that the set_cheapest() calls in functions
> set_namedtuplestore_pathlist() and set_result_pathlist() are redundant,
> as we've centralized the set_cheapest() calls in set_rel_pathlist().

> Attached is a trivial patch to remove these calls.

Agreed, and pushed.

> BTW, I suspect that the set_cheapest() call in set_dummy_rel_pathlist()
> is also redundant. The comment there says "This is redundant when we're
> called from set_rel_size(), but not when called from elsewhere". I
> doubt it. The other places where it is called are set_append_rel_size()
> and set_subquery_pathlist(), both being called from set_rel_size(). So
> set_cheapest() would ultimately be called in set_rel_pathlist().

I'm less convinced about changing this. I'd rather keep it consistent
with mark_dummy_rel.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2024-03-26 20:17:15 Re: speed up a logical replica setup
Previous Message Bharath Rupireddy 2024-03-26 19:49:51 Re: New Table Access Methods for Multi and Single Inserts