public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jehan-Guillaume de Rorthais <[email protected]>
To: Tom Lane <[email protected]>
Cc: Frédéric Yhuel <[email protected]>
Cc: [email protected] <[email protected]>
Cc: Christophe Courtois <[email protected]>
Cc: Laurenz Albe <[email protected]>
Subject: Re: Indexes on expressions with multiple columns and operators
Date: Fri, 19 Sep 2025 16:37:45 +0200
Message-ID: <20250919163745.1dfc1044@karst> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<20250918172628.44301672@karst>
	<[email protected]>

On Thu, 18 Sep 2025 12:59:11 -0400
Tom Lane <[email protected]> wrote:

> Jehan-Guillaume de Rorthais <[email protected]> writes:
> > On a fresh instance from HEAD with its default configuration, it shows:
> 
> >   Index Scan using foo_s_idx on foo  (cost=0.29..8.39 rows=33333 width=13)
> >     Index Cond: (s(crit, ackid) = true)
> 
> > It seems statistics shown in "pg_stats" view for function "s()" are good.
> > The query itself even have the same costs than the query using the syntax
> > tips you provide before.
> 
> > However, the estimated row number seems wrong in regard with the costs shown
> > and statistics.
> 
> Yeah.  The problem is that clause_selectivity_ext fails to consider
> use of statistics if the clause looks like "bool_valued_function(...)".
> If it looks like "bool_valued_function(...) = true", that goes down
> a different code path that does the right thing.

Oh, OK, I understand.

Thanks for your explanations!

Regards,





view thread (26+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Indexes on expressions with multiple columns and operators
  In-Reply-To: <20250919163745.1dfc1044@karst>

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

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