Skip to content

Commit 3f48d94

Browse files
committed
update
1 parent 9b6609a commit 3f48d94

File tree

12 files changed

+42
-44
lines changed

12 files changed

+42
-44
lines changed

doris/benchmark.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
# Check if the required arguments are provided
44
if [[ $# -lt 3 ]]; then
5-
echo "Usage: $0 <DB_NAME> <RESULT_FILE_RUNTIMES> <RESULT_FILE_MEMORY_USAGE>"
5+
echo "Usage: $0 <DB_NAME> <RESULT_FILE_RUNTIMES> <QUERIES_FILE>"
66
exit 1
77
fi
88

99
# Arguments
1010
DB_NAME="$1"
1111
RESULT_FILE_RUNTIMES="$2"
12-
RESULT_FILE_MEMORY_USAGE="$3"
12+
QUERIES_FILE="$3"
1313

1414
# Construct the query log file name using $DB_NAME
1515
QUERY_LOG_FILE="query_log.txt"
@@ -18,7 +18,7 @@ QUERY_LOG_FILE="query_log.txt"
1818
echo "Running queries on database: $DB_NAME"
1919

2020
# Run queries and log the output
21-
./run_queries.sh "$DB_NAME" 2>&1 | tee query_log.txt
21+
./run_queries.sh "$DB_NAME" "$QUERIES_FILE" 2>&1 | tee query_log.txt
2222

2323
# Process the query log and prepare the result
2424
RESULT=$(cat query_log.txt | grep -oP 'Response time: \d+\.\d+ s' | sed -r -e 's/Response time: ([0-9]+\.[0-9]+) s/\1/' | \

doris/ddl_default.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CREATE TABLE bluesky (
2+
`id` BIGINT NOT NULL AUTO_INCREMENT,
3+
`data` variant NOT NULL
4+
)
5+
DISTRIBUTED BY HASH(id) BUCKETS 32
6+
PROPERTIES (
7+
"replication_num"="1"
8+
);

doris/install.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,3 @@
22
wget --timestamping https://apache-doris-releases.oss-accelerate.aliyuncs.com/${DORIS_PACKAGE}.tar.gz
33
mkdir ${DORIS_PACKAGE}
44
tar -xvf ./${DORIS_PACKAGE}.tar.gz --strip-components 1 -C ./${DORIS_PACKAGE}
5-
6-
echo "storage_page_cache_limit=60%" >> ./${DORIS_PACKAGE}/be/conf/be.conf
7-
echo "enable_java_support=false" >> ./${DORIS_PACKAGE}/be/conf/be.conf

doris/main.sh

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,38 @@ benchmark() {
4848
./create_and_load.sh "bluesky_${size}m_${suffix}" bluesky "ddl_${suffix}.sql" "$DATA_DIRECTORY" "$size" "$SUCCESS_LOG" "$ERROR_LOG"
4949
./total_size.sh "bluesky_${size}m_${suffix}" bluesky | tee "${OUTPUT_PREFIX}_bluesky_${size}m_${suffix}.total_size"
5050
./count.sh "bluesky_${size}m_${suffix}" bluesky | tee "${OUTPUT_PREFIX}_bluesky_${size}m_${suffix}.count"
51-
./benchmark.sh "bluesky_${size}m_${suffix}" "${OUTPUT_PREFIX}_bluesky_${size}m_${suffix}.results_runtime" "${OUTPUT_PREFIX}_bluesky_${size}m_${suffix}.results_memory_usage"
51+
./benchmark.sh "bluesky_${size}m_${suffix}" "${OUTPUT_PREFIX}_bluesky_${size}m_${suffix}.results_runtime" "queries_${suffix}.sql"
5252
./drop_table.sh "bluesky_${size}m_${suffix}" bluesky
5353
}
5454

5555
case $CHOICE in
5656
2)
57-
benchmark 10 generic
57+
benchmark 10 default
58+
benchmark 10 materialized
5859
;;
5960
3)
60-
benchmark 100 generic
61+
benchmark 100 default
62+
benchmark 100 materialized
6163
;;
6264
4)
63-
benchmark 1000 generic
65+
benchmark 1000 default
66+
benchmark 1000 materialized
6467
;;
6568
5)
66-
benchmark 1 generic
67-
benchmark 10 generic
68-
benchmark 100 generic
69-
benchmark 1000 generic
69+
benchmark 1 materialized
70+
benchmark 1 default
71+
benchmark 10 materialized
72+
benchmark 10 default
73+
benchmark 100 materialized
74+
benchmark 100 default
75+
benchmark 1000 materialized
76+
benchmark 1000 default
7077
;;
7178
*)
72-
benchmark 1 generic
79+
benchmark 1 materialized
80+
benchmark 1 default
7381
;;
7482
esac
7583

