Expand description
Execution Context
This module provides the execution context for SQL queries, including parameter handling, transaction state, and query options.
Structs§
- Batch
Aggregate Lookup Info - Pre-computed info for batch aggregate lookups to avoid per-row allocations.
- Cancellation
Handle - Handle for cancelling a query from another thread
- Execution
Context - Execution context for SQL queries
- Execution
Context Builder - Builder for ExecutionContext
- Exists
Correlation Info - Pre-computed info for index nested loop EXISTS lookups to avoid per-row string operations. This caches the pre-computed lowercase column names for O(1) outer row lookups.
- Timeout
Guard - Guard that automatically cancels a query after a timeout. Uses a global timeout manager for efficient handling of many concurrent timeouts.
Functions§
- cache_
batch_ aggregate - Cache a batch aggregate result map.
- cache_
batch_ aggregate_ info - Cache batch aggregate lookup info and return the Arc-wrapped version. Returns None if info was None (not batchable).
- cache_
count_ counter - Cache a COUNT row counter.
- cache_
exists_ correlation - Cache EXISTS correlation info and return the Arc-wrapped version. Returns None if info was None (correlation not extractable).
- cache_
exists_ fetcher - Cache an EXISTS row fetcher.
- cache_
exists_ index - Cache an EXISTS index.
- cache_
exists_ pred_ key - Cache a predicate cache key.
- cache_
exists_ predicate - Cache an EXISTS predicate filter.
- cache_
exists_ schema - Cache table column names (takes Arc for zero-copy sharing).
- cache_
in_ subquery - Cache an IN subquery result with the tables it references.
- cache_
scalar_ subquery - Cache a scalar subquery result with the tables it references.
- cache_
semi_ join_ arc - Cache a semi-join hash set result (CompactArc version for zero-copy).
- clear_
all_ thread_ local_ caches - Clear ALL thread-local caches to release memory. Call this when a database is dropped to prevent memory leaks. This also shrinks all cache capacities to zero where applicable.
- clear_
batch_ aggregate_ cache - Clear the batch aggregate cache. Should be called at the start of each top-level query.
- clear_
batch_ aggregate_ info_ cache - Clear the batch aggregate info cache.
- clear_
count_ counter_ cache - Clear the COUNT row counter cache. Should be called at the start of each top-level query.
- clear_
exists_ correlation_ cache - Clear the EXISTS correlation cache.
- clear_
exists_ fetcher_ cache - Clear the EXISTS row fetcher cache. Should be called at the start of each top-level query.
- clear_
exists_ index_ cache - Clear the EXISTS index cache. Should be called at the start of each top-level query.
- clear_
exists_ pred_ key_ cache - Clear the EXISTS predicate key cache.
- clear_
exists_ predicate_ cache - Clear the EXISTS predicate cache. Should be called at the start of each top-level query.
- clear_
exists_ schema_ cache - Clear the EXISTS schema cache. Should be called at the start of each top-level query.
- clear_
in_ subquery_ cache - Clear the IN subquery cache completely.
NOTE: For normal operation, use
invalidate_in_subquery_cache_for_tableinstead. This is only used for explicit cache clearing (e.g., after DDL operations). - clear_
scalar_ subquery_ cache - Clear the scalar subquery cache completely.
NOTE: For normal operation, use
invalidate_scalar_subquery_cache_for_tableinstead. This is only used for explicit cache clearing (e.g., after DDL operations). - clear_
semi_ join_ cache - Clear the semi-join cache completely.
NOTE: This is now only used for explicit cache clearing (e.g., after DDL operations).
For DML operations, use
invalidate_semi_join_cache_for_tableinstead. - compute_
semi_ join_ cache_ key - Compute a cache key hash from table, column, and predicate hash without allocation.
- extract_
table_ names_ for_ cache - Extract actual table names from a SelectStatement for cache invalidation. This returns the real table names (not aliases) because DML operations reference tables by their actual names, not aliases.
- get_
cached_ batch_ aggregate - Get a cached batch aggregate result map by subquery identifier.
- get_
cached_ batch_ aggregate_ info - Get cached batch aggregate lookup info by subquery pointer address. Returns Arc to avoid cloning strings on every lookup.
- get_
cached_ count_ counter - Get a cached COUNT row counter by table name.
- get_
cached_ exists_ correlation - Get cached EXISTS correlation info by subquery pointer address. Returns Arc to avoid cloning strings on every lookup.
- get_
cached_ exists_ fetcher - Get a cached EXISTS row fetcher by table name.
- get_
cached_ exists_ index - Get a cached EXISTS index by key.
- get_
cached_ exists_ pred_ key - Get cached predicate cache key by subquery pointer address.
- get_
cached_ exists_ predicate - Get a cached EXISTS predicate filter by key.
- get_
cached_ exists_ schema - Get cached table column names by table name.
- get_
cached_ in_ subquery - Get a cached IN subquery result by SQL string key.
- get_
cached_ scalar_ subquery - Get a cached scalar subquery result by SQL string key.
- get_
cached_ semi_ join - Get a cached semi-join hash set by key hash.
- invalidate_
in_ subquery_ cache_ for_ table - Invalidate IN subquery cache entries for a specific table. Should be called after INSERT, UPDATE, DELETE, or TRUNCATE on a table.
- invalidate_
scalar_ subquery_ cache_ for_ table - Invalidate scalar subquery cache entries for a specific table. Should be called after INSERT, UPDATE, DELETE, or TRUNCATE on a table.
- invalidate_
semi_ join_ cache_ for_ table - Invalidate semi-join cache entries for a specific table. Should be called after INSERT, UPDATE, DELETE, or TRUNCATE on a table.
Type Aliases§
- RowCounter
- Type alias for row counter function used in COUNT(*) optimization. This only counts visible rows without cloning their data.
- RowFetcher
- Type alias for row fetcher function used in EXISTS/COUNT optimization.