mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-14 03:25:15 +00:00
342 lines
12 KiB
Plaintext
342 lines
12 KiB
Plaintext
3
|
|
SELECT count(*) FROM hits;
|
|
1 tuple
|
|
clk: 1.262 ms
|
|
1 tuple
|
|
clk: 1.420 ms
|
|
1 tuple
|
|
clk: 1.190 ms
|
|
3
|
|
SELECT count(*) FROM hits WHERE "AdvEngineID" <> 0;
|
|
1 tuple
|
|
clk: 1.530 sec
|
|
1 tuple
|
|
clk: 1.489 sec
|
|
1 tuple
|
|
clk: 1.490 sec
|
|
3
|
|
SELECT sum("AdvEngineID"), count(*), avg("ResolutionWidth") FROM hits;
|
|
1 tuple
|
|
clk: 597.512 ms
|
|
1 tuple
|
|
clk: 579.383 ms
|
|
1 tuple
|
|
clk: 598.220 ms
|
|
3
|
|
SELECT sum("UserID") FROM hits;
|
|
overflow in calculation.
|
|
clk: 568.003 ms
|
|
overflow in calculation.
|
|
clk: 554.572 ms
|
|
overflow in calculation.
|
|
clk: 552.076 ms
|
|
3
|
|
SELECT COUNT(DISTINCT "UserID") FROM hits;
|
|
1 tuple
|
|
clk: 6.688 sec
|
|
1 tuple
|
|
clk: 6.689 sec
|
|
1 tuple
|
|
clk: 6.652 sec
|
|
3
|
|
SELECT COUNT(DISTINCT "SearchPhrase") FROM hits;
|
|
1 tuple
|
|
clk: 15.702 sec
|
|
1 tuple
|
|
clk: 17.189 sec
|
|
1 tuple
|
|
clk: 15.514 sec
|
|
3
|
|
SELECT min("EventDate"), max("EventDate") FROM hits;
|
|
1 tuple
|
|
clk: 697.770 ms
|
|
1 tuple
|
|
clk: 711.870 ms
|
|
1 tuple
|
|
clk: 697.177 ms
|
|
3
|
|
SELECT "AdvEngineID", count(*) FROM hits WHERE "AdvEngineID" <> 0 GROUP BY "AdvEngineID" ORDER BY count(*) DESC;
|
|
18 tuples
|
|
clk: 1.536 sec
|
|
18 tuples
|
|
clk: 1.505 sec
|
|
18 tuples
|
|
clk: 1.492 sec
|
|
3
|
|
SELECT "RegionID", COUNT(DISTINCT "UserID") AS u FROM hits GROUP BY "RegionID" ORDER BY u DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 9.965 sec
|
|
10 tuples
|
|
clk: 10.106 sec
|
|
10 tuples
|
|
clk: 10.136 sec
|
|
3
|
|
SELECT "RegionID", sum("AdvEngineID"), count(*) AS c, avg("ResolutionWidth"), COUNT(DISTINCT "UserID") FROM hits GROUP BY "RegionID" ORDER BY c DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 8.329 sec
|
|
10 tuples
|
|
clk: 8.601 sec
|
|
10 tuples
|
|
clk: 8.039 sec
|
|
3
|
|
SELECT "MobilePhoneModel", COUNT(DISTINCT "UserID") AS u FROM hits WHERE "MobilePhoneModel" <> '' GROUP BY "MobilePhoneModel" ORDER BY u DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 3.385 sec
|
|
10 tuples
|
|
clk: 3.321 sec
|
|
10 tuples
|
|
clk: 3.326 sec
|
|
3
|
|
SELECT "MobilePhone", "MobilePhoneModel", COUNT(DISTINCT "UserID") AS u FROM hits WHERE "MobilePhoneModel" <> '' GROUP BY "MobilePhone", "MobilePhoneModel" ORDER BY u DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 3.510 sec
|
|
10 tuples
|
|
clk: 3.431 sec
|
|
10 tuples
|
|
clk: 3.382 sec
|
|
3
|
|
SELECT "SearchPhrase", count(*) AS c FROM hits WHERE "SearchPhrase" <> '' GROUP BY "SearchPhrase" ORDER BY c DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 10.891 sec
|
|
10 tuples
|
|
clk: 11.483 sec
|
|
10 tuples
|
|
clk: 10.352 sec
|
|
3
|
|
SELECT "SearchPhrase", COUNT(DISTINCT "UserID") AS u FROM hits WHERE "SearchPhrase" <> '' GROUP BY "SearchPhrase" ORDER BY u DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 15.711 sec
|
|
10 tuples
|
|
clk: 15.444 sec
|
|
10 tuples
|
|
clk: 15.503 sec
|
|
3
|
|
SELECT "SearchEngineID", "SearchPhrase", count(*) AS c FROM hits WHERE "SearchPhrase" <> '' GROUP BY "SearchEngineID", "SearchPhrase" ORDER BY c DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 11.433 sec
|
|
10 tuples
|
|
clk: 11.399 sec
|
|
10 tuples
|
|
clk: 11.285 sec
|
|
3
|
|
SELECT "UserID", count(*) FROM hits GROUP BY "UserID" ORDER BY count(*) DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 7.184 sec
|
|
10 tuples
|
|
clk: 7.015 sec
|
|
10 tuples
|
|
clk: 6.849 sec
|
|
3
|
|
SELECT "UserID", "SearchPhrase", count(*) FROM hits GROUP BY "UserID", "SearchPhrase" ORDER BY count(*) DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 29.096 sec
|
|
10 tuples
|
|
clk: 28.328 sec
|
|
10 tuples
|
|
clk: 29.247 sec
|
|
3
|
|
SELECT "UserID", "SearchPhrase", count(*) FROM hits GROUP BY "UserID", "SearchPhrase" LIMIT 10;
|
|
10 tuples
|
|
clk: 29.457 sec
|
|
10 tuples
|
|
clk: 29.364 sec
|
|
10 tuples
|
|
clk: 29.269 sec
|
|
3
|
|
SELECT "UserID", extract(minute FROM "EventTime") AS m, "SearchPhrase", count(*) FROM hits GROUP BY "UserID", m, "SearchPhrase" ORDER BY count(*) DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 47.141 sec
|
|
10 tuples
|
|
clk: 46.495 sec
|
|
10 tuples
|
|
clk: 46.472 sec
|
|
3
|
|
SELECT "UserID" FROM hits WHERE "UserID" = -6101065172474983726;
|
|
0 tuples
|
|
clk: 783.332 ms
|
|
0 tuples
|
|
clk: 771.157 ms
|
|
0 tuples
|
|
clk: 783.082 ms
|
|
3
|
|
SELECT count(*) FROM hits WHERE "URL" LIKE '%metrika%';
|
|
1 tuple
|
|
clk: 3.963 sec
|
|
1 tuple
|
|
clk: 3.930 sec
|
|
1 tuple
|
|
clk: 3.964 sec
|
|
3
|
|
SELECT "SearchPhrase", min("URL"), count(*) AS c FROM hits WHERE "URL" LIKE '%metrika%' AND "SearchPhrase" <> '' GROUP BY "SearchPhrase" ORDER BY c DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 3.925 sec
|
|
10 tuples
|
|
clk: 3.817 sec
|
|
10 tuples
|
|
clk: 3.802 sec
|
|
3
|
|
SELECT "SearchPhrase", min("URL"), min("Title"), count(*) AS c, COUNT(DISTINCT "UserID") FROM hits WHERE "Title" LIKE '%Яндекс%' AND "URL" NOT LIKE '%.yandex.%' AND "SearchPhrase" <> '' GROUP BY "SearchPhrase" ORDER BY c DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 6.067 sec
|
|
10 tuples
|
|
clk: 6.120 sec
|
|
10 tuples
|
|
clk: 6.012 sec
|
|
3
|
|
SELECT * FROM hits WHERE "URL" LIKE '%metrika%' ORDER BY "EventTime" LIMIT 10;
|
|
10 tuples !87 columns dropped, 29 fields truncated!
|
|
clk: 4.251 sec
|
|
10 tuples !87 columns dropped, 29 fields truncated!
|
|
clk: 4.190 sec
|
|
10 tuples !87 columns dropped, 29 fields truncated!
|
|
clk: 4.379 sec
|
|
3
|
|
SELECT "SearchPhrase" FROM hits WHERE "SearchPhrase" <> '' ORDER BY "EventTime" LIMIT 10;
|
|
10 tuples
|
|
clk: 6.699 sec
|
|
10 tuples
|
|
clk: 6.718 sec
|
|
10 tuples
|
|
clk: 6.802 sec
|
|
3
|
|
SELECT "SearchPhrase" FROM hits WHERE "SearchPhrase" <> '' ORDER BY "SearchPhrase" LIMIT 10;
|
|
10 tuples
|
|
clk: 6.887 sec
|
|
10 tuples
|
|
clk: 6.838 sec
|
|
10 tuples
|
|
clk: 6.844 sec
|
|
3
|
|
SELECT "SearchPhrase" FROM hits WHERE "SearchPhrase" <> '' ORDER BY "EventTime", "SearchPhrase" LIMIT 10;
|
|
10 tuples
|
|
clk: 6.806 sec
|
|
10 tuples
|
|
clk: 6.878 sec
|
|
10 tuples
|
|
clk: 6.807 sec
|
|
3
|
|
SELECT "CounterID", avg(length("URL")) AS l, count(*) AS c FROM hits WHERE "URL" <> '' GROUP BY "CounterID" HAVING count(*) > 100000 ORDER BY l DESC LIMIT 25;
|
|
25 tuples
|
|
clk: 1:01 min
|
|
25 tuples
|
|
clk: 55.553 sec
|
|
25 tuples
|
|
clk: 56.188 sec
|
|
3
|
|
SELECT sys.getdomain("Referer") AS key, avg(length("Referer")) AS l, count(*) AS c, min("Referer") FROM hits WHERE "Referer" <> '' GROUP BY key HAVING count(*) > 100000 ORDER BY l DESC LIMIT 25;
|
|
clk: 1:00 min
|
|
clk: 1:00 min
|
|
clk: 1:00 min
|
|
3
|
|
SELECT sum("ResolutionWidth"), sum("ResolutionWidth" + 1), sum("ResolutionWidth" + 2), sum("ResolutionWidth" + 3), sum("ResolutionWidth" + 4), sum("ResolutionWidth" + 5), sum("ResolutionWidth" + 6), sum("ResolutionWidth" + 7), sum("ResolutionWidth" + 8), sum("ResolutionWidth" + 9), sum("ResolutionWidth" + 10), sum("ResolutionWidth" + 11), sum("ResolutionWidth" + 12), sum("ResolutionWidth" + 13), sum("ResolutionWidth" + 14), sum("ResolutionWidth" + 15), sum("ResolutionWidth" + 16), sum("ResolutionWidth" + 17), sum("ResolutionWidth" + 18), sum("ResolutionWidth" + 19), sum("ResolutionWidth" + 20), sum("ResolutionWidth" + 21), sum("ResolutionWidth" + 22), sum("ResolutionWidth" + 23), sum("ResolutionWidth" + 24), sum("ResolutionWidth" + 25), sum("ResolutionWidth" + 26), sum("ResolutionWidth" + 27), sum("ResolutionWidth" + 28), sum("ResolutionWidth" + 29), sum("ResolutionWidth" + 30), sum("ResolutionWidth" + 31), sum("ResolutionWidth" + 32), sum("ResolutionWidth" + 33), sum("ResolutionWidth" + 34), sum("ResolutionWidth" + 35), sum("ResolutionWidth" + 36), sum("ResolutionWidth" + 37), sum("ResolutionWidth" + 38), sum("ResolutionWidth" + 39), sum("ResolutionWidth" + 40), sum("ResolutionWidth" + 41), sum("ResolutionWidth" + 42), sum("ResolutionWidth" + 43), sum("ResolutionWidth" + 44), sum("ResolutionWidth" + 45), sum("ResolutionWidth" + 46), sum("ResolutionWidth" + 47), sum("ResolutionWidth" + 48), sum("ResolutionWidth" + 49), sum("ResolutionWidth" + 50), sum("ResolutionWidth" + 51), sum("ResolutionWidth" + 52), sum("ResolutionWidth" + 53), sum("ResolutionWidth" + 54), sum("ResolutionWidth" + 55), sum("ResolutionWidth" + 56), sum("ResolutionWidth" + 57), sum("ResolutionWidth" + 58), sum("ResolutionWidth" + 59), sum("ResolutionWidth" + 60), sum("ResolutionWidth" + 61), sum("ResolutionWidth" + 62), sum("ResolutionWidth" + 63), sum("ResolutionWidth" + 64), sum("ResolutionWidth" + 65), sum("ResolutionWidth" + 66), sum("ResolutionWidth" + 67), sum("ResolutionWidth" + 68), sum("ResolutionWidth" + 69), sum("ResolutionWidth" + 70), sum("ResolutionWidth" + 71), sum("ResolutionWidth" + 72), sum("ResolutionWidth" + 73), sum("ResolutionWidth" + 74), sum("ResolutionWidth" + 75), sum("ResolutionWidth" + 76), sum("ResolutionWidth" + 77), sum("ResolutionWidth" + 78), sum("ResolutionWidth" + 79), sum("ResolutionWidth" + 80), sum("ResolutionWidth" + 81), sum("ResolutionWidth" + 82), sum("ResolutionWidth" + 83), sum("ResolutionWidth" + 84), sum("ResolutionWidth" + 85), sum("ResolutionWidth" + 86), sum("ResolutionWidth" + 87), sum("ResolutionWidth" + 88), sum("ResolutionWidth" + 89) FROM hits;
|
|
1 tuple !77 columns dropped!
|
|
clk: 6.221 sec
|
|
1 tuple !77 columns dropped!
|
|
clk: 6.170 sec
|
|
1 tuple !77 columns dropped!
|
|
clk: 6.382 sec
|
|
3
|
|
SELECT "SearchEngineID", "ClientIP", count(*) AS c, sum("Refresh"), avg("ResolutionWidth") FROM hits WHERE "SearchPhrase" <> '' GROUP BY "SearchEngineID", "ClientIP" ORDER BY c DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 5.684 sec
|
|
10 tuples
|
|
clk: 5.585 sec
|
|
10 tuples
|
|
clk: 5.463 sec
|
|
3
|
|
SELECT "WatchID", "ClientIP", count(*) AS c, sum("Refresh"), avg("ResolutionWidth") FROM hits WHERE "SearchPhrase" <> '' GROUP BY "WatchID", "ClientIP" ORDER BY c DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 6.281 sec
|
|
10 tuples
|
|
clk: 6.574 sec
|
|
10 tuples
|
|
clk: 6.243 sec
|
|
3
|
|
SELECT "WatchID", "ClientIP", count(*) AS c, sum("Refresh"), avg("ResolutionWidth") FROM hits GROUP BY "WatchID", "ClientIP" ORDER BY c DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 44.641 sec
|
|
10 tuples
|
|
clk: 41.904 sec
|
|
10 tuples
|
|
clk: 43.218 sec
|
|
3
|
|
SELECT "URL", count(*) AS c FROM hits GROUP BY "URL" ORDER BY c DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 1:24 min
|
|
10 tuples
|
|
clk: 1:31 min
|
|
10 tuples
|
|
clk: 1:24 min
|
|
3
|
|
SELECT 1, "URL", count(*) AS c FROM hits GROUP BY 1, "URL" ORDER BY c DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 1:24 min
|
|
10 tuples
|
|
clk: 1:25 min
|
|
10 tuples
|
|
clk: 1:24 min
|
|
3
|
|
SELECT "ClientIP", "ClientIP" - 1, "ClientIP" - 2, "ClientIP" - 3, count(*) AS c FROM hits GROUP BY "ClientIP", "ClientIP" - 1, "ClientIP" - 2, "ClientIP" - 3 ORDER BY c DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 26.438 sec
|
|
10 tuples
|
|
clk: 26.033 sec
|
|
10 tuples
|
|
clk: 26.147 sec
|
|
3
|
|
SELECT "URL", count(*) AS "PageViews" FROM hits WHERE "CounterID" = 62 AND "EventDate" >= '2013-07-01' AND "EventDate" <= '2013-07-31' AND "DontCountHits" = 0 AND "Refresh" = 0 AND "URL" <> '' GROUP BY "URL" ORDER BY "PageViews" DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 4.825 sec
|
|
10 tuples
|
|
clk: 4.618 sec
|
|
10 tuples
|
|
clk: 4.623 sec
|
|
3
|
|
SELECT "Title", count(*) AS "PageViews" FROM hits WHERE "CounterID" = 62 AND "EventDate" >= '2013-07-01' AND "EventDate" <= '2013-07-31' AND "DontCountHits" = 0 AND "Refresh" = 0 AND "Title" <> '' GROUP BY "Title" ORDER BY "PageViews" DESC LIMIT 10;
|
|
10 tuples
|
|
clk: 4.380 sec
|
|
10 tuples
|
|
clk: 4.418 sec
|
|
10 tuples
|
|
clk: 4.413 sec
|
|
3
|
|
SELECT "URL", count(*) AS "PageViews" FROM hits WHERE "CounterID" = 62 AND "EventDate" >= '2013-07-01' AND "EventDate" <= '2013-07-31' AND "Refresh" = 0 AND "IsLink" <> 0 AND "IsDownload" = 0 GROUP BY "URL" ORDER BY "PageViews" DESC LIMIT 1000;
|
|
1000 tuples
|
|
clk: 4.259 sec
|
|
1000 tuples
|
|
clk: 4.195 sec
|
|
1000 tuples
|
|
clk: 4.195 sec
|
|
3
|
|
SELECT "TraficSourceID", "SearchEngineID", "AdvEngineID", CASE WHEN ("SearchEngineID" = 0 AND "AdvEngineID" = 0) THEN "Referer" ELSE '' END AS Src, "URL" AS Dst, count(*) AS "PageViews" FROM hits WHERE "CounterID" = 62 AND "EventDate" >= '2013-07-01' AND "EventDate" <= '2013-07-31' AND "Refresh" = 0 GROUP BY "TraficSourceID", "SearchEngineID", "AdvEngineID", CASE WHEN ("SearchEngineID" = 0 AND "AdvEngineID" = 0) THEN "Referer" ELSE '' END, "URL" ORDER BY "PageViews" DESC LIMIT 1000;
|
|
1000 tuples
|
|
clk: 3.233 sec
|
|
1000 tuples
|
|
clk: 3.180 sec
|
|
1000 tuples
|
|
clk: 3.181 sec
|
|
3
|
|
SELECT "URLHash", "EventDate", count(*) AS "PageViews" FROM hits WHERE "CounterID" = 62 AND "EventDate" >= '2013-07-01' AND "EventDate" <= '2013-07-31' AND "Refresh" = 0 AND "TraficSourceID" IN (-1, 6) AND "RefererHash" = 686716256552154761 GROUP BY "URLHash", "EventDate" ORDER BY "PageViews" DESC LIMIT 100;
|
|
0 tuples
|
|
clk: 2.656 sec
|
|
0 tuples
|
|
clk: 2.557 sec
|
|
0 tuples
|
|
clk: 2.561 sec
|
|
3
|
|
SELECT "WindowClientWidth", "WindowClientHeight", count(*) AS "PageViews" FROM hits WHERE "CounterID" = 62 AND "EventDate" >= '2013-07-01' AND "EventDate" <= '2013-07-31' AND "Refresh" = 0 AND "DontCountHits" = 0 AND "URLHash" = 686716256552154761 GROUP BY "WindowClientWidth", "WindowClientHeight" ORDER BY "PageViews" DESC LIMIT 10000;
|
|
0 tuples
|
|
clk: 4.161 sec
|
|
0 tuples
|
|
clk: 4.243 sec
|
|
0 tuples
|
|
clk: 4.166 sec
|
|
3
|
|
SELECT DATE_TRUNC('minute', "EventTime") AS "Minute", count(*) AS "PageViews" FROM hits WHERE "CounterID" = 62 AND "EventDate" >= '2013-07-01' AND "EventDate" <= '2013-07-02' AND "Refresh" = 0 AND "DontCountHits" = 0 GROUP BY DATE_TRUNC('minute', "EventTime") ORDER BY DATE_TRUNC('minute', "EventTime");
|
|
0 tuples
|
|
clk: 4.199 sec
|
|
0 tuples
|
|
clk: 4.211 sec
|
|
0 tuples
|
|
clk: 4.190 sec
|