Skip to content

Commit fc7b3e8

Browse files
Merge pull request #166 from ClickHouse/toschmidt-main
Reproduce and merge Umbra
2 parents 20d6e1b + c8aa512 commit fc7b3e8

File tree

6 files changed

+309
-0
lines changed

6 files changed

+309
-0
lines changed

umbra/benchmark.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
sudo apt-get update
4+
sudo apt-get install -y postgresql-client gzip
5+
6+
wget --no-verbose --continue 'https://datasets.clickhouse.com/hits_compatible/hits.tsv.gz'
7+
gzip -d hits.tsv.gz
8+
chmod 777 ~ hits.tsv
9+
10+
rm -rf umbra-24-01-03.tar.xz umbra
11+
wget --no-verbose --continue 'https://db.in.tum.de/~schmidt/umbra-24-01-03.tar.xz'
12+
tar -xf umbra-24-01-03.tar.xz
13+
14+
rm -rf db
15+
mkdir db
16+
17+
export USEDIRECTIO=1
18+
umbra/bin/sql -createdb db/umbra.db <<<"ALTER ROLE postgres WITH LOGIN SUPERUSER PASSWORD 'password';"
19+
20+
umbra/bin/server -createSSLFiles -certFile db/umbra.cert -keyFile db/umbra.pem -address 0.0.0.0 db/umbra.db &> umbra.log &
21+
sleep 1
22+
23+
psql -h /tmp -U postgres -t < create.sql
24+
psql -h /tmp -U postgres -t -c '\timing' -c "copy hits from 'hits.tsv' with (format text);"
25+
26+
./run.sh 2>&1 | tee log.txt
27+
28+
du -bcs db/
29+
30+
cat log.txt | grep -oP 'Time: \d+\.\d+ ms' | sed -r -e 's/Time: ([0-9]+\.[0-9]+) ms/\1/' |
31+
awk '{ if (i % 3 == 0) { printf "[" }; printf $1 / 1000; if (i % 3 != 2) { printf "," } else { print "]," }; ++i; }'
32+
33+
killall server
34+
rm -rf hits.tsv

