ANALYZE FORMAT=JSOn for Query 9:
With optimization
| {
|
"query_block": {
|
"select_id": 1,
|
"r_loops": 1,
|
"r_total_time_ms": 129634,
|
"table": {
|
"table_name": "nation",
|
"access_type": "ALL",
|
"r_loops": 1,
|
"rows": 25,
|
"r_rows": 25,
|
"r_table_time_ms": 0.1777,
|
"r_other_time_ms": 0.1815,
|
"filtered": 100,
|
"r_filtered": 100
|
},
|
"table": {
|
"table_name": "supplier",
|
"access_type": "ref",
|
"key": "i_s_nationkey",
|
"key_length": "5",
|
"used_key_parts": ["s_nationkey"],
|
"ref": ["dbt3.nation.n_nationkey"],
|
"r_loops": 25,
|
"rows": 400,
|
"r_rows": 400,
|
"r_table_time_ms": 22.13,
|
"r_other_time_ms": 14.66,
|
"filtered": 100,
|
"r_filtered": 100,
|
"using_index": true
|
},
|
"table": {
|
"table_name": "lineitem",
|
"access_type": "ref",
|
"key": "i_l_suppkey",
|
"key_length": "5",
|
"used_key_parts": ["l_suppkey"],
|
"ref": ["dbt3.supplier.s_suppkey"],
|
"r_loops": 10000,
|
"rows": 600,
|
"r_rows": 600.12,
|
"r_table_time_ms": 41852,
|
"r_other_time_ms": 2737,
|
"filtered": 100,
|
"r_filtered": 100
|
},
|
"table": {
|
"table_name": "orders",
|
"access_type": "eq_ref",
|
"key": "PRIMARY",
|
"key_length": "4",
|
"used_key_parts": ["o_orderkey"],
|
"ref": ["dbt3.lineitem.l_orderkey"],
|
"r_loops": 6001215,
|
"rows": 1,
|
"r_rows": 1,
|
"r_table_time_ms": 39444,
|
"r_other_time_ms": 27219,
|
"filtered": 100,
|
"r_filtered": 100
|
},
|
"read_sorted_file": {
|
"r_rows": 180,
|
"filesort": {
|
"sort_key": "`sort-nest`.n_name, year(`sort-nest`.o_orderDATE) desc",
|
"r_loops": 1,
|
"r_total_time_ms": 17924,
|
"r_used_priority_queue": false,
|
"r_output_rows": 6001215,
|
"r_sort_passes": 59,
|
"r_buffer_size": "2047Kb",
|
"table": {
|
"table_name": "<sort-nest>",
|
"access_type": "ALL",
|
"r_loops": 1,
|
"rows": 9,
|
"r_rows": 6e6,
|
"r_table_time_ms": 105.61,
|
"r_other_time_ms": 281.6,
|
"filtered": 100,
|
"r_filtered": 100
|
}
|
}
|
},
|
"table": {
|
"table_name": "partsupp",
|
"access_type": "eq_ref",
|
"key": "PRIMARY",
|
"key_length": "8",
|
"used_key_parts": ["ps_partkey", "ps_suppkey"],
|
"ref": ["sort-nest.l_partkey", "sort-nest.s_suppkey"],
|
"r_loops": 180,
|
"rows": 1,
|
"r_rows": 1,
|
"r_table_time_ms": 4.6553,
|
"r_other_time_ms": 0.162,
|
"filtered": 100,
|
"r_filtered": 100
|
},
|
"table": {
|
"table_name": "part",
|
"access_type": "eq_ref",
|
"key": "PRIMARY",
|
"key_length": "4",
|
"used_key_parts": ["p_partkey"],
|
"ref": ["sort-nest.l_partkey"],
|
"r_loops": 180,
|
"rows": 1,
|
"r_rows": 1,
|
"r_table_time_ms": 4.5496,
|
"r_other_time_ms": 24.368,
|
"filtered": 100,
|
"r_filtered": 5.5556,
|
"attached_condition": "part.p_name like '%sky%'"
|
}
|
}
|
} |
|
|
Without optimzation
| {
|
"query_block": {
|
"select_id": 1,
|
"r_loops": 1,
|
"r_total_time_ms": 21339,
|
"filesort": {
|
"sort_key": "nation.n_name, year(orders.o_orderDATE) desc",
|
"r_loops": 1,
|
"r_total_time_ms": 81.132,
|
"r_limit": 10,
|
"r_used_priority_queue": true,
|
"r_output_rows": 11,
|
"temporary_table": {
|
"table": {
|
"table_name": "nation",
|
"access_type": "ALL",
|
"r_loops": 1,
|
"rows": 25,
|
"r_rows": 25,
|
"r_table_time_ms": 0.0773,
|
"r_other_time_ms": 0.0673,
|
"filtered": 100,
|
"r_filtered": 100
|
},
|
"table": {
|
"table_name": "supplier",
|
"access_type": "ref",
|
"key": "i_s_nationkey",
|
"key_length": "5",
|
"used_key_parts": ["s_nationkey"],
|
"ref": ["dbt3.nation.n_nationkey"],
|
"r_loops": 25,
|
"rows": 400,
|
"r_rows": 400,
|
"r_table_time_ms": 23.075,
|
"r_other_time_ms": 9.0392,
|
"filtered": 100,
|
"r_filtered": 100,
|
"using_index": true
|
},
|
"table": {
|
"table_name": "partsupp",
|
"access_type": "ref",
|
"key": "i_ps_suppkey",
|
"key_length": "4",
|
"used_key_parts": ["ps_suppkey"],
|
"ref": ["dbt3.supplier.s_suppkey"],
|
"r_loops": 10000,
|
"rows": 80,
|
"r_rows": 80,
|
"r_table_time_ms": 8040.9,
|
"r_other_time_ms": 323.78,
|
"filtered": 100,
|
"r_filtered": 100
|
},
|
"table": {
|
"table_name": "part",
|
"access_type": "eq_ref",
|
"key": "PRIMARY",
|
"key_length": "4",
|
"used_key_parts": ["p_partkey"],
|
"ref": ["dbt3.partsupp.ps_partkey"],
|
"r_loops": 800000,
|
"rows": 1,
|
"r_rows": 1,
|
"r_table_time_ms": 5193.8,
|
"r_other_time_ms": 489.08,
|
"filtered": 100,
|
"r_filtered": 4.3395,
|
"attached_condition": "part.p_name like '%sky%'"
|
},
|
"table": {
|
"table_name": "lineitem",
|
"access_type": "ref",
|
"key": "i_l_suppkey_partkey",
|
"key_length": "10",
|
"used_key_parts": ["l_partkey", "l_suppkey"],
|
"ref": ["dbt3.partsupp.ps_partkey", "dbt3.supplier.s_suppkey"],
|
"r_loops": 34716,
|
"rows": 7,
|
"r_rows": 7.5199,
|
"r_table_time_ms": 4396,
|
"r_other_time_ms": 154.21,
|
"filtered": 100,
|
"r_filtered": 100
|
},
|
"table": {
|
"table_name": "orders",
|
"access_type": "eq_ref",
|
"key": "PRIMARY",
|
"key_length": "4",
|
"used_key_parts": ["o_orderkey"],
|
"ref": ["dbt3.lineitem.l_orderkey"],
|
"r_loops": 261060,
|
"rows": 1,
|
"r_rows": 1,
|
"r_table_time_ms": 2061.8,
|
"r_other_time_ms": 543.06,
|
"filtered": 100,
|
"r_filtered": 100
|
}
|
}
|
}
|
}
|
} |
|
|
|
|
ANALYZE FORMAT=JSON for query 17
With optimzation
| {
|
"query_block": {
|
"select_id": 1,
|
"r_loops": 1,
|
"r_total_time_ms": 5528.3,
|
"table": {
|
"table_name": "lineitem",
|
"access_type": "index",
|
"key": "i_l_shipdate",
|
"key_length": "4",
|
"used_key_parts": ["l_shipDATE"],
|
"r_loops": 1,
|
"rows": 2520,
|
"r_rows": 340677,
|
"r_table_time_ms": 2868.2,
|
"r_other_time_ms": 149.59,
|
"filtered": 100,
|
"r_filtered": 100,
|
"attached_condition": "lineitem.l_partkey is not null"
|
},
|
"table": {
|
"table_name": "part",
|
"access_type": "eq_ref",
|
"key": "PRIMARY",
|
"key_length": "4",
|
"used_key_parts": ["p_partkey"],
|
"ref": ["dbt3.lineitem.l_partkey"],
|
"r_loops": 340677,
|
"rows": 1,
|
"r_rows": 1,
|
"r_table_time_ms": 2298.4,
|
"r_other_time_ms": 168.03,
|
"filtered": 0.7935,
|
"r_filtered": 0.0059,
|
"attached_condition": "part.p_brand = 'Brand#13' and part.p_container = 'SM CASE' and lineitem.l_quantity < (subquery#2)"
|
},
|
"subqueries": [
|
{
|
"expression_cache": {
|
"r_loops": 336,
|
"r_hit_ratio": 52.381,
|
"query_block": {
|
"select_id": 2,
|
"r_loops": 160,
|
"r_total_time_ms": 42.669,
|
"table": {
|
"table_name": "lineitem",
|
"access_type": "ref",
|
"key": "i_l_suppkey_partkey",
|
"key_length": "5",
|
"used_key_parts": ["l_partkey"],
|
"ref": ["dbt3.part.p_partkey"],
|
"r_loops": 160,
|
"rows": 30,
|
"r_rows": 30.294,
|
"r_table_time_ms": 38.077,
|
"r_other_time_ms": 2.7502,
|
"filtered": 100,
|
"r_filtered": 100
|
}
|
}
|
}
|
}
|
]
|
}
|
} |
|
|
Without optimzation
| {
|
"query_block": {
|
"select_id": 1,
|
"r_loops": 1,
|
"r_total_time_ms": 413.24,
|
"filesort": {
|
"sort_key": "lineitem.l_shipDATE",
|
"r_loops": 1,
|
"r_total_time_ms": 0.1829,
|
"r_limit": 20,
|
"r_used_priority_queue": true,
|
"r_output_rows": 21,
|
"temporary_table": {
|
"table": {
|
"table_name": "part",
|
"access_type": "ALL",
|
"r_loops": 1,
|
"rows": 200000,
|
"r_rows": 200000,
|
"r_table_time_ms": 256.17,
|
"r_other_time_ms": 37.802,
|
"filtered": 0.7935,
|
"r_filtered": 0.0995,
|
"attached_condition": "part.p_brand = 'Brand#13' and part.p_container = 'SM CASE'"
|
},
|
"table": {
|
"table_name": "lineitem",
|
"access_type": "ref",
|
"key": "i_l_suppkey_partkey",
|
"key_length": "5",
|
"used_key_parts": ["l_partkey"],
|
"ref": ["dbt3.part.p_partkey"],
|
"r_loops": 199,
|
"rows": 30,
|
"r_rows": 30.201,
|
"r_table_time_ms": 68.715,
|
"r_other_time_ms": 5.7547,
|
"filtered": 100,
|
"r_filtered": 8.386,
|
"attached_condition": "lineitem.l_quantity < (subquery#2)"
|
},
|
"subqueries": [
|
{
|
"expression_cache": {
|
"r_loops": 6010,
|
"r_hit_ratio": 96.689,
|
"query_block": {
|
"select_id": 2,
|
"r_loops": 199,
|
"r_total_time_ms": 43.679,
|
"table": {
|
"table_name": "lineitem",
|
"access_type": "ref",
|
"key": "i_l_suppkey_partkey",
|
"key_length": "5",
|
"used_key_parts": ["l_partkey"],
|
"ref": ["dbt3.part.p_partkey"],
|
"r_loops": 199,
|
"rows": 30,
|
"r_rows": 30.201,
|
"r_table_time_ms": 39.952,
|
"r_other_time_ms": 2.3364,
|
"filtered": 100,
|
"r_filtered": 100
|
}
|
}
|
}
|
}
|
]
|
}
|
}
|
}
|
} |
|
|
|