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-10-13T14:00:35Z
Lists: pgsql-performance
On 25/9/2025 12:41, Frédéric Yhuel wrote:
> So, on SQL Server, you can do this:
> CREATE STATISTICS FooStats ON foo (ackid, crit) WHERE crit = 'WARNING';
> 
> It would be great to have a similar feature in PostgreSQL.Nice! Thanks for the report. I think the only reason why Postgres 
doesn't have it yet is the computational cost. SQL Server utilises a 
separate background worker to manage this vast amount of statistical 
data. Not sure that Postgres core wants it. Maybe one more contrib 
extension can be a solution?

-- 
regards, Andrei Lepikhov,
pgEdge