Re: Indexes on expressions with multiple columns and operators
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Frédéric Yhuel <frederic.yhuel@dalibo.com>
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-18T15:32:29Z
Lists: pgsql-performance
=?UTF-8?Q?Fr=C3=A9d=C3=A9ric_Yhuel?= <frederic.yhuel@dalibo.com> writes: > On 9/17/25 16:41, Tom Lane wrote: >> =?UTF-8?Q?Fr=C3=A9d=C3=A9ric_Yhuel?= <frederic.yhuel@dalibo.com> writes: >>> 2) the number of estimated rows is completely off in the second EXPLAIN, >>> whereas the planner could easily use the statistics of foo_f_idx. >> Hmm, not sure about that. Again, boolean-valued indexes aren't >> something we've worked on too hard, but I don't see why that >> would affect this case. > OK, thanks anyway, I think the ju-jitsu mentioned above will do, even > though the application code will have to be patched. Sigh ... so the answer is this used to work (since commit 39df0f150) and then I carelessly broke it in commit a391ff3c3. If you try this test case in versions 9.5..11 you get a spot-on rowcount estimate. Serves me right for not having a test case I guess, but I'm astonished that nobody complained sooner. regards, tom lane
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Re-allow using statistics for bool-valued functions in WHERE.
- 1eccb9315070 19 (unreleased) landed
-
Build out the planner support function infrastructure.
- a391ff3c3d41 12.0 cited
-
Allow planner to use expression-index stats for function calls in WHERE.
- 39df0f150ca6 9.6.0 cited