umbra/create.sql

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
create table hits (
2+
watchid bigint not null,
3+
javaenable smallint not null,
4+
title text not null,
5+
goodevent smallint not null,
6+
eventtime timestamp not null,
7+
eventdate date not null,
8+
counterid integer not null,
9+
clientip integer not null,
10+
regionid integer not null,
11+
userid bigint not null,
12+
counterclass smallint not null,
13+
os smallint not null,
14+
useragent smallint not null,
15+
url text not null,
16+
referer text not null,
17+
isrefresh smallint not null,
18+
referercategoryid smallint not null,
19+
refererregionid integer not null,
20+
urlcategoryid smallint not null,
21+
urlregionid integer not null,
22+
resolutionwidth smallint not null,
23+
resolutionheight smallint not null,
24+
resolutiondepth smallint not null,
25+
flashmajor smallint not null,
26+
flashminor smallint not null,
27+
flashminor2 text not null,
28+
netmajor smallint not null,
29+
netminor smallint not null,
30+
useragentmajor smallint not null,
31+
useragentminor varchar(255) not null,
32+
cookieenable smallint not null,
33+
javascriptenable smallint not null,
34+
ismobile smallint not null,
35+
mobilephone smallint not null,
36+
mobilephonemodel text not null,
37+
params text not null,
38+
ipnetworkid integer not null,
39+
traficsourceid smallint not null,
40+
searchengineid smallint not null,
41+
searchphrase text not null,
42+
advengineid smallint not null,
43+
isartifical smallint not null,
44+
windowclientwidth smallint not null,
45+
windowclientheight smallint not null,
46+
clienttimezone smallint not null,
47+
clienteventtime timestamp not null,
48+
silverlightversion1 smallint not null,
49+
silverlightversion2 smallint not null,
50+
silverlightversion3 integer not null,
51+
silverlightversion4 smallint not null,
52+
pagecharset text not null,
53+
codeversion integer not null,
54+
islink smallint not null,
55+
isdownload smallint not null,
56+
isnotbounce smallint not null,
57+
funiqid bigint not null,
58+
originalurl text not null,
59+
hid integer not null,
60+
isoldcounter smallint not null,
61+
isevent smallint not null,
62+
isparameter smallint not null,
63+
dontcounthits smallint not null,
64+
withhash smallint not null,
65+
hitcolor char not null,
66+
localeventtime timestamp not null,
67+
age smallint not null,
68+
sex smallint not null,
69+
income smallint not null,
70+
interests smallint not null,
71+
robotness smallint not null,
72+
remoteip integer not null,
73+
windowname integer not null,
74+
openername integer not null,
75+
historylength smallint not null,
76+
browserlanguage text not null,
77+
browsercountry text not null,
78+
socialnetwork text not null,
79+
socialaction text not null,
80+
httperror smallint not null,
81+
sendtiming integer not null,
82+
dnstiming integer not null,
83+
connecttiming integer not null,
84+
responsestarttiming integer not null,
85+
responseendtiming integer not null,
86+
fetchtiming integer not null,
87+
socialsourcenetworkid smallint not null,
88+
socialsourcepage text not null,
89+
paramprice bigint not null,
90+
paramorderid text not null,
91+
paramcurrency text not null,
92+
paramcurrencyid smallint not null,
93+
openstatservicename text not null,
94+
openstatcampaignid text not null,
95+
openstatadid text not null,
96+
openstatsourceid text not null,
97+
utmsource text not null,
98+
utmmedium text not null,
99+
utmcampaign text not null,
100+
utmcontent text not null,
101+
utmterm text not null,
102+
fromtag text not null,
103+
hasgclid smallint not null,
104+
refererhash bigint not null,
105+
urlhash bigint not null,
106+
clid integer not null,
107+
primary key (counterid, eventdate, userid, eventtime, watchid)
108+
) with (storage=columnar);
109+

