Re: Indexes on expressions with multiple columns and operators

Andrei Lepikhov <lepihov@gmail.com>

From: Andrei Lepikhov <lepihov@gmail.com>
To: Frédéric Yhuel <frederic.yhuel@dalibo.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: "pgsql-performance@lists.postgresql.org" <pgsql-performance@lists.postgresql.org>, Jehan-Guillaume de Rorthais <jgdr@dalibo.com>, Christophe Courtois <christophe.courtois@dalibo.com>, Laurenz Albe <laurenz.albe@cybertec.at>
Date: 2025-09-22T13:57:43Z
Lists: pgsql-performance
On 22/9/2025 15:37, Frédéric Yhuel wrote:
> I wonder if this is an argument in favour of decoupling the sample size 
> and the precision of the statistics. Here, we basically want the sample 
> size to be as big as the table in order to include the few (NULL, 
> WARNING) values.
I also have seen how repeating ANALYZE on the same database drastically 
changes query plans ;(.
It seems to me that with massive samples, many of the ANALYZE algorithms 
should be rewritten. In principle, statistical hooks exist. So, it is 
possible to invent an independent table analyser which will scan the 
whole table to get precise statistics.

-- 
regards, Andrei Lepikhov