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

Add EXPLAIN FOR CONNECTION syntax support to SHOW EXPLAIN

Details

    Description

      MariaDB has SHOW EXPLAIN, and MySQL 5.7 got EXPLAIN FOR CONNECTION.
      We should support EXPLAIN FOR CONNECTION syntax for compatibility purposes.

      Attachments

        Issue Links

          Activity

            Considerations:

            • It is much harder to produce EXPLAIN FORMAT=JSON output than tabular format output.
              • IIRC, MySQL supports EXPLAIN FORMAT=JSON FOR CONNECTION, but the output lacks some details
            • Because of the above, we can start by supporting a tabular form in EXPLAIN FOR CONNECTION.
            • Can we print ANALYZE [ FORMAT=JSON] for the other thread?
            psergei Sergei Petrunia added a comment - Considerations: It is much harder to produce EXPLAIN FORMAT=JSON output than tabular format output. IIRC, MySQL supports EXPLAIN FORMAT=JSON FOR CONNECTION, but the output lacks some details Because of the above, we can start by supporting a tabular form in EXPLAIN FOR CONNECTION. Can we print ANALYZE [ FORMAT=JSON] for the other thread?
            psergei Sergei Petrunia added a comment - Review input: https://lists.launchpad.net/maria-developers/msg13074.html
            oleg.smirnov Oleg Smirnov added a comment -

            Yes, I'm surprised how this did work on my machine. I added the initialization and force-pushed into the same branch.

            oleg.smirnov Oleg Smirnov added a comment - Yes, I'm surprised how this did work on my machine. I added the initialization and force-pushed into the same branch.

            Ok. Please in the future do not have two branches with similar names like bb-10.8-MDEV-10000 and bb-10.8-mdev-10000. This is confusing

            psergei Sergei Petrunia added a comment - Ok. Please in the future do not have two branches with similar names like bb-10.8- MDEV-10000 and bb-10.8-mdev-10000 . This is confusing

            One other thing to consider:

            In MySQL:

            EXPLAIN FOR CONNECTION produces "partitions" and "filtered" columns.
            These columns are also part of regular EXPLAIN output (Initially
            they weren't and one had to use EXPLAIN EXTENDED to get the "filtered"
            column and EXPLAIN PARTITIONS to get the "partitions")

            In MariaDB:
            EXPLAIN doesn't produce "partitions" or "filtered". One needs to use
            EXPLAIN (EXTENDED|PARTITIONS).

            The current patch doesn't produce "partitions" or "filtered".

            But since we're aiming at MySQL compatibility perhaps we should do that?

            psergei Sergei Petrunia added a comment - One other thing to consider: In MySQL: EXPLAIN FOR CONNECTION produces "partitions" and "filtered" columns. These columns are also part of regular EXPLAIN output (Initially they weren't and one had to use EXPLAIN EXTENDED to get the "filtered" column and EXPLAIN PARTITIONS to get the "partitions") In MariaDB: EXPLAIN doesn't produce "partitions" or "filtered". One needs to use EXPLAIN (EXTENDED|PARTITIONS). The current patch doesn't produce "partitions" or "filtered". But since we're aiming at MySQL compatibility perhaps we should do that?
            oleg.smirnov Oleg Smirnov added a comment - - edited

            Sorry for the confusion, bb-10.8-MDEV-10000 is the actual branch. I removed the other one having lowercase mdev.

            Regarding "partitions" and "filtered": is we add these fields only to EXPLAIN FOR CONNECTION output wouldn't it be inconsistent that SHOW EXPLAIN displays one set of columns and EXPLAIN FOR CONNECTION - another one? Doesn't it make sense to add those fields to SHOW EXPLAIN output as well?

            oleg.smirnov Oleg Smirnov added a comment - - edited Sorry for the confusion, bb-10.8- MDEV-10000 is the actual branch. I removed the other one having lowercase mdev. Regarding "partitions" and "filtered": is we add these fields only to EXPLAIN FOR CONNECTION output wouldn't it be inconsistent that SHOW EXPLAIN displays one set of columns and EXPLAIN FOR CONNECTION - another one? Doesn't it make sense to add those fields to SHOW EXPLAIN output as well?

            Filed MDEV-27776 about addressing filtered and partitions column.

            psergei Sergei Petrunia added a comment - Filed MDEV-27776 about addressing filtered and partitions column.

            People

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