umbra/queries.sql

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
SELECT COUNT(*) FROM hits;
2+
SELECT COUNT(*) FROM hits WHERE AdvEngineID <> 0;
3+
SELECT SUM(AdvEngineID), COUNT(*), AVG(ResolutionWidth) FROM hits;
4+
SELECT AVG(UserID) FROM hits;
5+
SELECT COUNT(DISTINCT UserID) FROM hits;
6+
SELECT COUNT(DISTINCT SearchPhrase) FROM hits;
7+
SELECT MIN(EventDate), MAX(EventDate) FROM hits;
8+
SELECT AdvEngineID, COUNT(*) FROM hits WHERE AdvEngineID <> 0 GROUP BY AdvEngineID ORDER BY COUNT(*) DESC;
9+
SELECT RegionID, COUNT(DISTINCT UserID) AS u FROM hits GROUP BY RegionID ORDER BY u DESC LIMIT 10;
10+
SELECT RegionID, SUM(AdvEngineID), COUNT(*) AS c, AVG(ResolutionWidth), COUNT(DISTINCT UserID) FROM hits GROUP BY RegionID ORDER BY c DESC LIMIT 10;
11+
SELECT MobilePhoneModel, COUNT(DISTINCT UserID) AS u FROM hits WHERE MobilePhoneModel <> '' GROUP BY MobilePhoneModel ORDER BY u DESC LIMIT 10;
12+
SELECT MobilePhone, MobilePhoneModel, COUNT(DISTINCT UserID) AS u FROM hits WHERE MobilePhoneModel <> '' GROUP BY MobilePhone, MobilePhoneModel ORDER BY u DESC LIMIT 10;
13+
SELECT SearchPhrase, COUNT(*) AS c FROM hits WHERE SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY c DESC LIMIT 10;
14+
SELECT SearchPhrase, COUNT(DISTINCT UserID) AS u FROM hits WHERE SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY u DESC LIMIT 10;
15+
SELECT SearchEngineID, SearchPhrase, COUNT(*) AS c FROM hits WHERE SearchPhrase <> '' GROUP BY SearchEngineID, SearchPhrase ORDER BY c DESC LIMIT 10;
16+
SELECT UserID, COUNT(*) FROM hits GROUP BY UserID ORDER BY COUNT(*) DESC LIMIT 10;
17+
SELECT UserID, SearchPhrase, COUNT(*) FROM hits GROUP BY UserID, SearchPhrase ORDER BY COUNT(*) DESC LIMIT 10;
18+
SELECT UserID, SearchPhrase, COUNT(*) FROM hits GROUP BY UserID, SearchPhrase LIMIT 10;
19+
SELECT UserID, extract(minute FROM EventTime) AS m, SearchPhrase, COUNT(*) FROM hits GROUP BY UserID, m, SearchPhrase ORDER BY COUNT(*) DESC LIMIT 10;
20+
SELECT UserID FROM hits WHERE UserID = 435090932899640449;
21+
SELECT COUNT(*) FROM hits WHERE URL LIKE '%google%';
22+
SELECT SearchPhrase, MIN(URL), COUNT(*) AS c FROM hits WHERE URL LIKE '%google%' AND SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY c DESC LIMIT 10;
23+
SELECT SearchPhrase, MIN(URL), MIN(Title), COUNT(*) AS c, COUNT(DISTINCT UserID) FROM hits WHERE Title LIKE '%Google%' AND URL NOT LIKE '%.google.%' AND SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY c DESC LIMIT 10;
24+
SELECT * FROM hits WHERE URL LIKE '%google%' ORDER BY EventTime LIMIT 10;
25+
SELECT SearchPhrase FROM hits WHERE SearchPhrase <> '' ORDER BY EventTime LIMIT 10;
26+
SELECT SearchPhrase FROM hits WHERE SearchPhrase <> '' ORDER BY SearchPhrase LIMIT 10;
27+
SELECT SearchPhrase FROM hits WHERE SearchPhrase <> '' ORDER BY EventTime, SearchPhrase LIMIT 10;
28+
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;
29+
SELECT REGEXP_REPLACE(Referer, '^https?://(?:www\.)?([^/]+)/.*$', '\1') AS k, AVG(length(Referer)) AS l, COUNT(*) AS c, MIN(Referer) FROM hits WHERE Referer <> '' GROUP BY k HAVING COUNT(*) > 100000 ORDER BY l DESC LIMIT 25;
30+
SELECT SUM(ResolutionWidth::bigint), SUM(ResolutionWidth::bigint + 1), SUM(ResolutionWidth::bigint + 2), SUM(ResolutionWidth::bigint + 3), SUM(ResolutionWidth::bigint + 4), SUM(ResolutionWidth::bigint + 5), SUM(ResolutionWidth::bigint + 6), SUM(ResolutionWidth::bigint + 7), SUM(ResolutionWidth::bigint + 8), SUM(ResolutionWidth::bigint + 9), SUM(ResolutionWidth::bigint + 10), SUM(ResolutionWidth::bigint + 11), SUM(ResolutionWidth::bigint + 12), SUM(ResolutionWidth::bigint + 13), SUM(ResolutionWidth::bigint + 14), SUM(ResolutionWidth::bigint + 15), SUM(ResolutionWidth::bigint + 16), SUM(ResolutionWidth::bigint + 17), SUM(ResolutionWidth::bigint + 18), SUM(ResolutionWidth::bigint + 19), SUM(ResolutionWidth::bigint + 20), SUM(ResolutionWidth::bigint + 21), SUM(ResolutionWidth::bigint + 22), SUM(ResolutionWidth::bigint + 23), SUM(ResolutionWidth::bigint + 24), SUM(ResolutionWidth::bigint + 25), SUM(ResolutionWidth::bigint + 26), SUM(ResolutionWidth::bigint + 27), SUM(ResolutionWidth::bigint + 28), SUM(ResolutionWidth::bigint + 29), SUM(ResolutionWidth::bigint + 30), SUM(ResolutionWidth::bigint + 31), SUM(ResolutionWidth::bigint + 32), SUM(ResolutionWidth::bigint + 33), SUM(ResolutionWidth::bigint + 34), SUM(ResolutionWidth::bigint + 35), SUM(ResolutionWidth::bigint + 36), SUM(ResolutionWidth::bigint + 37), SUM(ResolutionWidth::bigint + 38), SUM(ResolutionWidth::bigint + 39), SUM(ResolutionWidth::bigint + 40), SUM(ResolutionWidth::bigint + 41), SUM(ResolutionWidth::bigint + 42), SUM(ResolutionWidth::bigint + 43), SUM(ResolutionWidth::bigint + 44), SUM(ResolutionWidth::bigint + 45), SUM(ResolutionWidth::bigint + 46), SUM(ResolutionWidth::bigint + 47), SUM(ResolutionWidth::bigint + 48), SUM(ResolutionWidth::bigint + 49), SUM(ResolutionWidth::bigint + 50), SUM(ResolutionWidth::bigint + 51), SUM(ResolutionWidth::bigint + 52), SUM(ResolutionWidth::bigint + 53), SUM(ResolutionWidth::bigint + 54), SUM(ResolutionWidth::bigint + 55), SUM(ResolutionWidth::bigint + 56), SUM(ResolutionWidth::bigint + 57), SUM(ResolutionWidth::bigint + 58), SUM(ResolutionWidth::bigint + 59), SUM(ResolutionWidth::bigint + 60), SUM(ResolutionWidth::bigint + 61), SUM(ResolutionWidth::bigint + 62), SUM(ResolutionWidth::bigint + 63), SUM(ResolutionWidth::bigint + 64), SUM(ResolutionWidth::bigint + 65), SUM(ResolutionWidth::bigint + 66), SUM(ResolutionWidth::bigint + 67), SUM(ResolutionWidth::bigint + 68), SUM(ResolutionWidth::bigint + 69), SUM(ResolutionWidth::bigint + 70), SUM(ResolutionWidth::bigint + 71), SUM(ResolutionWidth::bigint + 72), SUM(ResolutionWidth::bigint + 73), SUM(ResolutionWidth::bigint + 74), SUM(ResolutionWidth::bigint + 75), SUM(ResolutionWidth::bigint + 76), SUM(ResolutionWidth::bigint + 77), SUM(ResolutionWidth::bigint + 78), SUM(ResolutionWidth::bigint + 79), SUM(ResolutionWidth::bigint + 80), SUM(ResolutionWidth::bigint + 81), SUM(ResolutionWidth::bigint + 82), SUM(ResolutionWidth::bigint + 83), SUM(ResolutionWidth::bigint + 84), SUM(ResolutionWidth::bigint + 85), SUM(ResolutionWidth::bigint + 86), SUM(ResolutionWidth::bigint + 87), SUM(ResolutionWidth::bigint + 88), SUM(ResolutionWidth::bigint + 89) FROM hits;
31+
SELECT SearchEngineID, ClientIP, COUNT(*) AS c, SUM(IsRefresh), AVG(ResolutionWidth) FROM hits WHERE SearchPhrase <> '' GROUP BY SearchEngineID, ClientIP ORDER BY c DESC LIMIT 10;
32+
SELECT WatchID, ClientIP, COUNT(*) AS c, SUM(IsRefresh), AVG(ResolutionWidth) FROM hits WHERE SearchPhrase <> '' GROUP BY WatchID, ClientIP ORDER BY c DESC LIMIT 10;
33+
SELECT WatchID, ClientIP, COUNT(*) AS c, SUM(IsRefresh), AVG(ResolutionWidth) FROM hits GROUP BY WatchID, ClientIP ORDER BY c DESC LIMIT 10;
34+
SELECT URL, COUNT(*) AS c FROM hits GROUP BY URL ORDER BY c DESC LIMIT 10;
35+
SELECT 1, URL, COUNT(*) AS c FROM hits GROUP BY 1, URL ORDER BY c DESC LIMIT 10;
36+
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;
37+
SELECT URL, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND DontCountHits = 0 AND IsRefresh = 0 AND URL <> '' GROUP BY URL ORDER BY PageViews DESC LIMIT 10;
38+
SELECT Title, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND DontCountHits = 0 AND IsRefresh = 0 AND Title <> '' GROUP BY Title ORDER BY PageViews DESC LIMIT 10;
39+
SELECT URL, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND IsRefresh = 0 AND IsLink <> 0 AND IsDownload = 0 GROUP BY URL ORDER BY PageViews DESC LIMIT 10 OFFSET 1000;
40+
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 IsRefresh = 0 GROUP BY TraficSourceID, SearchEngineID, AdvEngineID, Src, Dst ORDER BY PageViews DESC LIMIT 10 OFFSET 1000;
41+
SELECT URLHash, EventDate, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND IsRefresh = 0 AND TraficSourceID IN (-1, 6) AND RefererHash = 3594120000172545465 GROUP BY URLHash, EventDate ORDER BY PageViews DESC LIMIT 10 OFFSET 100;
42+
SELECT WindowClientWidth, WindowClientHeight, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND IsRefresh = 0 AND DontCountHits = 0 AND URLHash = 2868770270353813622 GROUP BY WindowClientWidth, WindowClientHeight ORDER BY PageViews DESC LIMIT 10 OFFSET 10000;
43+
SELECT DATE_TRUNC('minute', EventTime) AS M, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-14' AND EventDate <= '2013-07-15' AND IsRefresh = 0 AND DontCountHits = 0 GROUP BY DATE_TRUNC('minute', EventTime) ORDER BY DATE_TRUNC('minute', EventTime) LIMIT 10 OFFSET 1000;

