[MDEV-23707] Fix condition selectivity computation for join prefixes Created: 2020-09-09  Updated: 2023-10-30

Status: Stalled
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: None
Fix Version/s: 11.0

Type: Bug Priority: Critical
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Unresolved Votes: 2
Labels: eits

Issue Links:
Relates
relates to MDEV-17783 AddressSanitizer: stack-buffer-overf... Closed
relates to MDEV-20697 Take selectivity of join conditions i... Stalled
relates to MDEV-20740 Odd computations in calculate_cond_se... Open
relates to MDEV-21377 Eq_ref access not picked by query wit... Stalled
relates to MDEV-21633 Assertion `tmp >= 0' failed in best_a... Stalled
relates to MDEV-21813 Optimizer choosing the wrong index de... Stalled
relates to MDEV-25830 optimizer_use_condition_selectivity=4... Closed
relates to MDEV-29395 Review input for 10.7-selectivity tree Closed
relates to MDEV-29577 Rebase 10.7-selectivity tree Closed

 Description   

There is a bunch of known issues with condition selectivity computations for join prefixes : (MDEV-20740, MDEV-20595, MDEV-20697, MDEV-20740, MDEV-17783, MDEV-21633, MDEV-21813, etc)

This task is an umbrella task for fixing them.



 Comments   
Comment by Sergei Petrunia [ 2020-11-12 ]

Notes from the optimizer call:

Igor has mentioned "Consistency property" - regardless of the query plan used, the estimated join output cardinality should be the same. Other query optimizers have it. But it has never been mentioned in the context of MariaDB' selectivity code. (and btw MySQL doesn't seem to have it, either).

Besides the whole join, it can apply to a sub-join.

Comment by Sergei Petrunia [ 2020-11-13 ]

The consistency would be easier to achieve if table fanouts were not tightly coupled to the access methods used. Currently, they are.

Another problem is multiple-equalities. A multiple equality taken together with a selective predicate (like t1.col1=t2.col2 AND t1.col1<10 creates implied correlated equalities ("t2.col<10" in this case).

Generated at Thu Feb 08 09:24:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.