Skip to content

Commit 2bc8e0b

Browse files
committed
YDB ClickBench results
1 parent 8812c3e commit 2bc8e0b

File tree

9 files changed

+683
-0
lines changed

9 files changed

+683
-0
lines changed

ydb/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# YDB
2+
3+
[YDB](https://ydb.tech) is a versatile open source Distributed SQL Database that combines high availability and scalability with strong consistency and ACID transactions. It accommodates transactional (OLTP), analytical (OLAP), and streaming workloads simultaneously.
4+
5+
## Running the benchmark
6+
7+
YDB is a distributed database, the minimum in terms of fault tolerance production configuration is 3 servers. The `benchmark_variables.sh` file contains variables that must be specified before running the script:
8+
1. `host1`, `host2`, `host3` - servers where YDB will be deployed
9+
1. `ydb_host_user_name` - SSH-user name, from under which SSH-connections to servers will be established
10+
1. `disk1`, `disk2`, `disk3` - path to raw block-device, where data will be stored i.e. `/dev/nvme01`
11+
1. `host_suffix` - FQDN suffix of the servers, it is necessary for forming SSL certificates.
12+
13+
After specifying all the variables, you need to run ./benchmark.sh, which will download all the necessary packages, collect the YDB source code, build it and install on the servers with the help of ansible and run the benchmark itself.

ydb/benchmark.sh

Lines changed: 292 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,292 @@
1+
#!/bin/bash
2+
set -e
3+
4+
PARAMS_FILE="benchmark_variables.sh"
5+
source $PARAMS_FILE
6+
export YDB_PASSWORD=password
7+
START_DIR=`pwd`
8+
9+
update_file() {
10+
local raw_input="$1"
11+
local raw_output="$2"
12+
local verbose="${3:-0}"
13+
14+
expand_path() {
15+
local path="$1"
16+
path="${path/#\~/$HOME}"
17+
18+
local expanded_path
19+
expanded_path=$(eval echo "$path")
20+
echo "$expanded_path"
21+
}
22+
23+
local input_file
24+
local output_file
25+
input_file=$(expand_path "$raw_input")
26+
output_file=$(expand_path "$raw_output")
27+
28+
local output_dir
29+
output_dir=$(dirname "$output_file")
30+
31+
# Making temporary file
32+
local temp_file
33+
temp_file=$(mktemp) || {
34+
echo "Error while creating temporary file" >&2
35+
return 7
36+
}
37+
38+
cleanup() {
39+
rm -f "$temp_file"
40+
}
41+
trap cleanup EXIT
42+
43+
cp "$input_file" "$temp_file" || {
44+
echo "Error while copying input file to temporary file" >&2
45+
return 8
46+
}
47+
48+
local env_vars
49+
env_vars=$(env | cut -d= -f1)
50+
51+
for var in $env_vars; do
52+
local value
53+
value="${!var}"
54+
55+
if grep -q "\$$var" "$temp_file"; then
56+
local escaped_value
57+
escaped_value=$(echo "$value" | sed -e 's/[\/&]/\\&/g')
58+
59+
sed -i "s/\$$var/$escaped_value/g" "$temp_file" || {
60+
echo "Error while substituting variable \$$var." >&2
61+
return 9
62+
}
63+
fi
64+
done
65+
66+
cp "$temp_file" "$output_file" || {
67+
return 10
68+
}
69+
70+
return 0
71+
}
72+
73+
sudo apt update
74+
sudo apt-get upgrade -y
75+
sudo apt install software-properties-common -y
76+
sudo add-apt-repository --yes --update ppa:ansible/ansible
77+
sudo apt-get install ansible-core -y
78+
79+
cd $START_DIR
80+
if [ ! -d "ydb" ]; then
81+
git clone https://github.com/ydb-platform/ydb.git
82+
fi
83+
84+
cd $START_DIR/ydb/ydb/apps/ydbd/
85+
git checkout stable-25-1-analytics || { echo "Error while checking branch out"; exit 1; }
86+
$START_DIR/ydb/ya make -j8 --build=release || { echo "Build error"; exit 1; }
87+
88+
cd $START_DIR/ydb/ydb/apps/ydb/
89+
$START_DIR/ydb/ya make -j8 --build=release || { echo "Build error"; exit 1; }
90+
91+
cd $START_DIR/ydb/ydb/apps/dstool/
92+
$START_DIR/ydb/ya make -j8 --build=release || { echo "Build error"; exit 1; }
93+
94+
cd $START_DIR
95+
if [ ! -d "ydb-ansible-examples" ]; then
96+
git clone https://github.com/ydb-platform/ydb-ansible-examples.git
97+
fi
98+
99+
cd $START_DIR/ydb-ansible-examples
100+
ansible-galaxy install -r requirements.yaml
101+
cd $START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc
102+
103+
104+
rm -f $START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/files/ydbd
105+
rm -f $START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/files/ydb
106+
rm -f $START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/files/ydb-dstool
107+
108+
ln -f $START_DIR/ydb/ydb/apps/ydbd/ydbd $START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/files/
109+
ln -f $START_DIR/ydb/ydb/apps/ydb/ydb $START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/files/
110+
ln -f $START_DIR/ydb/ydb/apps/dstool/ydb-dstool $START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/files/
111+
112+
cd $START_DIR
113+
114+
update_file "ydb-cluster-setup/50-inventory.yaml" "$START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/inventory/50-inventory.yaml"
115+
update_file "ydb-cluster-setup/config.yaml" "$START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/files/config.yaml"
116+
update_file "ydb-cluster-setup/ydb-ca-nodes.txt" "$START_DIR/ydb-ansible-examples/TLS/ydb-ca-nodes.txt"
117+
118+
hosts=( "$host1$host_suffix" "$host2$host_suffix" "$host3$host_suffix" )
119+
disks=( "$disk1" "$disk2" "$disk3" )
120+
121+
replace_string_in_file() {
122+
local file_path="$1"
123+
local search_string="$2"
124+
local replace_string="$3"
125+
local temp_file
126+
127+
if [[ ! -f "$file_path" ]]; then
128+
echo "Error: File $file_path does not exist" >&2
129+
return 1
130+
fi
131+
132+
temp_file=$(mktemp)
133+
134+
sed "s|$search_string|$replace_string|g" "$file_path" > "$temp_file"
135+
136+
if [ $? -ne 0 ]; then
137+
echo "Error: Replacement operation failed"
138+
rm -f "$temp_file"
139+
return 4
140+
fi
141+
142+
mv "$temp_file" "$file_path"
143+
144+
return 0
145+
}
146+
147+
ssh_execute() {
148+
declare -n local_hosts="$1"
149+
local command="$2"
150+
151+
for host in "${local_hosts[@]}"; do
152+
153+
echo "Executing on $host: $command" >&2
154+
echo "$command" | ssh -l $ydb_host_user_name -o BatchMode=yes -o StrictHostKeyChecking=no "$host" "bash -s"
155+
local exit_code=$?
156+
157+
if [ $exit_code -ne 0 ]; then
158+
echo "Command failed with exit code: $exit_code" >&2
159+
fi
160+
done
161+
162+
return 0
163+
}
164+
165+
copy_file_to_multiple_hosts() {
166+
local file_to_copy=$1
167+
shift
168+
169+
local hosts=("$@")
170+
local pids=()
171+
172+
for host in "${hosts[@]}"; do
173+
{
174+
echo "Copying file '$file_to_copy' to $host"
175+
scp "$file_to_copy" $ydb_host_user_name@$host:/home/$ydb_host_user_name
176+
} &
177+
pids+=($!)
178+
done
179+
180+
# Waiting for all background processes to complete
181+
for pid in "${pids[@]}"; do
182+
wait $pid
183+
done
184+
185+
echo "Сopy process is complete"
186+
}
187+
188+
# Cleaning up YDB services on remote hosts
189+
remove_ydb_services() {
190+
local host=$1
191+
192+
# Connecting to server
193+
ssh -o StrictHostKeyChecking=no -l $ydb_host_user_name -o BatchMode=yes "$host" '
194+
services=$(sudo systemctl list-units --type=service --all| grep "ydb" | awk "{print \$1}")
195+
196+
if [ -z "$services" ]; then
197+
echo "YDB are not found"
198+
else
199+
for service in $services; do
200+
sudo systemctl stop "$service"
201+
sudo systemctl disable "$service"
202+
203+
unit_path=$(systemctl show -p FragmentPath "$service" | cut -d= -f2)
204+
205+
if [ -n "$unit_path" ] && [ -f "$unit_path" ]; then
206+
sudo rm -f "$unit_path"
207+
208+
service_name=$(basename "$unit_path")
209+
if [ -f "/etc/systemd/system/$service_name" ]; then
210+
sudo rm -f "/etc/systemd/system/$service_name"
211+
fi
212+
213+
if [ -L "/etc/systemd/system/multi-user.target.wants/$service_name" ]; then
214+
sudo rm -f "/etc/systemd/system/multi-user.target.wants/$service_name"
215+
fi
216+
fi
217+
done
218+
219+
sudo systemctl daemon-reload
220+
sudo systemctl reset-failed
221+
fi
222+
'
223+
224+
echo "All operation on $host are finished"
225+
}
226+
227+
echo "Beginning the process of removing YDB services on all hosts..."
228+
229+
for host in "${hosts[@]}"; do
230+
remove_ydb_services "$host"
231+
done
232+
233+
cd $START_DIR/ydb-ansible-examples/TLS
234+
find . -maxdepth 1 -type d -not -path "." -exec rm -rf {} \;
235+
if [ -f "$START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/files/TLS" ]; then
236+
cd $START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/files/TLS
237+
rm -rf *
238+
fi
239+
240+
cd $START_DIR/ydb-ansible-examples/TLS
241+
./ydb-ca-update.sh
242+
cd CA/certs
243+
newest_dir=$(find . -maxdepth 1 -type d -not -path "." -printf "%T@ %p\n" | sort -n | tail -n 1 | cut -d' ' -f2-)
244+
245+
cd $START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/inventory/
246+
replace_string_in_file "50-inventory.yaml" "<TLS_PATH>" "$START_DIR/ydb-ansible-examples/TLS/CA/certs/$newest_dir"
247+
replace_string_in_file "50-inventory.yaml" "$ydb_host_user_name" "$ydb_host_user_name"
248+
249+
ssh_execute hosts "sudo mkdir -p /opt/ydb/bin && sudo chmod 755 /opt/ydb/bin"
250+
251+
cd $START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/files/
252+
copy_file_to_multiple_hosts "ydbd" $host1$host_suffix $host2$host_suffix $host3$host_suffix
253+
254+
obliterate_disks() {
255+
declare -n local_hostsd="$1"
256+
declare -n local_disks="$2"
257+
258+
for disk in "${local_disks[@]}"; do
259+
ssh_execute local_hostsd "sudo /home/$ydb_host_user_name/ydbd admin blobstorage disk obliterate $disk"
260+
done
261+
}
262+
263+
obliterate_disks hosts disks
264+
265+
ssh_execute hosts "rm -f /home/$ydb_host_user_name/ydbd"
266+
ssh_execute hosts "sudo rm -rf /opt/ydb/"
267+
268+
cd $START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/
269+
ansible-playbook ydb_platform.ydb.initial_setup --skip-tags checks
270+
271+
cd $START_DIR
272+
273+
if [ ! -f "hits.csv.gz" ]; then
274+
wget --continue --progress=bar:force:noscroll https://datasets.clickhouse.com/hits_compatible/hits.csv.gz
275+
fi
276+
277+
if [ ! -f "hits.csv" ]; then
278+
echo "Unpacking hits.csv.gz"
279+
gzip -d -k hits.csv.gz
280+
echo "Done"
281+
fi
282+
283+
# if [ -f "$HOME/.config/ydb/import_progress/hits.csv" ]; then
284+
# rm "$HOME/.config/ydb/import_progress/hits.csv"
285+
# fi
286+
287+
cert_dir=$(find $START_DIR/ydb-ansible-examples/TLS/CA/certs -maxdepth 1 -type d -not -path "." -printf "%T@ %p\n" | sort -n | tail -n 1 | cut -d' ' -f2-)
288+
echo $YDB_PASSWORD|$START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/files/ydb -e grpcs://$host1$host_suffix:2135 -d /Root/database --ca-file $cert_dir/ca.crt --user root workload clickbench init --datetime --store column
289+
time echo $YDB_PASSWORD|$START_DIR/ydb-ansible-examples/3-nodes-mirror-3-dc/files/ydb -e grpcs://$host1$host_suffix:2135 -d /Root/database --ca-file $cert_dir/ca.crt --user root import file csv hits.csv -p clickbench/hits
290+
291+
cd $START_DIR
292+
./run.sh

ydb/benchmark_variables.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export ydb_host_user_name=yc-user
2+
export host1=ydb-s1
3+
export host2=ydb-s2
4+
export host3=ydb-s3
5+
export host_suffix=.ru-central1.internal
6+
export disk1=/dev/vdb
7+
export disk2=/dev/vdc
8+
export disk3=/dev/vdd

ydb/queries.sql

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
SELECT COUNT(*) FROM `clickbench/hits`;
2+
SELECT COUNT(*) FROM `clickbench/hits` WHERE AdvEngineID <> 0;
3+
SELECT SUM(AdvEngineID), COUNT(*), AVG(ResolutionWidth) FROM `clickbench/hits`;
4+
SELECT AVG(UserID) FROM `clickbench/hits`;
5+
SELECT COUNT(DISTINCT UserID) FROM `clickbench/hits`;
6+
SELECT COUNT(DISTINCT SearchPhrase) FROM `clickbench/hits`;
7+
SELECT MIN(EventDate), MAX(EventDate) FROM `clickbench/hits`;
8+
SELECT AdvEngineID, COUNT(*) as cnt FROM `clickbench/hits` WHERE AdvEngineID <> 0 GROUP BY AdvEngineID ORDER BY cnt DESC;
9+
SELECT RegionID, COUNT(DISTINCT UserID) AS u FROM `clickbench/hits` GROUP BY RegionID ORDER BY u DESC LIMIT 10;
10+
SELECT RegionID, SUM(AdvEngineID), COUNT(*) AS c, AVG(ResolutionWidth), COUNT(DISTINCT UserID) FROM `clickbench/hits` GROUP BY RegionID ORDER BY c DESC LIMIT 10;
11+
SELECT MobilePhoneModel, COUNT(DISTINCT UserID) AS u FROM `clickbench/hits` WHERE MobilePhoneModel <> '' GROUP BY MobilePhoneModel ORDER BY u DESC LIMIT 10;
12+
SELECT MobilePhone, MobilePhoneModel, COUNT(DISTINCT UserID) AS u FROM `clickbench/hits` WHERE MobilePhoneModel <> '' GROUP BY MobilePhone, MobilePhoneModel ORDER BY u DESC LIMIT 10;
13+
SELECT SearchPhrase, COUNT(*) AS c FROM `clickbench/hits` WHERE SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY c DESC LIMIT 10;
14+
SELECT SearchPhrase, COUNT(DISTINCT UserID) AS u FROM `clickbench/hits` WHERE SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY u DESC LIMIT 10;
15+
SELECT SearchEngineID, SearchPhrase, COUNT(*) AS c FROM `clickbench/hits` WHERE SearchPhrase <> '' GROUP BY SearchEngineID, SearchPhrase ORDER BY c DESC LIMIT 10;
16+
SELECT UserID, COUNT(*) as cnt FROM `clickbench/hits` GROUP BY UserID ORDER BY cnt DESC LIMIT 10;
17+
SELECT UserID, SearchPhrase, COUNT(*) as cnt FROM `clickbench/hits` GROUP BY UserID, SearchPhrase ORDER BY cnt DESC LIMIT 10;
18+
SELECT UserID, SearchPhrase, COUNT(*) FROM `clickbench/hits` GROUP BY UserID, SearchPhrase LIMIT 10;
19+
SELECT UserID, m, SearchPhrase, COUNT(*) as cnt FROM `clickbench/hits` GROUP BY UserID, DateTime::GetMinute(Cast(EventTime as Timestamp)) AS m, SearchPhrase ORDER BY cnt DESC LIMIT 10;
20+
SELECT UserID FROM `clickbench/hits` WHERE UserID = 435090932899640449;
21+
SELECT COUNT(*) FROM `clickbench/hits` WHERE URL LIKE '%google%';
22+
SELECT SearchPhrase, MIN(URL), COUNT(*) AS c FROM `clickbench/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 `clickbench/hits` WHERE Title LIKE '%Google%' AND URL NOT LIKE '%.google.%' AND SearchPhrase <> '' GROUP BY SearchPhrase ORDER BY c DESC LIMIT 10;
24+
SELECT * FROM `clickbench/hits` WHERE URL LIKE '%google%' ORDER BY EventTime LIMIT 10;
25+
SELECT SearchPhrase, EventTime FROM `clickbench/hits` WHERE SearchPhrase <> '' ORDER BY EventTime LIMIT 10;
26+
SELECT SearchPhrase FROM `clickbench/hits` WHERE SearchPhrase <> '' ORDER BY SearchPhrase LIMIT 10;
27+
SELECT SearchPhrase, EventTime FROM `clickbench/hits` WHERE SearchPhrase <> '' ORDER BY EventTime, SearchPhrase LIMIT 10;
28+
SELECT CounterID, AVG(length(URL)) AS l, COUNT(*) AS c FROM `clickbench/hits` WHERE URL <> '' GROUP BY CounterID HAVING COUNT(*) > 100000 ORDER BY l DESC LIMIT 25;
29+
SELECT key, AVG(length(Referer)) AS l, COUNT(*) AS c, MIN(Referer) FROM `clickbench/hits` WHERE Referer <> '' GROUP BY Url::CutWWW(Url::GetHost(Referer)) as key HAVING COUNT(*) > 100000 ORDER BY l DESC LIMIT 25;
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 `clickbench/hits`;
31+
SELECT SearchEngineID, ClientIP, COUNT(*) AS c, SUM(IsRefresh), AVG(ResolutionWidth) FROM `clickbench/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 `clickbench/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 `clickbench/hits` GROUP BY WatchID, ClientIP ORDER BY c DESC LIMIT 10;
34+
SELECT URL, COUNT(*) AS c FROM `clickbench/hits` GROUP BY URL ORDER BY c DESC LIMIT 10;
35+
SELECT UserID, URL, COUNT(*) AS c FROM `clickbench/hits` GROUP BY UserID, URL ORDER BY c DESC LIMIT 10;
36+
SELECT ClientIP, ClientIP - 1, ClientIP - 2, ClientIP - 3, COUNT(*) AS c FROM `clickbench/hits` GROUP BY ClientIP, ClientIP - 1, ClientIP - 2, ClientIP - 3 ORDER BY c DESC LIMIT 10;
37+
SELECT URL, COUNT(*) AS PageViews FROM `clickbench/hits` WHERE CounterID = 62 AND EventDate >= Date('2013-07-01') AND EventDate <= Date('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 `clickbench/hits` WHERE CounterID = 62 AND EventDate >= Date('2013-07-01') AND EventDate <= Date('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 `clickbench/hits` WHERE CounterID = 62 AND EventDate >= Date('2013-07-01') AND EventDate <= Date('2013-07-31') AND IsRefresh == 0 AND IsLink <> 0 AND IsDownload == 0 GROUP BY URL ORDER BY PageViews DESC LIMIT 10;
40+
SELECT TraficSourceID, SearchEngineID, AdvEngineID, Src, Dst, COUNT(*) AS PageViews FROM `clickbench/hits` WHERE CounterID = 62 AND EventDate >= Date('2013-07-01') AND EventDate <= Date('2013-07-31') AND IsRefresh == 0 GROUP BY TraficSourceID, SearchEngineID, AdvEngineID, IF (SearchEngineID = 0 AND AdvEngineID = 0, Referer, '') AS Src, URL AS Dst ORDER BY PageViews DESC LIMIT 10;
41+
SELECT URLHash, EventDate, COUNT(*) AS PageViews FROM `clickbench/hits` WHERE CounterID = 62 AND EventDate >= Date('2013-07-01') AND EventDate <= Date('2013-07-31') AND IsRefresh == 0 AND TraficSourceID IN (-1, 6) AND RefererHash = 3594120000172545465 GROUP BY URLHash, EventDate ORDER BY PageViews DESC LIMIT 10;
42+
SELECT WindowClientWidth, WindowClientHeight, COUNT(*) AS PageViews FROM `clickbench/hits` WHERE CounterID = 62 AND EventDate >= Date('2013-07-01') AND EventDate <= Date('2013-07-31') AND IsRefresh == 0 AND DontCountHits = 0 AND URLHash = 2868770270353813622 GROUP BY WindowClientWidth, WindowClientHeight ORDER BY PageViews DESC LIMIT 10;
43+
SELECT Minute, COUNT(*) AS PageViews FROM `clickbench/hits` WHERE CounterID = 62 AND CAST(EventDate AS Date) >= Date('2013-07-14') AND CAST(EventDate AS Date) <= Date('2013-07-15') AND IsRefresh == 0 AND DontCountHits = 0 GROUP BY DateTime::ToSeconds(CAST(EventTime AS Timestamp))/60 As Minute ORDER BY Minute LIMIT 10;

0 commit comments

Comments
 (0)