umbra/results/c6a.4xlarge.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"system": "Umbra",
3+
"date": "2024-02-02",
4+
"machine": "c6a.4xlarge, 500gb gp2",
5+
"cluster_size": 1,
6+
"tags": ["C++", "column-oriented", "PostgreSQL compatible"],
7+
"load_time": 1061.541,
8+
"data_size": 97767877183,
9+
"comment": "Segmentation fault in the middle of the test",
10+
"result": [
11+
[0.209086,0.011738,0.012061],
12+
[0.286187,0.011852,0.003785],
13+
[0.295367,0.135114,0.044054],
14+
[0.895806,0.679204,0.680544],
15+
[0.702135,0.674911,0.677621],
16+
[4.0023,0.87053,0.613472],
17+
[0.11274,0.078905,0.087947],
18+
[0.012837,0.014259,0.014031],
19+
[2.729,0.350596,0.341228],
20+
[0.696983,0.639588,0.669598],
21+
[0.339289,0.038563,0.043669],
22+
[0.209976,0.05442,0.054552],
23+
[0.430673,0.587625,0.768441],
24+
[0.932235,0.787055,0.780889],
25+
[1.28999,0.276156,0.297337],
26+
[0.202715,0.188756,0.192702],
27+
[0.530036,0.623375,0.608413],
28+
[0.511773,0.595728,0.563421],
29+
[1.42062,1.23585,1.192],
30+
[0.035434,0.013534,0.002076],
31+
[27.6449,14.838,12.4979],
32+
[11.6779,6.98523,4.57714],
33+
[28.1569,20.2952,10.3134],
34+
[153.316,153.2,154.629],
35+
[4.08712,1.57023,0.007798],
36+
[0.010185,0.010279,0.009956],
37+
[0.038879,0.038326,0.039015],
38+
[19.3634,7.89121,4.27973],
39+
[16.7256,10.2004,3.92077],
40+
[0.303641,0.054993,0.055398],
41+
[4.58902,0.332033,0.130684],
42+
[2.79384,1.48084,0.731322],
43+
[1.38139,1.6159,1.39411],
44+
[12.9291,9.05383,6.94245],
45+
[5.3304,5.41123,5.38231],
46+
[0.57384,0.254843,0.26153],
47+
[null,null,null],
48+
[null,null,null],
49+
[null,null,null],
50+
[null,null,null],
51+
[null,null,null],
52+
[null,null,null],
53+
[null,null,null]
54+
]
55+
}

