[MDEV-10000] Add EXPLAIN FOR CONNECTION syntax support to SHOW EXPLAIN Created: 2016-04-26  Updated: 2023-03-21  Resolved: 2022-04-29

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Fix Version/s: 10.9.1

Type: Task Priority: Minor
Reporter: Sergei Petrunia Assignee: Alice Sherepa
Resolution: Fixed Votes: 1
Labels: Compatibility, Preview_10.9, optimizer

Issue Links:
PartOf
is part of MDEV-28112 prepare 10.9.0 preview releases Closed
Problem/Incident
causes MDEV-28125 Server crashes in Explain_table_acces... Closed
Relates
relates to MDEV-27021 Extend SHOW EXPLAIN to support SHOW A... Closed
relates to MDEV-27776 Make EXPLAIN show filtered and partit... Stalled

 Description   

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



 Comments   
Comment by Sergei Petrunia [ 2021-10-29 ]

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?
Comment by Sergei Petrunia [ 2022-01-21 ]

Review input: https://lists.launchpad.net/maria-developers/msg13074.html

Comment by Oleg Smirnov [ 2022-01-25 ]

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

Comment by Sergei Petrunia [ 2022-01-28 ]

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

Comment by Sergei Petrunia [ 2022-01-29 ]

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?

Comment by Oleg Smirnov [ 2022-01-31 ]

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?

Comment by Sergei Petrunia [ 2022-02-08 ]

Filed MDEV-27776 about addressing filtered and partitions column.

Generated at Thu Feb 08 07:38:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.