diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-12-04 11:51:43 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-12-04 11:51:43 -0500 |
commit | ecc27d55f4c37a8485a7d0e1dae0eb5ef2bc886e (patch) | |
tree | 548ac269dac2238c8e7f311882a21030c27daf63 /src/backend/storage/file/reinit.c | |
parent | 9f4992e2a9939a4c3d560c2ac58067861ee0029a (diff) | |
download | postgresql-ecc27d55f4c37a8485a7d0e1dae0eb5ef2bc886e.tar.gz postgresql-ecc27d55f4c37a8485a7d0e1dae0eb5ef2bc886e.zip |
Support boolean columns in functional-dependency statistics.
There's no good reason that the multicolumn stats stuff shouldn't work on
booleans. But it looked only for "Var = pseudoconstant" clauses, and it
will seldom find those for boolean Vars, since earlier phases of planning
will fold "boolvar = true" or "boolvar = false" to just "boolvar" or
"NOT boolvar" respectively. Improve dependencies_clauselist_selectivity()
to recognize such clauses as equivalent to equality restrictions.
This fixes a failure of the extended stats mechanism to apply in a case
reported by Vitaliy Garnashevich. It's not a complete solution to his
problem because the bitmap-scan costing code isn't consulting extended
stats where it should, but that's surely an independent issue.
In passing, improve some comments, get rid of a NumRelids() test that's
redundant with the preceding bms_membership() test, and fix
dependencies_clauselist_selectivity() so that estimatedclauses actually
is a pure output argument as stated by its API contract.
Back-patch to v10 where this code was introduced.
Discussion: https://postgr.es/m/73a4936d-2814-dc08-ed0c-978f76f435b0@gmail.com
Diffstat (limited to 'src/backend/storage/file/reinit.c')
0 files changed, 0 insertions, 0 deletions