Skip to content

Commit a7437ed

Browse files
authored
Merge pull request #165 from tinybit/add_oxla_db
Added Oxla.com DB
2 parents cd86d46 + c37a35b commit a7437ed

File tree

5 files changed

+345
-0
lines changed

5 files changed

+345
-0
lines changed

oxla/benchmark.sh

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
#!/bin/bash -e
2+
3+
# cleanup
4+
sudo ps aux | grep fakes3 | grep -v grep | awk '{print $2}' | sudo xargs -r kill -9
5+
sudo ps aux | grep oxla | grep -v grep | awk '{print $2}' | sudo xargs -r kill -9
6+
7+
# docker
8+
sudo rm /usr/share/keyrings/docker-archive-keyring.gpg
9+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
10+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
11+
sudo apt update
12+
sudo apt install -y docker-ce
13+
14+
# base
15+
sudo apt-get install -y postgresql-client curl wget apt-transport-https ca-certificates software-properties-common gnupg2 parallel
16+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential
17+
18+
# ruby and fake S3
19+
sudo apt install -y ruby-full
20+
sudo gem install bundler fakes3 webrick sorted_set
21+
22+
# install aws cli tools
23+
sudo rm /usr/local/bin/aws
24+
sudo rm /usr/local/bin/aws_completer
25+
sudo rm -rf /usr/local/aws-cli
26+
sudo rm -rf ~/.aws/ aws
27+
28+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
29+
unzip awscliv2.zip
30+
sudo ./aws/install --update
31+
/usr/local/bin/aws --version
32+
rm -f awscliv2.zip
33+
34+
# configure aws
35+
mkdir -p ~/.aws
36+
echo -e "[default]\nregion = none" > ~/.aws/config
37+
echo -e "[default]\naws_access_key_id = none\naws_secret_access_key = none" > ~/.aws/credentials
38+
39+
# run fake S3
40+
sudo ps aux | grep fakes3 | grep -v grep | awk '{print $2}' | sudo xargs -r kill -9
41+
sudo rm -rf /mnt/fakes3_root
42+
sudo mkdir -p /mnt/fakes3_root
43+
sudo chmod a+rw /mnt/fakes3_root -R
44+
fakes3 -r /mnt/fakes3_root -H 0.0.0.0 -p 4569 --license license.pdf > /dev/null 2>&1 &
45+
sleep 10 # waiting for container start
46+
47+
# download dataset
48+
wget --no-verbose --continue 'https://datasets.clickhouse.com/hits_compatible/hits.tsv.gz'
49+
gzip -d hits.tsv.gz
50+
chmod 777 ~ hits.tsv
51+
52+
# convert dataset to csv
53+
rm -f part_*.csv
54+
curl https://clickhouse.com/ | sh
55+
./clickhouse local --query "SELECT * FROM 'hits.tsv' INTO OUTFILE 'hits.csv'"
56+
rm hits.tsv
57+
58+
# prepare digestable parts (5m rows each) of hits.csv
59+
split -l 5000000 hits.csv part_
60+
for file in part_*; do mv "$file" "${file}.csv"; done
61+
62+
# upload dataset (prepared parts) to fake S3 bucket
63+
aws s3 mb s3://my-new-bucket --endpoint-url http://localhost:4569
64+
65+
for file in part_*.csv; do
66+
echo "Processing file: $file"
67+
68+
# copy the file to the S3 bucket
69+
aws s3 cp "./$file" s3://my-new-bucket --endpoint-url http://localhost:4569 > /dev/null 2>&1
70+
71+
# clean-up tmp parts left after upload
72+
TMPPARTS=$(aws s3api list-objects --bucket my-new-bucket --query "Contents[?contains(Key, '_${file}_')].Key" --output text --endpoint-url http://localhost:4569)
73+
echo $TMPPARTS | tr ' ' '\n' | grep . | parallel -j16 aws s3api delete-object --bucket my-new-bucket --key {} --endpoint-url http://localhost:4569
74+
done
75+
76+
# get and configure Oxla image
77+
echo "Install and run Oxla."
78+
79+
sudo ps aux | grep oxla | grep -v grep | awk '{print $2}' | sudo xargs -r kill -9
80+
81+
sudo docker run --rm -p 5432:5432 --name oxlacontainer public.ecr.aws/oxla/release:latest > /dev/null 2>&1 &
82+
sleep 10 # waiting for container start and db initialisation (leader election, etc.)
83+
84+
sudo docker exec oxlacontainer /bin/bash -c "sed -i 's#endpoint: \"\"#endpoint: \"http://localhost:4569\"#g' oxla/default_config.yml"
85+
sudo docker exec oxlacontainer /bin/bash -c "sed -i 's#endpoint:.*#endpoint: '\''http://localhost:4569'\''#g' oxla/startup_config/config.yml"
86+
sudo docker rmi oxla-configured-image:latest > /dev/null 2>&1 || echo "" > /dev/null
87+
sudo docker commit oxlacontainer oxla-configured-image
88+
89+
sudo ps aux | grep oxla | grep -v grep | awk '{print $2}' | sudo xargs -r kill -9
90+
91+
# run oxla
92+
sudo docker run --rm --net=host --name oxlacontainer oxla-configured-image > /dev/null 2>&1 &
93+
sleep 10 # waiting for container start and db initialisation (leader election, etc.)
94+
95+
# create table and ingest data
96+
export PGCLIENTENCODING=UTF8
97+
psql -h localhost -p 5432 -U postgres -t -c 'CREATE SCHEMA test'
98+
psql -h localhost -p 5432 -U postgres -d test -t < create.sql
99+
100+
for file in part_*.csv; do
101+
echo "Processing file: $file"
102+
psql -h localhost -p 5432 -U postgres -d test -t -c '\timing' -c "COPY hits FROM 's3://my-new-bucket/$file';"
103+
aws s3api delete-object --bucket my-new-bucket --key "$file" --endpoint-url http://localhost:4569
104+
done
105+
106+
# get ingested data size
107+
echo "data size after ingest:"
108+
sudo docker exec oxlacontainer /bin/bash -c "du -s oxla/data"
109+
110+
# wait for merges to finish
111+
sleep 30
112+
113+
# kill fake S3 and remove its data
114+
ps aux | grep fakes3 | grep -v grep | awk '{print $2}' | sudo xargs -r kill -9
115+
sudo rm -rf /mnt/fakes3_root
116+
117+
# run benchmark
118+
echo "running benchmark..."
119+
./run.sh 2>&1 | tee log.txt
120+
121+
# format results
122+
cat log.txt | grep -oP 'Time: \d+\.\d+ ms' | sed -r -e 's/Time: ([0-9]+\.[0-9]+) ms/\1/' |
123+
awk '{ if (i % 3 == 0) { printf "[" }; printf $1 / 1000; if (i % 3 != 2) { printf "," } else { print "]," }; ++i; }'

oxla/create.sql

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
CREATE TABLE hits
2+
(
3+
WatchID BIGINT NOT NULL,
4+
JavaEnable INT NOT NULL,
5+
Title TEXT NOT NULL,
6+
GoodEvent INT NOT NULL,
7+
EventTime TIMESTAMP NOT NULL,
8+
EventDate Date NOT NULL,
9+
CounterID INTEGER NOT NULL,
10+
ClientIP INTEGER NOT NULL,
11+
RegionID INTEGER NOT NULL,
12+
UserID BIGINT NOT NULL,
13+
CounterClass INT NOT NULL,
14+
OS INT NOT NULL,
15+
UserAgent INT NOT NULL,
16+
URL TEXT NOT NULL,
17+
Referer TEXT NOT NULL,
18+
IsRefresh INT NOT NULL,
19+
RefererCategoryID INT NOT NULL,
20+
RefererRegionID INTEGER NOT NULL,
21+
URLCategoryID INT NOT NULL,
22+
URLRegionID INTEGER NOT NULL,
23+
ResolutionWidth INT NOT NULL,
24+
ResolutionHeight INT NOT NULL,
25+
ResolutionDepth INT NOT NULL,
26+
FlashMajor INT NOT NULL,
27+
FlashMinor INT NOT NULL,
28+
FlashMinor2 TEXT NOT NULL,
29+
NetMajor INT NOT NULL,
30+
NetMinor INT NOT NULL,
31+
UserAgentMajor INT NOT NULL,
32+
UserAgentMinor TEXT NOT NULL,
33+
CookieEnable INT NOT NULL,
34+
JavascriptEnable INT NOT NULL,
35+
IsMobile INT NOT NULL,
36+
MobilePhone INT NOT NULL,
37+
MobilePhoneModel TEXT NOT NULL,
38+
Params TEXT NOT NULL,
39+
IPNetworkID INTEGER NOT NULL,
40+
TraficSourceID INT NOT NULL,
41+
SearchEngineID INT NOT NULL,
42+
SearchPhrase TEXT NOT NULL,
43+
AdvEngineID INT NOT NULL,
44+
IsArtifical INT NOT NULL,
45+
WindowClientWidth INT NOT NULL,
46+
WindowClientHeight INT NOT NULL,
47+
ClientTimeZone INT NOT NULL,
48+
ClientEventTime TIMESTAMP NOT NULL,
49+
SilverlightVersion1 INT NOT NULL,
50+
SilverlightVersion2 INT NOT NULL,
51+
SilverlightVersion3 INTEGER NOT NULL,
52+
SilverlightVersion4 INT NOT NULL,
53+
PageCharset TEXT NOT NULL,
54+
CodeVersion INTEGER NOT NULL,
55+
IsLink INT NOT NULL,
56+
IsDownload INT NOT NULL,
57+
IsNotBounce INT NOT NULL,
58+
FUniqID BIGINT NOT NULL,
59+
OriginalURL TEXT NOT NULL,
60+
HID INTEGER NOT NULL,
61+
IsOldCounter INT NOT NULL,
62+
IsEvent INT NOT NULL,
63+
IsParameter INT NOT NULL,
64+
DontCountHits INT NOT NULL,
65+
WithHash INT NOT NULL,
66+
HitColor CHAR NOT NULL,
67+
LocalEventTime TIMESTAMP NOT NULL,
68+
Age INT NOT NULL,
69+
Sex INT NOT NULL,
70+
Income INT NOT NULL,
71+
Interests INT NOT NULL,
72+
Robotness INT NOT NULL,
73+
RemoteIP INTEGER NOT NULL,
74+
WindowName INTEGER NOT NULL,
75+
OpenerName INTEGER NOT NULL,
76+
HistoryLength INT NOT NULL,
77+
BrowserLanguage TEXT NOT NULL,
78+
BrowserCountry TEXT NOT NULL,
79+
SocialNetwork TEXT NOT NULL,
80+
SocialAction TEXT NOT NULL,
81+
HTTPError INT NOT NULL,
82+
SendTiming INTEGER NOT NULL,
83+
DNSTiming INTEGER NOT NULL,
84+
ConnectTiming INTEGER NOT NULL,
85+
ResponseStartTiming INTEGER NOT NULL,
86+
ResponseEndTiming INTEGER NOT NULL,
87+
FetchTiming INTEGER NOT NULL,
88+
SocialSourceNetworkID INT NOT NULL,
89+
SocialSourcePage TEXT NOT NULL,
90+
ParamPrice BIGINT NOT NULL,
91+
ParamOrderID TEXT NOT NULL,
92+
ParamCurrency TEXT NOT NULL,
93+
ParamCurrencyID INT NOT NULL,
94+
OpenstatServiceName TEXT NOT NULL,
95+
OpenstatCampaignID TEXT NOT NULL,
96+
OpenstatAdID TEXT NOT NULL,
97+
OpenstatSourceID TEXT NOT NULL,
98+
UTMSource TEXT NOT NULL,
99+
UTMMedium TEXT NOT NULL,
100+
UTMCampaign TEXT NOT NULL,
101+
UTMContent TEXT NOT NULL,
102+
UTMTerm TEXT NOT NULL,
103+
FromTag TEXT NOT NULL,
104+
HasGCLID INT NOT NULL,
105+
RefererHash BIGINT NOT NULL,
106+
URLHash BIGINT NOT NULL,
107+
CLID INTEGER NOT NULL
108+
);

oxla/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 NULL;
23+
SELECT NULL;
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 NULL;
30+
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;
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 NULL;

oxla/results/c6a.4xlarge.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"system": "Oxla.com",
3+
"date": "2024-01-31",
4+
"machine": "c6a.4xlarge, 500gb gp2",
5+
"cluster_size": 1,
6+
"comment": "ingests data only from non-compressed cvs. data should be ingested in chunks < ~5Gb",
7+
8+
"tags": ["C", "analytical", "somewhat PostgreSQL compatible"],
9+
10+
"load_time": 584.88,
11+
"data_size": 83948840996,
12+
13+
"result": [
14+
[0.050129,0.022855,0.022903],
15+
[0.057503,0.015481,0.015516],
16+
[0.094277,0.025541,0.026299],
17+
[0.16258,0.024306,0.023829],
18+
[0.039942,0.021789,0.02218],
19+
[0.1374,0.101147,0.099119],
20+
[0.059388,0.025719,0.0264],
21+
[0.033712,0.017465,0.0184],
22+
[0.135859,0.096702,0.095512],
23+
[0.171016,0.155303,0.154772],
24+
[0.190669,0.182083,0.183751],
25+
[0.22111,0.18886,0.193252],
26+
[2.52142,2.55214,2.54007],
27+
[2.6807,2.5843,2.63534],
28+
[2.75055,2.68715,2.67322],
29+
[1.52986,1.47056,1.49706],
30+
[8.22161,7.84746,7.57008],
31+
[7.06027,7.33078,6.88351],
32+
[10.5416,10.2955,10.2149],
33+
[0.053765,0.02466,0.023807],
34+
[2.67538,2.54948,2.71025],
35+
[null,null,null],
36+
[null,null,null],
37+
[8.75207,8.09075,8.26788],
38+
[0.359349,0.31487,0.312975],
39+
[0.331405,0.339576,0.332647],
40+
[0.351841,0.340408,0.325682],
41+
[1.62115,1.67895,1.74872],
42+
[null,null,null],
43+
[1.58662,1.58356,1.58278],
44+
[0.632047,0.553994,0.586148],
45+
[1.15181,1.14935,1.10892],
46+
[13.1952,13.0677,12.6957],
47+
[15.9073,13.0187,12.6488],
48+
[12.3274,13.7521,14.7386],
49+
[1.27877,1.35705,1.24621],
50+
[1.011,0.955655,0.967898],
51+
[3.46346,0.841062,0.878294],
52+
[0.867865,0.885799,0.812358],
53+
[4.55556,1.79754,1.75293],
54+
[4.00301,0.064817,0.062893],
55+
[0.163954,0.063076,0.060033],
56+
[null,null,null]
57+
]
58+
}

oxla/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+
sudo psql -h localhost -p 5432 -U postgres -d test -t -c '\timing' -c "$query" | grep 'Time'
12+
done;
13+
done;

0 commit comments

Comments
 (0)