Uh oh!
There was an error while loading. Please reload this page.
PHOENIX-7882 Per scan EXPLAIN output improvements - #2505
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances Phoenix per-scan EXPLAIN output by adding consistent, structured scan metadata (index name/kind, salt buckets, and planned region/split count) to both the rendered plan text and the structured ExplainPlanAttributes, along with corresponding test and normalizer updates.
Changes:
- Emit per-scan
INDEX <name> [<kind>],SALT BUCKETS <n>, andREGIONS PLANNED <n>lines inExplainTable.explain(...), and plumb split count viaBaseResultIterators.getSplitCount(). - Extend
ExplainPlanAttributes(and builder) withindexName,indexKind,saltBuckets, andregionsPlanned. - Update unit/integration tests and explain normalizers to account for the new output (including normalizing variable region counts).
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| phoenix-core-client/src/main/java/org/apache/phoenix/iterate/ExplainTable.java | Adds per-scan INDEX/SALT BUCKETS/REGIONS PLANNED emission and populates new explain attributes. |
| phoenix-core-client/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java | Supplies split count for the new REGIONS PLANNED line via getSplitCount(). |
| phoenix-core-client/src/main/java/org/apache/phoenix/compile/ExplainPlanAttributes.java | Adds new structured fields + builder wiring and JSON property ordering. |
| phoenix-core/src/test/java/org/apache/phoenix/query/explain/ExplainPlanTest.java | Updates expected explain text and JSON shapes; adds coverage for index kind tokens. |
| phoenix-core/src/test/java/org/apache/phoenix/query/explain/ExplainPlanTestUtil.java | Extends fluent assertions for the newly added structured explain attributes. |
| phoenix-core/src/test/java/org/apache/phoenix/query/explain/ExplainTextNormalizer.java | Normalizes the variable REGIONS PLANNED <n> count for stable comparisons. |
| phoenix-core/src/test/java/org/apache/phoenix/query/explain/ExplainJsonNormalizer.java | Nulls regionsPlanned during normalization to avoid environment-dependent diffs. |
| phoenix-core/src/it/java/org/apache/phoenix/end2end/SortMergeJoinMoreIT.java | Formatting-only adjustments to keep tests aligned with updated output/style. |
| phoenix-core/src/it/java/org/apache/phoenix/end2end/join/SortMergeJoinLocalIndexIT.java | Formatting-only adjustments. |
| phoenix-core/src/it/java/org/apache/phoenix/end2end/join/SortMergeJoinGlobalIndexIT.java | Formatting-only adjustments. |
| phoenix-core/src/it/java/org/apache/phoenix/end2end/Bson3IT.java | Formatting-only adjustments. |
| phoenix-core/src/it/java/org/apache/phoenix/end2end/Bson4IT.java | Formatting-only adjustments. |
| phoenix-core/src/it/java/org/apache/phoenix/end2end/Bson5IT.java | Formatting-only adjustments. |
| phoenix-core-client/src/main/java/org/apache/phoenix/expression/util/bson/UpdateExpressionUtils.java | Wraps a long log statement line for style/line-length compliance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
apurtell
commented
Jun 9, 2026
Test ResultsUnit tests (surefire)
Integration tests (failsafe, forks=2)
The IT selection covers the five test files modified on the branch plus the two explain-focused ITs that exercise the changed client code. |
Co-authored-by: Claude Opus 4.8[1m] <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8[1m] <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8[1m] <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8[1m] <noreply@anthropic.com>
Per-scan
INDEX <name> [<kind>],SALT BUCKETS <n>,REGIONS PLANNED <n>.ExplainTable.explain(...)emitsINDEXbeforeROW TIMESTAMP FILTER(name fromtableRef.getTable().getName(). Local indexes print just<idx>), with a<kind>token (LOCAL/GLOBAL/UNCOVERED GLOBAL) when the target is anINDEX,SALT BUCKETSwhengetBucketNum()is set, andREGIONS PLANNEDfrom the split count.Adds
getSplitCount()toBaseResultIteratorsandindexName,indexKind,saltBuckets,regionsPlannedtoExplainPlanAttributes.Co-authored-by: Claude Opus 4.8[1m] noreply@anthropic.com