Re: Patch to fix FK-related selectivity estimates with constants
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Cc: David Rowley <dgrowleyml@gmail.com>
Date: 2020-10-27T17:58:56Z
Lists: pgsql-hackers
Attachments
- 0003-add-a-test-case.patch (text/x-diff) patch 0003
I wrote: > Over in the thread at [1] it's discussed how our code for making > selectivity estimates using knowledge about FOREIGN KEY constraints > is busted in the face of EquivalenceClasses including constants. > ... > Attached is a patch series that attacks it that way. I'd failed to generate a test case I liked yesterday, but perhaps the attached will do. (While the new code is exercised in the core regression tests already, it doesn't produce any visible plan changes.) I'm a little nervous about whether the plan shape will be stable in the buildfarm, but it works for me on both 64-bit and 32-bit machines, so probably it's OK. regards, tom lane
Commits
-
Fix foreign-key selectivity estimation in the presence of constants.
- ad1c36b0709e 14.0 landed