Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6215

Range Analyzer should tell whether range is looser than the source condition

    Details

    • Type: Task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Fix Version/s: 10.1
    • Component/s: 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?)

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                Unassigned
                Reporter:
                psergey Sergei Petrunia
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: