-
Notifications
You must be signed in to change notification settings - Fork 111
Add serialized plan complexity and hash to the continuation info in EXPLAIN #3541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hazefully
merged 8 commits into
FoundationDB:main
from
hazefully:serialized-plan-complexity-in-explain
Aug 29, 2025
Merged
Add serialized plan complexity and hash to the continuation info in EXPLAIN #3541
hazefully
merged 8 commits into
FoundationDB:main
from
hazefully:serialized-plan-complexity-in-explain
Aug 29, 2025
+120
−29
Conversation
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
This commit adds a new column, 'SERIALIZED_PLAN_COMPLEXITY' to the 'PLAN_CONTINUATION' struct in the result from EXPLAIN which contains the complexity of the plan serialized within the continuation, if the continuation contains a compiled statement. This new column is populated for EXPLAINs on an 'EXECUTE CONTINUATION' statement and a regular SELECT statement that uses the `WITH CONTINUATION` clause.
To match what happens when parsing struct columns.
cea95af
to
14377d6
Compare
g31pranjal
requested changes
Aug 27, 2025
...tional-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/QueryPlan.java
Outdated
Show resolved
Hide resolved
...tional-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/QueryPlan.java
Outdated
Show resolved
Hide resolved
...tional-core/src/main/java/com/apple/foundationdb/relational/recordlayer/query/QueryPlan.java
Show resolved
Hide resolved
This is unnecessary as there is no way the contiuation being explained for a ContinuedPhysicalQueryPlan would not match the continuation that was originally used to create the ContinuedPhysicalQueryPlan in the first place.
This can only happen with for 'SELECT ... WITH CONTINUATION' queries, it can't happen with 'EXECUTE CONTINUATION' queries.
This commit asserts that the plan hash in the continuation passed to ContinuedPhysicalQueryPlan::getSerializedPlanFromContinuation matches the plan hash of the plan that was extracted from the continuation and used to construct the ContinuedPhysicalQueryPlan. In practice, this should always be true unless the code was changed in an incompatible way so the continuation passed to getSerializedPlanFromContinuation is not the same continuation that was used to deserialize the physical plan.
b190639
to
274cca7
Compare
g31pranjal
approved these changes
Aug 29, 2025
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.
This PR adds two new columns,
PLAN_HASH
andSERIALIZED_PLAN_COMPLEXITY
, to thePLAN_CONTINUATION
struct in the result from EXPLAIN which contain the plan hash stored in the continuation and the complexity of the plan serialized within the continuation (if the continuation contains a compiled statement )respectively .The new columns are populated for EXPLAINs on an
EXECUTE CONTINUATION
statement and a regular SELECT statement that uses theWITH CONTINUATION
clause.