76-
./uninstall.sh
84+
./stop.sh
85+
#./uninstall.sh

doris/queries_default.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SELECT get_json_string(data, 'commit.collection') AS event, COUNT(*) AS count FROM bluesky GROUP BY event ORDER BY count DESC;
2+
SELECT get_json_string(data, 'commit.collection') AS event, COUNT(*) AS count, COUNT(DISTINCT get_json_string(data, 'did')) AS users FROM bluesky WHERE get_json_string(data, 'kind') = 'commit' AND get_json_string(data, 'commit.operation') = 'create' GROUP BY event ORDER BY count DESC;
3+
SELECT get_json_string(data, 'commit.collection') AS event, HOUR(from_microsecond(get_json_int(data, 'time_us'))) AS hour_of_day, COUNT(*) AS count FROM bluesky WHERE get_json_string(data, 'kind') = 'commit' AND get_json_string(data, 'commit.operation') = 'create' AND get_json_string(data, 'commit.collection') IN ('app.bsky.feed.post', 'app.bsky.feed.repost', 'app.bsky.feed.like') GROUP BY event, hour_of_day ORDER BY hour_of_day, event;
4+
SELECT get_json_string(data, 'did') AS user_id, MIN(from_microsecond(get_json_int(data, 'time_us'))) AS first_post_ts FROM bluesky WHERE get_json_string(data, 'kind') = 'commit' AND get_json_string(data, 'commit.operation') = 'create' AND get_json_string(data, 'commit.collection') = 'app.bsky.feed.post' GROUP BY user_id ORDER BY first_post_ts ASC LIMIT 3;
5+
SELECT get_json_string(data, 'did') AS user_id, MILLISECONDS_DIFF(MAX(from_microsecond(get_json_int(data, 'time_us'))),MIN(from_microsecond(get_json_int(data, 'time_us')))) AS activity_span FROM bluesky WHERE get_json_string(data, 'kind') = 'commit' AND get_json_string(data, 'commit.operation') = 'create' AND get_json_string(data, 'commit.collection') = 'app.bsky.feed.post' GROUP BY user_id ORDER BY activity_span DESC LIMIT 3;

doris/results/m6i.8xlarge_bluesky_1000m.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

doris/run_queries.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
#!/bin/bash
22

33
# Check if the required arguments are provided
4-
if [[ $# -lt 1 ]]; then
5-
echo "Usage: $0 <DB_NAME>"
4+
if [[ $# -lt 2 ]]; then
5+
echo "Usage: $0 <DB_NAME> <QUERIES_FILE>"
66
exit 1
77
fi
88

99
# Arguments
1010
DB_NAME="$1"
11+
QUERIES_FILE="$2"
1112

1213
TRIES=3
1314

1415
mysql -P 9030 -h 127.0.0.1 -u root $DB_NAME -e "set global parallel_pipeline_task_num=32;"
1516
mysql -P 9030 -h 127.0.0.1 -u root $DB_NAME -e "set global enable_parallel_scan=false;"
1617

17-
cat queries.sql | while read -r query; do
18+
cat $QUERIES_FILE | while read -r query; do
1819

1920
# Clear the Linux file system cache
2021
echo "Clearing file system cache..."

doris/start.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#!/bin/bash
2-
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
3-
42
./${DORIS_PACKAGE}/be/bin/start_be.sh --daemon
53
./${DORIS_PACKAGE}/fe/bin/start_fe.sh --daemon
64

0 commit comments

Comments
 (0)