apurtell opened a new pull request, #2517:
URL: https://github.com/apache/phoenix/pull/2517

   Top-of-plan disclosures rendered as clause-style lines before the first 
operator. 
   
   A new `ExplainTable.explainTopOfPlan(planSteps, ...)` static helper is 
invoked from `ExecutableExplainStatement.compilePlan` after 
`plan.getExplainPlan()`. The block emits `TENANT '<id>'` when `getTenantId()` 
is non-null, `VIEW <viewName> OVER <baseTableName>` when 
`tableRef.getTable().getType() == PTableType.VIEW`, with the user visible view 
name resolved from `plan.getStatement().getFrom()` and the base from 
`PTable.getParentName()` or `getBaseTableLogicalName()`, a CDC scope line when 
the table type is `CDC` or `StatementContext.getCDCIncludeScopes()` is not 
null, and `TXN OMID` when `isTransactional()`. 
   
   Parse tree and optimizer rewrites are surfaced as `REWRITE <description>` 
lines in the same block, fed by a new `appliedRewrites` list in 
`StatementContext`. `BaseQueryPlan.getExplainPlan` walks the query planning 
context, dedupes, preserving first occurrence order, and prepends one `REWRITE` 
line per breadcrumb. `ExplainPlanAttributes` gains a `rewrites}} attribute. 
`SubqueryRewriter}} emits one of `IN SUBQUERY AS SEMI JOIN` / `EXISTS SUBQUERY 
AS SEMI JOIN` / `NOT EXISTS SUBQUERY AS ANTI JOIN` / `SCALAR SUBQUERY AS INNER 
JOIN` / `CORRELATED SUBQUERY AS LEFT JOIN` per decorrelation. 
`JoinCompiler.JoinTable.getStarJoinVector()` emits `STAR JOIN ON <n> RIGHT 
LEGS` when there are at least two right legs. `HavingCompiler}} emits `HAVING 
PREDICATE AS WHERE`. `RVCOffsetCompiler` emits `RVC OFFSET 0x<hex>`. 
`OrderByCompiler.compile` emits `REVERSE SCAN SUBSTITUTION`. 
`QueryCompiler.compileJoinQuery` and `SortMergeJoinPlan` emit `RIGHT JOIN AS 
LEFT JOIN` when the swap fires. `IndexExpress
 ionParseNodeRewriter` emits `INDEX EXPRESSION <expr> AS <indexcol>`. 
`QueryOptimizer.isPartialIndexUsable` emits `PARTIAL INDEX APPLICABLE` or 
`PARTIAL INDEX NOT APPLICABLE -- <reason>`, deduped per table and per index. 
`UnionCompiler.optimizeUnionOrderByIfPossible` emits `UNION ORDER BY MERGE`. 
`SubselectRewriter.flatten` increments a counter slot on `StatementContext` per 
merge and emits `DERIVED TABLE FLATTENED <n>` once with the final count, 
suppressed when the count is zero.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to