# AetherQuery Analytical Query Engine

> Cross-database analytical query engine supporting DuckDB/PostgreSQL/MySQL with adaptive execution.

Page: https://adith.xyz/projects/aetherquery
Author: [Adith Manikonda](https://adith.xyz/about.md) (https://adith.xyz)
Last updated: 2026-10-21

- Built by: Adith Manikonda
- Year: 2026
- Category: Systems / Backend
- Built with: FastAPI, Python, DuckDB, PostgreSQL, MySQL
- Source code: https://github.com/Ad1th/AetherQuery

## The problem

Exploratory analytics makes you wait for exact answers you do not need yet. While shaping a query you want the shape of the result in a fraction of the time, and you want to know how wrong the fast answer is.

## The approach

Approximate execution alongside exact, over DuckDB, Postgres and MySQL. Both sides of a join are sampled independently rather than after the join, so join selectivity survives; HyperLogLog sketches estimate result cardinality without materialising it, and bloom filters pre-filter the probe side. A benchmark mode runs exact and approximate together and reports the error and the speedup rather than asking you to trust the sample.

## Measured

- TPC-H Q5, 3-way star join: **6.85x faster** (0.035s exact vs 0.005s approximate at 1% sampling)
- Cardinality estimate error: **~1%** (HyperLogLog, 2^14 registers, 16KB per sketch)
- Adaptive time budget: **2x / 3.5x** (Multipliers applied for 2-way and 3-way joins)

## What it does not do

Only one of five TPC-H join queries came out ahead. Q3, Q10, Q12 and Q18 ran 5x to 50x slower approximate than exact, because TABLESAMPLE overhead dominates at these sizes and small samples never reach parallel execution. At 1% sampling all five returned zero rows: join selectivity collapses on small samples. The sampling strategy holds for single-table aggregates; selective multi-way joins need a higher floor on sample size before it pays.

## More by Adith Manikonda

- [Scotland Yard Multiplayer Backend](https://adith.xyz/projects/scotland-yard.md): Real-time multiplayer backend supporting 100+ users with persistent game state and server-authoritative gameplay.
- [Hybrid Symbol Table for Embedded Compilers](https://adith.xyz/projects/hybrid-symbol-table.md): Cache-conscious, arena-backed symbol table in C11 with adaptive per-scope storage and constant-time scope teardown.
- [archAIc Reliability Engineering Platform](https://adith.xyz/projects/archaic.md): Distributed reliability engineering platform with observability, metrics, tracing, and anomaly detection.
