Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit87779aa

Browse files
committed
Prevent functional dependency estimates from exceeding column estimates.
Formerly we applied a functional dependency "a => b with dependencydegree f" using the formula P(a,b) = P(a) * [f + (1-f)*P(b)]This leads to the possibility that the combined selectivity P(a,b)could exceed P(b), which is not ideal. The addition of support for INand OR clauses (commits8f321bd andccaa356) would seem to makethis more likely, since the user-supplied values in such clauses arenot necessarily compatible with the functional dependency.Mitigate this by using the formula P(a,b) = f * Min(P(a), P(b)) + (1-f) * P(a) * P(b)instead, which guarantees that the combined selectivity is less thaneach column's individual selectivity. Logically, this is modifies thepart of the formula that accounts for dependent rows to handle caseswhere P(a) > P(b), whilst not changing the second term which accountsfor independent rows.Additionally, this refactors the way that functional dependencies areapplied, so now dependencies_clauselist_selectivity() estimates boththe implying clauses and the implied clauses for each functionaldependency (formerly only the implied clauses were estimated), and nowall clauses for each attribute are taken into account (formerly onlyone clause for each implied attribute was estimated). This removes thepreviously built-in assumption that only equality clauses will beseen, which is no longer true, and opens up the possibility ofapplying functional dependencies to more general clauses.Patch by me, reviewed by Tomas Vondra.Discussion:https://postgr.es/m/CAEZATCXaNFZyOhR4XXAfkvj1tibRBEjje6ZbXwqWUB_tqbH%3Drw%40mail.gmail.comDiscussion:https://postgr.es/m/20200318002946.6dvblukm3cfmgir2%40development
1 parent145cb16 commit87779aa

File tree

3 files changed

+266
-109
lines changed

3 files changed

+266
-109
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp