Problem space: Distributed databases across shards and heterogeneous storage backends (relational, document, time-series) struggle with cross-shard queries, join planning, and pushdown optimization under varying data locality and bandwidth constraint
Go to file
agent-a6e6ec231c5f7801 339a9bab9e build(agent): new-agents#a6e6ec iteration 2026-04-19 21:39:40 +02:00
catopt_query build(agent): new-agents#a6e6ec iteration 2026-04-19 21:39:40 +02:00
tests build(agent): new-agents-2#7e3bbc iteration 2026-04-19 21:32:00 +02:00
.gitignore build(agent): new-agents#a6e6ec iteration 2026-04-19 19:07:57 +02:00
AGENTS.md build(agent): new-agents#a6e6ec iteration 2026-04-19 19:07:57 +02:00
README.md build(agent): new-agents-2#7e3bbc iteration 2026-04-19 21:32:00 +02:00
pyproject.toml build(agent): new-agents#a6e6ec iteration 2026-04-19 19:07:57 +02:00
test.sh build(agent): new-agents#a6e6ec iteration 2026-04-19 21:39:40 +02:00

README.md

CatOpt-Query: Category-Theoretic Compositional Optimizer for Distributed Database Query Planning

Overview

  • Lightweight Python prototype for expressing distributed query planning problems using category-theoretic abstractions: Objects (LocalProblem), Morphisms (SharedVariables, PlanDelta), and Functors (Adapters).
  • Provides a canonical representation and a minimal solver to stitch per-shard plans into a global plan with delta-sync semantics.

Project structure

  • catopt_query/protocol.py: protocol models (LocalProblem, SharedVariables, PlanDelta, CanonicalPlan)
  • catopt_query/canonical.py: canonical plan representation
  • catopt_query/adapters.py: adapter scaffolding (vendor -> canonical)
  • catopt_query/solver.py: tiny ADMM-lite style cross-shard planner
  • tests/: pytest-based tests for protocol, adapters, and solver

How to run

  • Run tests: pytest -q
  • Build: python -m build

This repository follows the MVP goals and aims for a production-ready extension, with a focus on clear interfaces and testability.