Project Info
My attempt at the CalHacks 2025 query planner challenge using DuckDB and Rust.
Performance
Database preprocessing: 4m 18.9s
Benchmark results on the full dataset (245M rows) with 1000 runs:
| Query / Metric | judges.json | queries.json |
|---|---|---|
| Query 1 | 0.24ms | 0.77ms |
| Query 2 | 0.40ms | 0.90ms |
| Query 3 | 1.63ms | 0.96ms |
| Query 4 | 1.66ms | 1.96ms |
| Query 5 | 1.56ms | 1.74ms |
| Query 6 | 0.19ms | - |
| Query 7 | 0.20ms | - |
| Query 8 | 4.49ms | - |
| Query 9 | 0.88ms | - |
| Query 10 | 0.77ms | - |
| Query 11 | 1.23ms | - |
| Query 12 | 0.86ms | - |
| Query 13 | 2.51ms | - |
| Query 14 | 0.84ms | - |
| Query 15 | 0.75ms | - |
| Sum of averages | 18.20ms | 6.31ms |
| Query preparation and warmup | 1.4s | 1.3s |
| Total execution time (1000 runs) | 1.8s | 6.5s |
Usage
Command Line Arguments
| Argument | Description | Default |
|---|---|---|
--input-dir DIR | Directory containing CSV files | Required |
--output-dir DIR | Output directory for query results | Required with --run |
--queries FILE | JSON file with query definitions | Required |
--run | Execute queries (required flag) | - |
--runs N | Number of times to run each query (for averaging) | 1 |
--use-existing FILE | Use existing database file (specify path) | None |
--baseline-dir DIR | Compare results against baseline | None |
--profile | Enable EXPLAIN ANALYZE profiling | False |
Building
Prerequisites
- Rust
- DuckDB
Build Release Binary
# Build optimized release binary
cargo build --release
Using Nix Flake (Optional)
For dev environment:
# Enter development shell
nix develop
# Build
cargo build --release
Or with direnv:
direnv allow
cargo build --release
Quick Start
Create the database and run queries:
./calhacks \
--input-dir ../calhacks-applovin-query-planner-challenge/data/data \
--run \
--queries ../calhacks-applovin-query-planner-challenge/queries.json \
--output-dir results/
Analysis
View
Metric
- 12
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- RustIn code
1 of 1 appear in the indexed code.
AI coding agents
No AI coding agent signals were found in this repository.
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
79 KB
Source files
10
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
jetpham/calhacks25
19 files · 138 KB · @ d062ad9
Structure
Application logic
11 files · 58%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Rust97%
- Markdown3%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
Cargo.toml
cargo · 9- anyhow
- chrono
- clap
- csv
- duckdb
- indicatif
- num_cpus
- serde
- serde_json
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.