1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-27699 ANALYZE FORMAT=JSON fields are incorrect for UNION ALL queries

UNION ALL queries are a subject of optimization introduced in MDEV-334
when creation of a temporary table is skipped.
While there is a check for this optimization in Explain_union::print_explain()
there was no such in Explain_union::print_explain_json(). This resulted in
printing irrelevant data like:
  "union_result": {
    "table_name": "<union2,3>",
    "access_type": "ALL",
    "r_loops": 0,
    "r_rows": null
in case when creation of the temporary table was actually optimized out.
This commits adds a check whether the temporary table was actually created
during the UNION ALL processing and eliminates printing of the irrelevant data.
This commit is contained in:
Oleg Smirnov
2022-04-13 19:56:34 +07:00
parent 83516a33a8
commit 7498978e6a
6 changed files with 20 additions and 78 deletions

View File

@ -1304,8 +1304,6 @@ EXPLAIN
{
"query_block": {
"union_result": {
"table_name": "<unit1>",
"access_type": "ALL",
"query_specifications": [
{
"query_block": {
@ -1525,8 +1523,6 @@ EXPLAIN
{
"query_block": {
"union_result": {
"table_name": "<union1,2>",
"access_type": "ALL",
"query_specifications": [
{
"query_block": {
@ -1589,8 +1585,6 @@ EXPLAIN
{
"query_block": {
"union_result": {
"table_name": "<union1,2>",
"access_type": "ALL",
"query_specifications": [
{
"query_block": {
@ -1633,8 +1627,6 @@ EXPLAIN
{
"query_block": {
"union_result": {
"table_name": "<union1,2,3>",
"access_type": "ALL",
"query_specifications": [
{
"query_block": {
@ -1677,10 +1669,6 @@ ANALYZE
{
"query_block": {
"union_result": {
"table_name": "<unit1>",
"access_type": "ALL",
"r_loops": 0,
"r_rows": null,
"query_specifications": [
{
"query_block": {
@ -1908,10 +1896,6 @@ ANALYZE
{
"query_block": {
"union_result": {
"table_name": "<union1,2>",
"access_type": "ALL",
"r_loops": 0,
"r_rows": null,
"query_specifications": [
{
"query_block": {
@ -1976,10 +1960,6 @@ ANALYZE
{
"query_block": {
"union_result": {
"table_name": "<union1,2>",
"access_type": "ALL",
"r_loops": 0,
"r_rows": null,
"query_specifications": [
{
"query_block": {
@ -2022,10 +2002,6 @@ ANALYZE
{
"query_block": {
"union_result": {
"table_name": "<union1,2,3>",
"access_type": "ALL",
"r_loops": 0,
"r_rows": null,
"query_specifications": [
{
"query_block": {