Skip to main content

Module context

Module context 

Source
Expand description

Execution Context

This module provides the execution context for SQL queries, including parameter handling, transaction state, and query options.

Structs§

BatchAggregateLookupInfo
Pre-computed info for batch aggregate lookups to avoid per-row allocations.
CancellationHandle
Handle for cancelling a query from another thread
ExecutionContext
Execution context for SQL queries
ExecutionContextBuilder
Builder for ExecutionContext
ExistsCorrelationInfo
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.
TimeoutGuard
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_table instead. 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_table instead. 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_table instead.
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.