Maksim Zhuravkov created IGNITE-28199:
-----------------------------------------

             Summary: Sql. Partition pruning. Single bottom-up traversal for 
both queries and DMLs
                 Key: IGNITE-28199
                 URL: https://issues.apache.org/jira/browse/IGNITE-28199
             Project: Ignite
          Issue Type: Improvement
          Components: sql ai3
            Reporter: Maksim Zhuravkov


Current implementation of partition pruning (PP) collection algorithm does 
collect metadata for DML statements that reference multiple sources (see 
examples) or have nested queries, and it has two separate paths for traversing 
rel node trees - a path for queries (PartitionPruningMetadataExtractor is also 
a visitor) and a path for DMLs(ModifyNodeVisitor). 

{noformat}
-- These statements have two sources each - a source for ModifyNode and another 
source for ScanNode.
UPDATE t SET c1=100 WHERE c3=1 and c2 IN (SELECT * FROM SYSTEM_RANGE(1, 100))
DELETE t SET c1=100 WHERE c3=1 and c2 IN (SELECT * FROM SYSTEM_RANGE(1, 100))

--- Does not capture metadata because it has a nested query.
UPDATE t SET c1=100 WHERE c3=1 and c2 IN (SELECT * FROM t2 WHERE id = 42)
{noformat}

*Proposed solution*:
Implement unified bottom-up traversal that in addition to collecting metadata 
from ScanNodeS, propagates that up to ModifyNodeS.






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

Reply via email to