umbra/results/c6a.metal.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"system": "Umbra",
3+
"date": "2024-02-02",
4+
"machine": "c6a.metal, 500gb gp2",
5+
"cluster_size": 1,
6+
"tags": ["C++", "column-oriented", "PostgreSQL compatible"],
7+
"load_time": 432.753,
8+
"data_size": 104811147008,
9+
"comment": "It looks like it caches the data in memory, so the cold run results are incorrect",
10+
"result": [
11+
[0.021103,0.014069,0.013841],
12+
[0.016241,0.015651,0.014398],
13+
[0.016433,0.019444,0.020535],
14+
[0.019118,0.022744,0.024424],
15+
[0.087463,0.116452,0.108668],
16+
[0.137545,0.143623,0.186976],
17+
[0.022322,0.018086,0.016414],
18+
[0.01743,0.01459,0.016214],
19+
[0.13723,0.145615,0.154707],
20+
[0.602285,0.614764,0.614396],
21+
[0.052353,0.055475,0.060419],
22+
[0.066132,0.068412,0.064872],
23+
[0.143196,0.178901,0.184571],
24+
[0.246122,0.285504,0.287426],
25+
[0.141119,0.172389,0.192775],
26+
[0.133211,0.124609,0.127582],
27+
[0.187477,0.219748,0.214415],
28+
[0.157956,0.187116,0.206256],
29+
[0.267917,0.337226,0.368166],
30+
[0.036774,0.019947,0.019828],
31+
[0.180748,0.088995,0.092018],
32+
[0.050261,0.056437,0.049835],
33+
[0.085935,0.08502,0.085339],
34+
[0.384127,0.283856,0.298186],
35+
[0.023887,0.025708,0.029501],
36+
[0.026465,0.022693,0.026492],
37+
[0.038385,0.043431,0.041599],
38+
[0.108191,0.095912,0.094505],
39+
[0.384992,0.369839,0.397459],
40+
[0.023921,0.019091,0.020356],
41+
[0.105971,0.103385,0.108233],
42+
[0.133147,0.127664,0.13925],
43+
[0.332119,0.366251,0.336184],
44+
[0.592509,0.652576,0.750742],
45+
[0.839829,0.668914,0.731482],
46+
[0.386763,0.131991,0.143009],
47+
[0.038283,0.033977,0.03078],
48+
[0.02885,0.021694,0.021639],
49+
[0.025068,0.018045,0.0184],
50+
[0.041889,0.041119,0.041826],
51+
[0.030802,0.021935,0.029303],
52+
[0.020964,0.022451,0.023481],
53+
[0.017381,0.020976,0.016867]
54+
]
55+
}

umbra/run.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
TRIES=3
4+
5+
cat queries.sql | while read query; do
6+
sync
7+
echo 3 | sudo tee /proc/sys/vm/drop_caches
8+
9+
echo "$query";
10+
for i in $(seq 1 $TRIES); do
11+
psql -h /tmp -U postgres -t -c '\timing' -c "$query" | grep 'Time'
12+
done;
13+
done;

0 commit comments

Comments
 (0)