[MDEV-6215] Range Analyzer should tell whether range is looser than the source condition Created: 2014-05-06  Updated: 2015-10-30

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Sergei Petrunia Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: optimizer, tentative


 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?)


Generated at Thu Feb 08 07:10:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.