Skip to content

Introduce PlanCacheSchemaKey and multi-schema QueryCacheKey (cross-schema 1/6)#4212

Draft
arnaud-lacurie wants to merge 3 commits into
FoundationDB:mainfrom
arnaud-lacurie:cross-schema/pr1
Draft

Introduce PlanCacheSchemaKey and multi-schema QueryCacheKey (cross-schema 1/6)#4212
arnaud-lacurie wants to merge 3 commits into
FoundationDB:mainfrom
arnaud-lacurie:cross-schema/pr1

Conversation

@arnaud-lacurie

Copy link
Copy Markdown
Collaborator

Summary

  • Introduces PlanCacheSchemaKey — a stable key component derived from a set of (schemaName, schemaVersion) pairs — so that a cached plan is invalidated when any participating secondary schema changes
  • Extends QueryCacheKey to carry the secondary-schema set alongside the primary schema, giving each multi-schema query its own cache slot
  • No behaviour change for single-schema queries; the secondary set is empty and the key is identical to before

Stacking

This is PR 1 of 6 in the cross-schema join series. All PRs target main; rebase each one after the previous merges.

# PR Topic
1 this Plan-cache key for multi-schema queries
2 SchemaIdentifier tag + store-binding infrastructure
3 Secondary-store wiring into execution context
4 Type-namespace collision avoidance + catalog metadata
5 Java integration tests
6 YAML integration tests + documentation

Test plan

  • Plan cache unit tests pass
  • Multi-schema queries get distinct cache entries from single-schema queries
  • No regression in single-schema plan-cache hit rate

Replace raw String primary cache key with PlanCacheSchemaKey holding an
ImmutableSortedSet of schema names. Replace single schemaTemplateVersion
in QueryCacheKey with ImmutableSortedMap<String,Integer> schemaVersions,
enabling cross-schema plan cache keying.

Affects: PlanCacheSchemaKey (new), QueryCacheKey, RelationalPlanCache,
AstNormalizer.NormalizationResult, PlanGenerator, and their tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant