[MDEV-446] Reuse quick_condition_rows in fanout computations Created: 2012-08-10 Updated: 2013-03-26 Resolved: 2013-03-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | 10.0.2 |
| Type: | Task | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Timour Katchaounov (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||
| Sub-Tasks: |
|
||||||||||
| Description |
|
Currently:
We need to make it so that quick_condition_rows is used for any access === Details === 1. quick_condition_rows estimate was made from a certain part of WHERE clause (the part of WHERE that was used to construct a range) question: are these two correlated? When does the estimate of the fanout of an access method take into account quick_condition_rows? We will adopt this answer:
THere are more complex cases like Here: when part of WHERE will be appled,
Available estimates: Note, that the estimates will not necessary be in sync. For instance, we saw real-world cases where E3 > E1, even if it is clear that E3 < E1 for any dataset. How to compute the fanout of the WHERE predicates not covered by an access method:
We assume that:
== Implementation ==
APPARENT: POSITION::prefix_record_count is not what is needed.
== Implementation step #1 ==
|
| Comments |
| Comment by Timour Katchaounov (Inactive) [ 2012-08-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Traced in GDB the produced selectivity estimate for the following query (as suggested by Sergey): explain extended There is an index on table nation(n_name). The plan for DBT3 scale 10 is: -----
-----
----- Notice the "0" % filtered rows for part. This is due to JOIN_TAB::records_read being an integer instead of double. (gdb) p records The value of 's->table->quick_condition_rows' is what records_in_range() gives us for the predicate "p_name like 'forest%'" on index i_p_name. The numbers for scale 1 are: (gdb) p s->table->quick_condition_rows This is 1.19% selectivity, which was the expected result. Various problems in EXPLAIN prevent it from showing the correct result (not only rounding). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Timour Katchaounov (Inactive) [ 2013-03-26 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This task is no longer needed because MWL#253 provides a generic solution for predicate selectivity. |