Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
Description
(filed based on discussions with Igor)
Cost estimation code makes use of range analyzer to match (parts of) the WHERE
condition against column's Histogram.
Some other module (todo: which? MDEV#?) needs to know whether the estimate is
precise or not.
The main source of imprecision is that some of conditions are not [fully]
sargable. That is, range analyzer produces ranges that are wider than the
supplied conditions.
Examples of conditions with imprecise estimates:
t.col < 10 AND t.col MOD 3 = 2
|
t.col LIKE 'foo%bar%'
|
Examples of conditions with precise estimates:
t.col LIKE 'foo%'
|
t.col < 3214
|
t.col = 'bar'
|
t.col IN (1,2,3) OR t.col BETWEEN 10 AND 20
|
(TODO: we don't need to handle the case of multi-column range analysis, do we?)