Expand description
v6.3.0 — Engine-level plan cache.
Caches the post-prepare() Statement (clock-rewritten,
ORDER-BY-position-resolved, JOIN-reordered) keyed on the raw SQL
string. Hit path skips parse + clock rewrite + JOIN reorder — for
a 5-table JOIN that’s the dominant cost.
statistics_version and source_tables are stored on the entry
so v6.3.1 can invalidate selectively when ANALYZE bumps the stats
version, or when DDL changes one of the source tables.
describe_columns is reserved for v6.3.3 Describe pre-Execute —
v6.3.0 leaves it empty.
Cache is bounded by PLAN_CACHE_MAX_ENTRIES (256). Eviction is
LRU via a VecDeque<String> move-to-back on get. Both get and
insert are sub-microsecond at 256 entries.
Structs§
- Plan
Cache - Prepared
Plan - One cached plan. The cached
stmtis the same oneEngine::prepare()would return — parse + clock rewrite + ORDER-BY position resolution + JOIN reorder all already applied.
Functions§
- collect_
source_ tables - Walk a
Statementand collect every distinct table name referenced by its FROM clauses (including JOIN tables and subquery FROMs). Used byPreparedPlan::source_tablesfor v6.3.1 selective invalidation.