apurtell opened a new pull request, #2523: URL: https://github.com/apache/phoenix/pull/2523
Disclose `OptimizerReasons` for functional indexes. The chosen functional index's per-scan `INDEX` line gains the rule `matches <expr>` where `<expr>` is the user's original path expression. Candidates discarded because no query expression matched their indexed expression are tagged `path expression does not match`. `QueryOptimizer.recordDecision`, `labelComparatorRule`, and the `RULE_ONLY_CANDIDATE` path in `getApplicablePlansForSingleFlatQuery` override the rule label with `OptimizerReasons.matches(sourceExpression.toString())` when the winning candidate is a functional index, sourcing `sourceExpression` from `StatementContext.getIndexExpressionSubstitutions()` of the winning index. `QueryOptimizer.addPlan` and `tagComparatorRejections` switch the rejection tag for functional index candidates to `REASON_PATH_EXPRESSION_DOES_NOT_MATCH`. A functional index is detected by an index column with a non-null `PColumn.getExpressionStr()`. Co-authored-by: Claude Opus 4.8[1m] <[email protected]> -- 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]
