Skip to content

Commit 7bb854d

Browse files
authored
Merge pull request ClickHouse#364 from lukasvogel/main
Add CedarDB
2 parents 08a2290 + 8ffe6f1 commit 7bb854d

File tree

6 files changed

+314
-0
lines changed

6 files changed

+314
-0
lines changed

cedardb/benchmark.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash -e
2+
3+
# docker
4+
sudo apt-get update
5+
sudo apt-get install -y docker.io postgresql-client gzip
6+
7+
# download dataset
8+
echo "Downloading dataset..."
9+
wget --continue 'https://datasets.clickhouse.com/hits_compatible/hits.tsv.gz'
10+
echo "Unpacking dataset..."
11+
gzip -d hits.tsv.gz
12+
mkdir data
13+
mv hits.tsv data
14+
chmod -R 777 data
15+
rm -rf db
16+
mkdir db
17+
18+
# get and configure CedarDB image
19+
echo "Starting CedarDB..."
20+
docker run --rm -p 5432:5432 -v ./data:/data -v ./db:/var/lib/cedardb/data -e CEDAR_PASSWORD=test --name cedardb cedardb/cedardb:latest > /dev/null 2>&1 &
21+
22+
# wait for container to start
23+
until pg_isready -h localhost --dbname postgres -U postgres > /dev/null 2>&1; do sleep 1; done
24+
25+
# create table and ingest data
26+
PGPASSWORD=test psql -h localhost -U postgres -t < create.sql
27+
echo "Inserting data..."
28+
PGPASSWORD=test time psql -h localhost -U postgres -t -c '\timing' -c "COPY hits FROM '/data/hits.tsv';"
29+
30+
# get ingested data size
31+
echo "data size after ingest:"
32+
PGPASSWORD=test psql -h localhost -U postgres -t -c '\timing' -c "SELECT pg_total_relation_size('hits');"
33+
34+
# run benchmark
35+
echo "running benchmark..."
36+
./run.sh 2>&1 | tee log.txt
37+
38+
cat log.txt | \
39+
grep -oP 'Time: \d+\.\d+ ms' | \
40+
sed -r -e 's/Time: ([0-9]+\.[0-9]+) ms/\1/' | \
41+
awk '{ if (i % 3 == 0) { printf "[" }; printf $1 / 1000; if (i % 3 != 2) { printf "," } else { print "]," }; ++i; }'

cedardb/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+
);
109+

cedardb/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;

cedardb/results/c6a.4xlarge.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"system": "CedarDB",
3+
"date": "2025-05-13",
4+
"machine": "c6a.4xlarge, 500gb gp2",
5+
"cluster_size": 1,
6+
"tags": ["C++", "column-oriented", "PostgreSQL compatible"],
7+
"load_time": 678.319,
8+
"data_size": 34178593296,
9+
"result": [
10+
[0.045546,0.01239,0.009761],
11+
[0.068054,0.003996,0.00395],
12+
[0.075834,0.028006,0.029268],
13+
[0.079261,0.026982,0.025895],
14+
[0.136197,0.128637,0.127705],
15+
[1.49167,0.2131,0.21466],
16+
[0.035958,0.028353,0.025267],
17+
[0.019709,0.004367,0.004137],
18+
[0.277884,0.222673,0.224794],
19+
[0.298195,0.297072,0.302439],
20+
[0.079287,0.031605,0.032011],
21+
[0.073052,0.033233,0.033808],
22+
[0.189603,0.179199,0.177913],
23+
[0.314636,0.320284,0.315986],
24+
[0.197241,0.19097,0.192531],
25+
[0.153453,0.151451,0.149093],
26+
[0.436293,0.433139,0.435853],
27+
[0.406462,0.407494,0.406696],
28+
[1.32138,0.763988,0.746778],
29+
[0.003121,0.001525,0.001504],
30+
[14.1902,1.48478,0.28938],
31+
[2.39374,0.645003,0.384866],
32+
[18.7271,9.36254,4.73712],
33+
[116.117,152.357,145.965],
34+
[3.89221,0.007532,0.006329],
35+
[0.009266,0.009319,0.009302],
36+
[0.007104,0.006846,0.006431],
37+
[13.0675,1.67841,0.29181],
38+
[11.0241,3.27706,3.23834],
39+
[0.075202,0.022927,0.02772],
40+
[2.93094,0.089051,0.097671],
41+
[2.69473,0.135952,0.138472],
42+
[0.978692,0.991592,0.968237],
43+
[9.97283,1.11121,1.09719],
44+
[1.08623,1.09635,1.08831],
45+
[0.162726,0.141096,0.139401],
46+
[0.020747,0.014121,0.013001],
47+
[0.023358,0.007492,0.007233],
48+
[0.009018,0.00338,0.003532],
49+
[0.036507,0.027613,0.026543],
50+
[0.017446,0.00351,0.003404],
51+
[0.01379,0.003111,0.003029],
52+
[0.011919,0.004089,0.004237]
53+
]
54+
}

