englefly commented on PR #68019:
URL: https://github.com/apache/doris/pull/68019#issuecomment-5716765808

   Review follow-up for the two P1 findings, pushed as e7155731e2f.
   
   **1. Preserve direct index-filter predicate laziness.** The alias resolution 
no longer marks every consumed slot required; it resolves only the consumed 
slots that take part in an identity alias chain - the alias outputs and the 
slots an alias reads. A consumed slot that no alias reads keeps its previous 
behaviour (the operator that consumes it stops the probe for that slot), so 
`topn_lazy_materialization_using_index` plans are back to their previous shape.
   
   The "slot an alias reads" half is kept deliberately: dropping it as well 
reopens the same invalid-plan class, because probing an output that aliases 
such a slot resolves past the operator that consumes it. A lateral `unnest` 
conjunct on the bare column is the concrete case (built and checked both ways), 
and it is now pinned by `qt_lateral_generate_bare_conjunct_plan`.
   
   **2. Account for lateral-generate conjunct inputs.** `collectConsumedSlots` 
now collects the generate conjunct inputs (minus the generator outputs, as 
`LogicalGenerate.getInputSlots()` does), so the alias such a conjunct reads 
keeps its base column materialized. `PhysicalGenerate.getInputSlots()` is left 
untouched to keep the change contained.
   
   Tests added: index-mode filter predicate laziness and two lateral-UNNEST 
conjunct cases in `query_p0/topn_lazy/order_by_alias` (plan shapes asserted, so 
the cases prove selective laziness), plus 
`TopnLazyMaterializeTest#testIndexFilterPredicateSlotStaysLazy` and 
`#testLateralGenerateConjunctKeepsItsAliasSourceMaterialized`.
   
   Verified locally: `query_p0/topn_lazy` (8 suites, including 
`topNLazyMaterializationUsingIndex`) passes; `TopnLazyMaterializeTest` + 
`LazyMaterializeTopNTest` pass (12 tests).
   


-- 
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]

Reply via email to