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

EXPLAIN FORMAT=JSON output: print costs

    XMLWordPrintable

Details

    Description

      EXPLAIN FORMAT=JSON should print information about the costs.

      ANALYZE FORMAT=JSON should have it,too. Ideally, one should be able to compare r_total_time_ms with the cost and see the discrepancy.

      And this should work for every node in the query plan.

      Obstacles on the way to implementing this vision:

      • For some kinds of subqueries, we do not know how many times they will be executed. We optimize as if the subquery is to be executed once.
      • We don't compute the total cost of some constructs e.g. the cost of UNION [ALL] being cost of its members plus cost of the union operation.

      So, starting small:

      At least, print the cost of computing the SELECT. For selects with r_loops=1 (e.g. for the top-level one), one will be able to compare it with r_total_time_ms.

      Also, print total cost of reading each table.

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            psergei Sergei Petrunia
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.