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

ANALYZE-driven query optimization

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      The idea is to use the data obtained by "ANALYZE statement" (MDEV-406) for query optimization. In order for that to work, we will need to
      1. Save the ANALYZE data somewhere where we could access it
      2. Reuse that data in optimization

      == Saving ANALYZE data ==

      After MDEV-406, the data will be saved into the slow query log. The problems are

      • There is no way to read that data back in the server
      • Even if we implement reading, we will only be able to read the file sequentially.

      == Reading and reusing the data ==

      At the moment the idea is to re-use execution data for re-running the same query. Reuse will go as follows:

      • We get a query
      • We find ANALYZE data for this query (we could also try using ANALYZE data
        from the queries that matched the same query pattern)
      • We optimize the query, making the optimizer to take into account the real
        table read costs and selectivities.
      • This can result in the same query plan or in a different query plan..

      TODO: elaborate further.

      == Questions ==

      • Do we need to save just the ANALYZE output (i.e. EXPLAIN + actual execution data), or it should be some other kind of data that can be reused by the optimizer? (current answer: just EXPLAIN)
      • How exactly can saved data be used? (Current answer: we have precis selectivity/fanout numbers for the join order that was picked)
      • Do we use data collection/re-feeding for all queries or for some of them only?

      Attachments

        Activity

          People

            igor Igor Babaev
            psergei Sergei Petrunia
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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