Skip to content

test: Benchmark suite for multi-level partitioned tables with DuckDB metadata cache options #96

test: Benchmark suite for multi-level partitioned tables with DuckDB metadata cache options

test: Benchmark suite for multi-level partitioned tables with DuckDB metadata cache options #96

# workflows/benchmark-pg_analytics.yml
#
# Benchmark pg_analytics
# Benchmark ParadeDB's pg_analytics performance against ClickBench.
name: Benchmark pg_analytics
on:
schedule:
- cron: "1 0 * * 1,2,3,4,5" # Run once per day on weekdays (days of the week 1-5) at 00:01 UTC
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- dev
- main
paths:
- ".github/workflows/benchmark-pg_analytics.yml"
- "src/**"
- "Cargo.toml"
- "pg_analytics.control"
workflow_dispatch:
concurrency:
group: benchmark-pg_analytics-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
benchmark-pg_analytics:
name: Benchmark pg_analytics on ${{ matrix.name }}
runs-on: depot-ubuntu-latest-8
if: github.event.pull_request.draft == false
strategy:
matrix:
include:
- name: ClickBench (Parquet, single)
flags: -w single
pg_version: 16
- name: ClickBench (Parquet, partitioned)
flags: -w partitioned
pg_version: 16
steps:
- name: Checkout Git Repository
uses: actions/checkout@v4
# To access the cargo-paradedb benchmarking tool
- name: Checkout paradedb/paradedb Git Repository
run: git clone https://github.com/paradedb/paradedb
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install & Configure Supported PostgreSQL Version
run: |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update && sudo apt-get install -y postgresql-${{ matrix.pg_version }} postgresql-server-dev-${{ matrix.pg_version }}
sudo chown -R $(whoami) /usr/share/postgresql/${{ matrix.pg_version }}/ /usr/lib/postgresql/${{ matrix.pg_version }}/ /var/lib/postgresql/${{ matrix.pg_version }}/
echo "/usr/lib/postgresql/${{ matrix.pg_version }}/bin" >> $GITHUB_PATH
- name: Install pgrx & pg_analytics
run: |
cargo install -j $(nproc) --locked cargo-pgrx --version 0.12.4
cargo pgrx init --pg${{ matrix.pg_version }}=/usr/lib/postgresql/${{ matrix.pg_version }}/bin/pg_config
cargo pgrx install --pg-config="/usr/lib/postgresql/${{ matrix.pg_version }}/bin/pg_config" --release
- name: Add pg_analytics to shared_preload_libraries
working-directory: /home/runner/.pgrx/data-${{ matrix.pg_version }}/
run: sed -i "s/^#shared_preload_libraries = .*/shared_preload_libraries = 'pg_analytics'/" postgresql.conf
- name: Install the ParadeDB Benchmarking Tool
working-directory: paradedb/cargo-paradedb/
run: cargo run install
- name: Run Official ${{ matrix.name }} Benchmark
run: |
cargo pgrx start pg${{ matrix.pg_version }}
cargo paradedb bench hits run ${{ matrix.flags }} --url postgresql://localhost:288${{ matrix.pg_version }}/postgres
- name: Notify Slack on Failure
if: failure() && (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main')
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text":"Benchmark pg_analytics on ${{ matrix.name }} workflow failed in `paradedb/paradedb` -- investigate immediately!"}' ${{ secrets.SLACK_WEBHOOK_URL }}