refactor: slim runtime and bind ORM through planner#349
Merged
Conversation
Remove the transaction type parameter from executor nodes and route execution state through a runtime trait so executor code is compiled once instead of monomorphized per storage backend.
44e2d3f to
2d22d96
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR prepares KiteSQL
0.3.0around a smaller embedded footprint and a cleaner planner/runtime boundary. The main change is not a single executor rewrite: it is a broad cleanup that feature-gates optional frontends, routes ORM queries through the normal binder/planner path, and centralizes execution metadata/codec state so less work is duplicated across storage backends and query shapes.What Changed
parser,shell,copy,time,decimal,python,rocksdb, andlmdb; remove the old pgwire server binary andnetfeature; makekitesql-shellan explicitshellfeature target.TableArena/PlanArena, so table, view, function, column, and index metadata can be referenced consistently during binding, optimization, and execution.ExecutionContext,ExecArena, local execution state, reusableTableCodec, projection scratch buffers, and DDL-apply records. Executor and transaction types are still generic where storage iterators require it, but most nodes now pull shared runtime state from the arena instead of carrying duplicate context.parserfeature and add binder-facing APIs that buildLogicalPlanvalues directly.Database::bind/DBTransaction::bindwithOrmContext, so typed ORM queries bind into coreScalarExpressionandLogicalPlanstructures instead of building SQL/parser-shaped intermediate paths.Compatibility Notes
0.3.0.kite_sqlpgwire server binary andnetfeature are removed in this PR.parserremains enabled by default, but SQL parser support can now be left out of no-default-feature embedded builds.ormnow enablesmacros; parser, copy, decimal, time, python, shell, and storage backends are controlled by their own feature flags.from(...).eq(...).fetch(...)chain to binder-backedbind(|ctx| ...)plans.Binary Size Comparison
Measured as stripped release binaries on
x86_64-unknown-linux-gnuwithrustc 1.88.0. The KiteSQL binary is a small ORM/typed API smoke example that creates a table, inserts two rows, fetches them, and drops the table.Important: the PR measurements intentionally do not enable the
parserfeature.mainstill has parser/sqlparser as a non-optional dependency, so main cannot be measured with the same no-parser feature set.c0e63a0memoryorm,macros; parser not feature-gated on main4ee5c66memoryorm; parser disabledc0e63a0RocksDBorm,macros,rocksdb; parser not feature-gated on main4ee5c66RocksDBorm,rocksdb; parser disabledc0e63a0LMDBorm,macros,lmdb; parser not feature-gated on main4ee5c66LMDBorm,lmdb; parser disabled0.34.0+ bundled SQLite2.0.0-rc.382.3.10+ bundled SQLite0.7.0-pre.7and pinned0.5.0did not compile on this rustc due transitive/proc-macro API requirementsKiteSQL PR reduction vs main in this measurement:
TPCC Throughput Comparison
Retested on the current local PR working tree after rebuilding
target/release/tpccwithout profiling features and clearing old TPCC database state for each backend. Each row is a fresh 1-warehouse run using TPCC's default 720-second measurement window. Raw logs were generated locally undertpcc/results/2026-06-14_720-full-current/and are not committed. All runs passed TPCC constraint checks.These values are now mirrored in
README.mdandtpcc/README.md. The LMDB result is lower than the historical README value on the same machine, while RocksDB remains close to the historical value; the current run was kept as the source of truth because it is a full 720s matrix from clean databases.Testing
cargo test --workspacemake wasm-build && make wasm-examplesparserdisabled