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

Improve selectivity and related costs in optimizer

Details

    Description

      There is a cleanup task for several things in the optimizer.

      • Ensure that 0 <= selectivity <= 1
      • Ensure that selectivity calculation doesn't return too few row
      • Calculate and use index only cost when appropriate.
      • Examine and improve cost calculation in the optimizer for:
      • filters
      • Ensure that filter cost calculation also include index only cost and compare with WHERE
      • ranges
      • table scans
      • hash and joins and cached full joins
      • group by
      • Adjusted Range_rowid_filter_cost_info lookup cost for very small arrays.
      • Limit calculated rows to the number of rows in the table
      • Ensure that test_quick_select doesn't return more rows than in the table

      A lot of other optimizer related issues, documented at
      https://mariadb.com/kb/en/the-optimizer-cost-model-from-mariadb-11-0/

      Attachments

        Issue Links

          Activity

            Hello Michael,

            I am interested in understanding this task in detail. The description for this task is very concise and hard to understand what the task is really about. It will be really great if you could elaborate each point in detail.

            Few specific questions:
            1. The description says "Ensure that 0 <= selectivity <= 1" – does this mean this task applies only when optimizer_use_condition_selectivity=1 ?
            2. What MariaDB versions are affected by this cleanup task ?

            Please let me know.

            Thank you
            Thejaka

            thejaka Thejaka Kanewala added a comment - Hello Michael, I am interested in understanding this task in detail. The description for this task is very concise and hard to understand what the task is really about. It will be really great if you could elaborate each point in detail. Few specific questions: 1. The description says "Ensure that 0 <= selectivity <= 1" – does this mean this task applies only when optimizer_use_condition_selectivity=1 ? 2. What MariaDB versions are affected by this cleanup task ? Please let me know. Thank you Thejaka

            Answer to Thejaka:
            1) It applies always
            2) I am working on MariaDB 10.7 code base. Will move it to the next alpha MariaDB version when done.

            You can find out more what is already done by examining 10.7-selectivity branch.
            The last commit is still work on progress (test results are not yet up to date). code is more or less correct, but a lot of additional work is done in my tree. The commit messages contains a lot of information of what has been done.

            monty Michael Widenius added a comment - Answer to Thejaka: 1) It applies always 2) I am working on MariaDB 10.7 code base. Will move it to the next alpha MariaDB version when done. You can find out more what is already done by examining 10.7-selectivity branch. The last commit is still work on progress (test results are not yet up to date). code is more or less correct, but a lot of additional work is done in my tree. The commit messages contains a lot of information of what has been done.

            People

              monty Michael Widenius
              monty Michael Widenius
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.