Skip to content

Conversation

@theory
Copy link

@theory theory commented Dec 17, 2025

It dupes the clickhouse benchmark config to load data and the Postgres config to run the queries. All queries push down to ClickHouse without error.

Resolves ClickHouse/pg_clickhouse#82.

@theory theory self-assigned this Dec 17, 2025
@rschu1ze rschu1ze self-assigned this Dec 17, 2025
It dupes the clickhouse benchmark config to load data and the Postgres
config to run the queries. All queries push down to ClickHouse without
error.
then
cd /tmp || exit
curl https://clickhouse.com/ | sh
sudo ./clickhouse install --noninteractive
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a ClickHouse installation isn't necessary (in fact, all the sudo calls mess with the system). The first run of ./clickhouse will unpack the binary into the local directory. We

  • can remove l. 9,
  • create compression.yaml in subfolder config.d/ of the local working directory (l. 20)
  • remove sudo from l. 23 and run the database in the background (append &)
  • move the files in a subfolder user_files of the local working directory without sudo (l. 45). I think chown (l. 46) isn't needed as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to make the same changes to clickhouse/benchmark.sh? I just copied that code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, okay, then such changes would have a too large blast radius.

I'll run this script tomorrow or on Friday in our automation. This will generate the results file that can then be uploaded to https://benchmark.clickhouse.com/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this?

--- a/pg_clickhouse/clickhouse.sh
+++ b/pg_clickhouse/clickhouse.sh
@@ -6,7 +6,6 @@ if [ ! -x /usr/bin/clickhouse ]
 then
     cd /tmp || exit
     curl https://clickhouse.com/ | sh
-    sudo ./clickhouse install --noninteractive
     rm clickhouse
     cd - || exit
 fi
@@ -20,7 +19,7 @@ compression:
     " | sudo tee /etc/clickhouse-server/config.d/compression.yaml
 fi;
 
-sudo clickhouse start
+clickhouse start &
 
 for _ in {1..300}
 do
@@ -42,8 +41,7 @@ clickhouse-client < create"$SUFFIX".sql
 
 # seq 1 | xargs -P100 -I{} bash -c 'wget --continue --progress=dot:giga https://datasets.clickhouse.com/hits_compatible/athena_partitioned/hits_{}.parquet'
 seq 0 99 | xargs -P100 -I{} bash -c 'wget --continue --progress=dot:giga https://datasets.clickhouse.com/hits_compatible/athena_partitioned/hits_{}.parquet'
-sudo mv hits_*.parquet /var/lib/clickhouse/user_files/
-sudo chown clickhouse:clickhouse /var/lib/clickhouse/user_files/hits_*.parquet
+mv hits_*.parquet /var/lib/clickhouse/user_files/
 
 echo -n "Load time: "
 clickhouse-client --time --query "INSERT INTO hits SELECT * FROM file('hits_*.parquet')" --max-insert-threads $(( $(nproc) / 4 ))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test and fix pushdown for the ClickBench queries

2 participants