[ 
https://issues.apache.org/jira/browse/PHOENIX-7891?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrew Kyle Purtell updated PHOENIX-7891:
-----------------------------------------
    Description: 
Capture the query optimizer's index selection rationale with a new data model 
and a closed set of {{RULE_*}} and {{REASON_*}} string constants plumbed 
through {{QueryPlan}}/{{BaseQueryPlan}}/{{DelegateQueryPlan}}. 
{{AddPlanResult}} returns from the two {{addPlan}} overloads, and a 
{{DecisionState}} accumulator is threaded through. A new helper method assigns 
the winning rule and collected rejections. New {{ExplainPlanAttributes}} fields 
{{indexRule}} and {{indexRejected}} are set in {{BaseQueryPlan}} from 
{{getOptimizerDecision()}}, with matching {{ExplainPlanTestUtil}} fluent 
assertions {{indexRule}}, {{indexRuleStartsWith}}, {{indexRejectedCount}}, 
{{indexRejected}}, and {{indexRejectedNone}}.

{{EXPLAIN}} output gains {{INDEX <name> [<kind>]  [/* <rule> */]}} for chosen 
index and one {{/* !INDEX <name> -- <reason> */}} line per rejected index.

  was:
Capture the query optimizer's index selection rationale and surface it in 
{{EXPLAIN}} output.

A new {{OptimizerDecision}} data model describing chosen indexes, decision 
rules, and rejected candidates with reasons is plumbed through {{QueryPlan}} 
and populated during planning, tagging each comparator and short-circuit branch 
(point lookup, hint, cost-based, CDC index, order-preserving, local-vs-global 
tie-break, partial index, etc.) and recording index selection or rejection 
reasons. {{QueryOptimizer.addPlan}} returns {{Optional<RejectedIndexEntry>}}. 

{{EXPLAIN}} output gains {{INDEX <name> [<kind>]  [/* <rule> */]}} for chosen 
index and one {{/* !INDEX <name> -- <reason> */}} line per rejected index.


> Explain the query optimizer's index selection rationale
> -------------------------------------------------------
>
>                 Key: PHOENIX-7891
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-7891
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Andrew Kyle Purtell
>            Assignee: Andrew Kyle Purtell
>            Priority: Major
>             Fix For: PHOENIX-7876-feature
>
>
> Capture the query optimizer's index selection rationale with a new data model 
> and a closed set of {{RULE_*}} and {{REASON_*}} string constants plumbed 
> through {{QueryPlan}}/{{BaseQueryPlan}}/{{DelegateQueryPlan}}. 
> {{AddPlanResult}} returns from the two {{addPlan}} overloads, and a 
> {{DecisionState}} accumulator is threaded through. A new helper method 
> assigns the winning rule and collected rejections. New 
> {{ExplainPlanAttributes}} fields {{indexRule}} and {{indexRejected}} are set 
> in {{BaseQueryPlan}} from {{getOptimizerDecision()}}, with matching 
> {{ExplainPlanTestUtil}} fluent assertions {{indexRule}}, 
> {{indexRuleStartsWith}}, {{indexRejectedCount}}, {{indexRejected}}, and 
> {{indexRejectedNone}}.
> {{EXPLAIN}} output gains {{INDEX <name> [<kind>]  [/* <rule> */]}} for chosen 
> index and one {{/* !INDEX <name> -- <reason> */}} line per rejected index.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to