cedardb/results/c6a.metal.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"system": "CedarDB",
3+
"date": "2025-05-13",
4+
"machine": "c6a.metal, 500gb gp2",
5+
"cluster_size": 1,
6+
"tags": ["C++", "column-oriented", "PostgreSQL compatible"],
7+
"load_time": 342.686,
8+
"data_size": 33827930336,
9+
"result": [
10+
[0.015903,0.007937,0.0112],
11+
[0.015738,0.009762,0.01134],
12+
[0.022613,0.010048,0.0115],
13+
[0.031687,0.012559,0.01815],
14+
[0.113291,0.120885,0.116445],
15+
[0.135374,0.106714,0.111219],
16+
[0.018673,0.006763,0.007301],
17+
[0.017085,0.009567,0.014305],
18+
[0.175729,0.174836,0.173616],
19+
[0.207353,0.188686,0.206513],
20+
[0.041237,0.044553,0.048434],
21+
[0.046603,0.050607,0.053371],
22+
[0.108225,0.107493,0.110854],
23+
[0.284398,0.220904,0.227482],
24+
[0.111605,0.109086,0.109159],
25+
[0.126084,0.126095,0.125418],
26+
[0.210443,0.211761,0.217197],
27+
[0.205717,0.208549,0.212579],
28+
[0.345094,0.338423,0.337251],
29+
[0.007342,0.009128,0.008237],
30+
[0.176127,0.046195,0.045011],
31+
[0.030345,0.028658,0.029807],
32+
[0.117219,0.04793,0.052024],
33+
[0.591612,0.229091,0.182155],
34+
[0.014005,0.021322,0.018759],
35+
[0.012223,0.016666,0.016326],
36+
[0.014598,0.01603,0.015416],
37+
[0.052689,0.053599,0.052233],
38+
[0.419705,0.407123,0.397166],
39+
[0.01129,0.010316,0.011104],
40+
[0.076987,0.083873,0.087713],
41+
[0.103236,0.099908,0.100091],
42+
[0.399066,0.379193,0.3791],
43+
[0.473589,0.48222,0.479159],
44+
[0.473132,0.47224,0.474057],
45+
[0.095503,0.101621,0.099268],
46+
[0.017626,0.01641,0.015517],
47+
[0.012444,0.012431,0.011561],
48+
[0.010672,0.009959,0.010551],
49+
[0.039136,0.036818,0.046531],
50+
[0.01256,0.011261,0.011571],
51+
[0.006826,0.009368,0.009126],
52+
[0.008222,0.00802,0.009156]
53+
]
54+
}

cedardb/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 -r 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+
PGPASSWORD=test psql -h localhost -U postgres -t -c '\timing' -c "$query" | grep 'Time'
12+
done
13+
done

0 commit comments

Comments
 (0)