pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chao Li <li.evan.chao@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Fixing some ancient errors in hash join costing
Date: Sun, 28 Dec 2025 22:29:16 -0500
Message-ID: <2742257.1766978956@sss.pgh.pa.us> (raw)
In-Reply-To: <705AC80B-8E3A-4DA2-9FC2-A05C4D6C70FD@gmail.com>
References: <2380165.1766871097@sss.pgh.pa.us>
	<2551253.1766952956@sss.pgh.pa.us>
	<2712245.1766962600@sss.pgh.pa.us>
	<705AC80B-8E3A-4DA2-9FC2-A05C4D6C70FD@gmail.com>

Chao Li <li.evan.chao@gmail.com> writes:
> Just a few small comments on v2:

> This is not a concern, just curious why switch the setting order of enable_hashjoin and enable_sort?

The need to disable hashjoin only applies to one of the two tests, so
it seemed to me that this way is more nicely nested.  Judgment call
of course.

> As flag 0 is passed to get_attstatsslot(), free_attstatsslot() is not needed.

True.  I wrote it like that so people wouldn't wonder if I'd forgotten
free_attstatsslot(), but if other call sites passing flags == 0 don't
use it then it'd be better to be consistent.  (I didn't check that.)

> Maybe worth adding a short comment like “0.0 doesn’t mean zero frequency, instead 0.0 means no data or unknown frequency”, which might help code readers to quickly understand the logic.

Doesn't the function's header comment cover that adequately?

			regards, tom lane





view thread (7+ messages)  latest in thread

Message-ID: <2742257.1766978956@sss.pgh.pa.us>
Permalink:  ../2742257.1766978956@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2742257.1766978956@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, li.evan.chao@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Fixing some ancient errors in hash join costing
  In-Reply-To: <2742257.1766978956@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox