pgsql: Apply all available functional dependencies

From: Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Apply all available functional dependencies
Date: 2020-01-13 00:21:48
Message-ID: E1iqnUK-00054p-CS@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Apply all available functional dependencies

When considering functional dependencies during selectivity estimation,
it's not necessary to bother with selecting the best extended statistic
object and then use just dependencies from it. We can simply consider
all applicable functional dependencies at once.

This means we need to deserialie all (applicable) dependencies before
applying them to the clauses. This is a bit more expensive than picking
the best statistics and deserializing dependencies for it. To minimize
the additional cost, we ignore statistics that are not applicable.

Author: Tomas Vondra
Reviewed-by: Mark Dilger
Discussion: https://postgr.es/m/20191028152048.jc6pqv5hb7j77ocp@development

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/aaa6761876ba5b06a5c3fa914b2951ace1e31dee

Modified Files
--------------
src/backend/statistics/dependencies.c | 116 +++++++++++++++++++++-----------
src/test/regress/expected/stats_ext.out | 57 ++++++++++++++++
src/test/regress/sql/stats_ext.sql | 35 ++++++++++
3 files changed, 169 insertions(+), 39 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2020-01-13 02:33:41 pgsql: Delete empty pages in each pass during GIST VACUUM.
Previous Message Tom Lane 2020-01-12 19:37:33 pgsql: Fix edge-case crashes and misestimation in range containment sel