From 2e5498099f24d859c508cbcd7ba25ca83a7f6a97 Mon Sep 17 00:00:00 2001 From: jangorecki Date: Wed, 12 May 2021 23:05:05 +0200 Subject: [PATCH] clickhouse changes output again, amend code --- clickhouse/groupby-clickhouse.sql.in | 40 ++++++++++++++-------------- clickhouse/join-clickhouse.sql.in | 20 +++++++------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/clickhouse/groupby-clickhouse.sql.in b/clickhouse/groupby-clickhouse.sql.in index e87a6dbc..3a594808 100644 --- a/clickhouse/groupby-clickhouse.sql.in +++ b/clickhouse/groupby-clickhouse.sql.in @@ -14,7 +14,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id1, sum(v1) AS v1 FROM DATA_NAME GRO SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'sum v1 by id1' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id1, sum(v1) AS v1 FROM DATA_NAME GROUP BY id1;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q1_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id1, sum(v1) AS v1 FROM DATA_NAME GROUP BY id1;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q1_r1.csv' FORMAT CSVWithNames; DROP TABLE ans; SET log_queries = 1; @@ -22,7 +22,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id1, sum(v1) AS v1 FROM DATA_NAME GRO SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'sum v1 by id1' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id1, sum(v1) AS v1 FROM DATA_NAME GROUP BY id1;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q1_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id1, sum(v1) AS v1 FROM DATA_NAME GROUP BY id1;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q1_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -33,7 +33,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id1, id2, sum(v1) AS v1 FROM DATA_NAM SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'sum v1 by id1:id2' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id1, id2, sum(v1) AS v1 FROM DATA_NAME GROUP BY id1, id2;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q2_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id1, id2, sum(v1) AS v1 FROM DATA_NAME GROUP BY id1, id2;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q2_r1.csv' FORMAT CSVWithNames; DROP TABLE ans; SET log_queries = 1; @@ -41,7 +41,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id1, id2, sum(v1) AS v1 FROM DATA_NAM SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'sum v1 by id1:id2' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id1, id2, sum(v1) AS v1 FROM DATA_NAME GROUP BY id1, id2;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q2_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id1, id2, sum(v1) AS v1 FROM DATA_NAME GROUP BY id1, id2;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q2_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -52,7 +52,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id3, sum(v1) AS v1, avg(v3) AS v3 FRO SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'sum v1 mean v3 by id3' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id3, sum(v1) AS v1, avg(v3) AS v3 FROM DATA_NAME GROUP BY id3;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q3_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id3, sum(v1) AS v1, avg(v3) AS v3 FROM DATA_NAME GROUP BY id3;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q3_r1.csv' FORMAT CSVWithNames; DROP TABLE ans; SET log_queries = 1; @@ -60,7 +60,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id3, sum(v1) AS v1, avg(v3) AS v3 FRO SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'sum v1 mean v3 by id3' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id3, sum(v1) AS v1, avg(v3) AS v3 FROM DATA_NAME GROUP BY id3;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q3_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id3, sum(v1) AS v1, avg(v3) AS v3 FROM DATA_NAME GROUP BY id3;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q3_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -71,7 +71,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id4, avg(v1) AS v1, avg(v2) AS v2, av SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'mean v1:v3 by id4' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id4, avg(v1) AS v1, avg(v2) AS v2, avg(v3) AS v3 FROM DATA_NAME GROUP BY id4;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q4_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id4, avg(v1) AS v1, avg(v2) AS v2, avg(v3) AS v3 FROM DATA_NAME GROUP BY id4;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q4_r1.csv' FORMAT CSVWithNames; DROP TABLE ans; SET log_queries = 1; @@ -79,7 +79,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id4, avg(v1) AS v1, avg(v2) AS v2, av SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'mean v1:v3 by id4' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id4, avg(v1) AS v1, avg(v2) AS v2, avg(v3) AS v3 FROM DATA_NAME GROUP BY id4;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q4_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id4, avg(v1) AS v1, avg(v2) AS v2, avg(v3) AS v3 FROM DATA_NAME GROUP BY id4;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q4_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -90,7 +90,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id6, sum(v1) AS v1, sum(v2) AS v2, su SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'sum v1:v3 by id6' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id6, sum(v1) AS v1, sum(v2) AS v2, sum(v3) AS v3 FROM DATA_NAME GROUP BY id6;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q5_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id6, sum(v1) AS v1, sum(v2) AS v2, sum(v3) AS v3 FROM DATA_NAME GROUP BY id6;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q5_r1.csv' FORMAT CSVWithNames; DROP TABLE ans; SET log_queries = 1; @@ -98,7 +98,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id6, sum(v1) AS v1, sum(v2) AS v2, su SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'sum v1:v3 by id6' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id6, sum(v1) AS v1, sum(v2) AS v2, sum(v3) AS v3 FROM DATA_NAME GROUP BY id6;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q5_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id6, sum(v1) AS v1, sum(v2) AS v2, sum(v3) AS v3 FROM DATA_NAME GROUP BY id6;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q5_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -109,7 +109,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id4, id5, medianExact(v3) AS median_v SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'median v3 sd v3 by id4 id5' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id4, id5, medianExact(v3) AS median_v3, stddevPop(v3) AS sd_v3 FROM DATA_NAME GROUP BY id4, id5;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q6_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id4, id5, medianExact(v3) AS median_v3, stddevPop(v3) AS sd_v3 FROM DATA_NAME GROUP BY id4, id5;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q6_r1.csv' FORMAT CSVWithNames; DROP TABLE ans; SET log_queries = 1; @@ -117,7 +117,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id4, id5, medianExact(v3) AS median_v SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'median v3 sd v3 by id4 id5' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id4, id5, medianExact(v3) AS median_v3, stddevPop(v3) AS sd_v3 FROM DATA_NAME GROUP BY id4, id5;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q6_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id4, id5, medianExact(v3) AS median_v3, stddevPop(v3) AS sd_v3 FROM DATA_NAME GROUP BY id4, id5;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q6_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -128,7 +128,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id3, max(v1) - min(v2) AS range_v1_v2 SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'max v1 - min v2 by id3' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id3, max(v1) - min(v2) AS range_v1_v2 FROM DATA_NAME GROUP BY id3;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q7_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id3, max(v1) - min(v2) AS range_v1_v2 FROM DATA_NAME GROUP BY id3;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q7_r1.csv' FORMAT CSVWithNames; DROP TABLE ans; SET log_queries = 1; @@ -136,7 +136,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id3, max(v1) - min(v2) AS range_v1_v2 SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'max v1 - min v2 by id3' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id3, max(v1) - min(v2) AS range_v1_v2 FROM DATA_NAME GROUP BY id3;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q7_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id3, max(v1) - min(v2) AS range_v1_v2 FROM DATA_NAME GROUP BY id3;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q7_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -147,7 +147,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id6, arrayJoin(arraySlice(arrayRevers SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'largest two v3 by id6' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id6, arrayJoin(arraySlice(arrayReverseSort(groupArray(v3)), 1, 2)) AS v3 FROM (SELECT id6, v3 FROM DATA_NAME WHERE v3 IS NOT NULL) AS subq GROUP BY id6;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q8_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id6, arrayJoin(arraySlice(arrayReverseSort(groupArray(v3)), 1, 2)) AS v3 FROM (SELECT id6, v3 FROM DATA_NAME WHERE v3 IS NOT NULL) AS subq GROUP BY id6;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q8_r1.csv' FORMAT CSVWithNames; DROP TABLE ans; SET log_queries = 1; @@ -155,7 +155,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id6, arrayJoin(arraySlice(arrayRevers SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'largest two v3 by id6' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id6, arrayJoin(arraySlice(arrayReverseSort(groupArray(v3)), 1, 2)) AS v3 FROM (SELECT id6, v3 FROM DATA_NAME WHERE v3 IS NOT NULL) AS subq GROUP BY id6;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q8_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id6, arrayJoin(arraySlice(arrayReverseSort(groupArray(v3)), 1, 2)) AS v3 FROM (SELECT id6, v3 FROM DATA_NAME WHERE v3 IS NOT NULL) AS subq GROUP BY id6;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q8_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -166,7 +166,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id2, id4, pow(corr(v1, v2), 2) AS r2 SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'regression v1 v2 by id2 id4' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id2, id4, pow(corr(v1, v2), 2) AS r2 FROM DATA_NAME GROUP BY id2, id4;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q9_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id2, id4, pow(corr(v1, v2), 2) AS r2 FROM DATA_NAME GROUP BY id2, id4;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q9_r1.csv' FORMAT CSVWithNames; DROP TABLE ans; SET log_queries = 1; @@ -174,7 +174,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id2, id4, pow(corr(v1, v2), 2) AS r2 SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'regression v1 v2 by id2 id4' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id2, id4, pow(corr(v1, v2), 2) AS r2 FROM DATA_NAME GROUP BY id2, id4;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q9_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id2, id4, pow(corr(v1, v2), 2) AS r2 FROM DATA_NAME GROUP BY id2, id4;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q9_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -185,7 +185,7 @@ CREATE TABLE ans ENGINE = Log AS SELECT id1, id2, id3, id4, id5, id6, sum(v3) AS SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'sum v3 count by id1:id6' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Log AS SELECT id1, id2, id3, id4, id5, id6, sum(v3) AS v3, count() AS cnt FROM DATA_NAME GROUP BY id1, id2, id3, id4, id5, id6;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q10_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Log AS SELECT id1, id2, id3, id4, id5, id6, sum(v3) AS v3, count() AS cnt FROM DATA_NAME GROUP BY id1, id2, id3, id4, id5, id6;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q10_r1.csv' FORMAT CSVWithNames; DROP TABLE ans; SET log_queries = 1; @@ -193,6 +193,6 @@ CREATE TABLE ans ENGINE = Log AS SELECT id1, id2, id3, id4, id5, id6, sum(v3) AS SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'groupby' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'sum v3 count by id1:id6' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select group by' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Log AS SELECT id1, id2, id3, id4, id5, id6, sum(v3) AS v3, count() AS cnt FROM DATA_NAME GROUP BY id1, id2, id3, id4, id5, id6;\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q10_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Log AS SELECT id1, id2, id3, id4, id5, id6, sum(v3) AS v3, count() AS cnt FROM DATA_NAME GROUP BY id1, id2, id3, id4, id5, id6;' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/groupby_DATA_NAME_q10_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; diff --git a/clickhouse/join-clickhouse.sql.in b/clickhouse/join-clickhouse.sql.in index 7c2b84a7..49adb474 100644 --- a/clickhouse/join-clickhouse.sql.in +++ b/clickhouse/join-clickhouse.sql.in @@ -13,7 +13,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id1, x.id2, x.id3, x.id4, y.id4, x.id SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'join' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'small inner on int' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select join' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id1, x.id2, x.id3, x.id4, y.id4, x.id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_SMALL AS y USING (id1);\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q1_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id1, x.id2, x.id3, x.id4, y.id4, x.id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_SMALL AS y USING (id1);' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q1_r1.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -22,7 +22,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT id1, x.id2, x.id3, x.id4, y.id4, x.id SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'join' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'small inner on int' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select join' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id1, x.id2, x.id3, x.id4, y.id4, x.id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_SMALL AS y USING (id1);\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q1_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT id1, x.id2, x.id3, x.id4, y.id4, x.id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_SMALL AS y USING (id1);' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q1_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -33,7 +33,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, id2, x.id3, x.id4, y.id SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'join' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'medium inner on int' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select join' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, id2, x.id3, x.id4, y.id4, x.id5, y.id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_MEDIUM AS y USING (id2);\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q2_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, id2, x.id3, x.id4, y.id4, x.id5, y.id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_MEDIUM AS y USING (id2);' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q2_r1.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -42,7 +42,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, id2, x.id3, x.id4, y.id SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'join' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'medium inner on int' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select join' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, id2, x.id3, x.id4, y.id4, x.id5, y.id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_MEDIUM AS y USING (id2);\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q2_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, id2, x.id3, x.id4, y.id4, x.id5, y.id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_MEDIUM AS y USING (id2);' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q2_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -53,7 +53,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, id2, x.id3, x.id4, y.id SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'join' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'medium outer on int' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select join' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, id2, x.id3, x.id4, y.id4, x.id5, y.id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x LEFT JOIN RHS_MEDIUM AS y USING (id2);\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q3_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, id2, x.id3, x.id4, y.id4, x.id5, y.id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x LEFT JOIN RHS_MEDIUM AS y USING (id2);' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q3_r1.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -62,7 +62,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, id2, x.id3, x.id4, y.id SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'join' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'medium outer on int' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select join' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, id2, x.id3, x.id4, y.id4, x.id5, y.id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x LEFT JOIN RHS_MEDIUM AS y USING (id2);\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q3_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, id2, x.id3, x.id4, y.id4, x.id5, y.id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x LEFT JOIN RHS_MEDIUM AS y USING (id2);' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q3_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -73,7 +73,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, x.id2, y.id2, x.id3, x. SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'join' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'medium inner on factor' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select join' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, x.id2, y.id2, x.id3, x.id4, y.id4, id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_MEDIUM AS y USING (id5);\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q4_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, x.id2, y.id2, x.id3, x.id4, y.id4, id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_MEDIUM AS y USING (id5);' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q4_r1.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -82,7 +82,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, x.id2, y.id2, x.id3, x. SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'join' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'medium inner on factor' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select join' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, x.id2, y.id2, x.id3, x.id4, y.id4, id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_MEDIUM AS y USING (id5);\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q4_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, x.id2, y.id2, x.id3, x.id4, y.id4, id5, x.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_MEDIUM AS y USING (id5);' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q4_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -93,7 +93,7 @@ CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, x.id2, y.id2, id3, x.id SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 1 AS run, toUnixTimestamp(now()) AS timestamp, 'join' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'big inner on int' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select join' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, x.id2, y.id2, id3, x.id4, y.id4, x.id5, y.id5, x.id6, y.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_BIG AS y USING (id3);\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q5_r1.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, x.id2, y.id2, id3, x.id4, y.id4, x.id5, y.id5, x.id6, y.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_BIG AS y USING (id3);' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q5_r1.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans; @@ -102,6 +102,6 @@ CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, x.id2, y.id2, id3, x.id SET log_queries = 0; SYSTEM FLUSH LOGS; SELECT 2 AS run, toUnixTimestamp(now()) AS timestamp, 'join' AS task, 'DATA_NAME' AS data_name, NULL AS in_rows, 'big inner on int' AS question, result_rows AS out_rows, NULL AS out_cols, 'clickhouse' AS solution, version() AS version, NULL AS git, 'select join' AS fun, query_duration_ms/1000 AS time_sec, memory_usage/1073741824 AS mem_gb, 1 AS cache, NULL AS chk, NULL AS chk_time_sec, 1 AS on_disk -FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, x.id2, y.id2, id3, x.id4, y.id4, x.id5, y.id5, x.id6, y.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_BIG AS y USING (id3);\n' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q5_r2.csv' FORMAT CSVWithNames; +FROM system.query_log WHERE type=2 AND query='CREATE TABLE ans ENGINE = Memory AS SELECT x.id1, y.id1, x.id2, y.id2, id3, x.id4, y.id4, x.id5, y.id5, x.id6, y.id6, x.v1, y.v2 FROM DATA_NAME AS x INNER JOIN RHS_BIG AS y USING (id3);' ORDER BY query_start_time DESC LIMIT 1 INTO OUTFILE 'clickhouse/log/join_DATA_NAME_q5_r2.csv' FORMAT CSVWithNames; SELECT * FROM ans LIMIT 3; DROP TABLE ans;