elect b.database, substring(b.querytxt,1,30) sql, a.*
from svl_query_metrics_summary a, stl_query b
where a. query = b.query and b.querytxt like '%/* TPC-H Q%'
order by substring(b.querytxt,1,30);
結果
database | sql | userid | query | service_class | query_cpu_time | query_blocks_read | query_execution_time | query_cpu_usage_percent | query_temp_blocks_to_disk | segment_execution_time | cpu_skew | io_skew | scan_row_count | join_row_count | nested_loop_join_row_count | return_row_count | spectrum_scan_row_count | spectrum_scan_size_mb | query_queue_time | service_class_name
tpch_3tb | select c_custk | 100 | 1800544 | 100 | 900 | 106440 | 189 | 27.02 | 83695 | 96 | 16.00 | 3.10 | 8968660187 | 344142648 | | | | | | Default queue
tpch_3tb_no_distkey | select c_custk | 100 | 1800542 | 100 | 1171 | 152219 | 206 | 23.61 | 201546 | 87 | 16.00 | 1.17 | 9089191560 | 344142648 | | | | | | Default queue
tpch_3tb | select sum(l_e | 100 | 1800333 | 100 | 525 | 273616 | 132 | 16.63 | | 78 | 4.80 | 1.04 | 17888017107 | 17682473 | | | | | | Default queue
tpch_3tb_no_distkey | select sum(l_e | 100 | 1800321 | 100 | 507 | 271981 | 130 | 18.65 | | 87 | 5.33 | 1.18 | 17894066084 | 17595482 | | | | | | Default queue
tpch_3tb | select s_acctba | 100 | 1804556 | 100 | 159 | 78406 | 35 | 29.13 | | 11 | 9.60 | 4.00 | 2203425280 | 8813700 | | | | | | Default queue
tpch_3tb_no_distkey | select s_acctba | 100 | 1804584 | 100 | 129 | 72534 | 54 | 19.17 | | 12 | 4.31 | 4.08 | 2222116665 | 8885005 | | | | | | Default queue
tpch_3tb_no_distkey | select s_name, | 100 | 1804794 | 100 | 145 | 93836 | 34 | 25.46 | | 7 | 16.00 | 4.00 | 2495799166 | 27041550 | | | | | | Default queue
tpch_3tb | select s_name, | 100 | 2200380 | 100 | 7 | 3315 | 3 | 17.35 | | 2 | 1.96 | 1.82 | 89009681 | 4798394 | | | | | | Default queue
tpch_3tb_no_distkey | select s_name, | 100 | 1804588 | 100 | 3 | 2191 | 8 | 13.84 | | 2 | 2.04 | 1.86 | 58456235 | 3141952 | | | | | | Default queue
tpch_3tb_no_distkey | select n_name, | 100 | 1801030 | 100 | 1469 | 286833 | 238 | 18.61 | 268540 | 183 | 5.25 | 1.35 | 18000048306 | 546177874 | | | | | | Default queue
tpch_3tb | select n_name, | 100 | 1801032 | 100 | 1118 | 195670 | 153 | 24.27 | | 134 | 16.00 | 1.25 | 17886493890 | 546177874 | | | | | | Default queue
tpch_3tb_no_distkey | select n_name, | 100 | 1800914 | 100 | 1472 | 286938 | 251 | 18.63 | 268538 | 181 | 8.00 | 1.23 | 18000048306 | 546177874 | | | | | | Default queue
tpch_3tb | select n_name, | 100 | 1800918 | 100 | 1118 | 196096 | 158 | 24.33 | | 127 | 4.60 | 16.00 | 17892259962 | 546177874 | | | | | | Default queue
tpch_3tb | select o_year, | 100 | 1800810 | 100 | 453 | 279852 | 112 | 21.59 | | 70 | 4.29 | 8.00 | 17780373696 | 118537247 | | | | | | Default queue
tpch_3tb_no_distkey | select o_year, | 100 | 1800807 | 100 | 503 | 380336 | 123 | 14.39 | | 74 | 16.00 | 2.16 | 17846402632 | 259813290 | | | | | | Default queue
tpch_3tb_no_distkey | select nation, | 100 | 1800683 | 100 | 4035 | 469052 | 567 | 18.45 | 494415 | 309 | 7.27 | 2.40 | 18000048306 | 977720881 | | | | | | Default queue
tpch_3tb | select nation, | 100 | 1800681 | 100 | 2392 | 347778 | 429 | 22.32 | 220100 | 206 | 5.71 | 3.67 | 17971087872 | 977539503 | | | | | | Default queue
tpch_3tb_no_distkey | select b.database, substring(b | 100 | 2200338 | 100 | 1 | 0 | 1 | 36.78 | | 1 | 8.00 | | 3072 | | | | | | | Default queue