github-actions[bot] commented on code in PR #63192:
URL: https://github.com/apache/doris/pull/63192#discussion_r3253254347
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/AccessPathPlanCollector.java:
##########
@@ -230,11 +231,15 @@ public Void visitLogicalGenerate(LogicalGenerate<?
extends Plan> generate, State
public Void visitLogicalProject(LogicalProject<? extends Plan> project,
StatementContext context) {
AccessPathExpressionCollector exprCollector
= new AccessPathExpressionCollector(context,
allSlotToAccessPaths, false);
Review Comment:
This uses an empty global `allSlotToAccessPaths` as proof that the current
project is the query result, but inner producer projects can also be visited
with no propagated demand. For example, `WITH c AS (SELECT v FROM variant_tbl)
SELECT 1 FROM c` visits the CTE consumer first, records no access path for `v`,
then visits the producer project with this map still empty. This branch records
a root `[v]` path even though the outer query never uses `v`, so the scan is
forced to read the full VARIANT column unnecessarily. Please distinguish true
root/result projection demand from a producer/subquery with no consumer demand,
and add coverage for an unused VARIANT CTE/subquery output.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]