eldenmoon commented on code in PR #18654:
URL: https://github.com/apache/doris/pull/18654#discussion_r1186648677


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java:
##########
@@ -195,6 +197,45 @@ public PhysicalPlanTranslator(PlanTranslatorContext 
context, StatsErrorEstimator
         this.statsErrorEstimator = statsErrorEstimator;
     }
 
+    // We use two phase read to optimize sql like: select * from tbl [where 
xxx = ???] [order by column1] [limit n]
+    // in the first phase, we add an extra column `RowId` to Block, and sort 
blocks in TopN nodes
+    // in the second phase, we have n rows, we do a fetch rpc to get all 
rowids data for the n rows
+    // and reconconstruct the final block
+    private void setResultSinkFetchOptionIfNeed() {

Review Comment:
   As we discussed, let's make these changes first, and subsequently support 
general lazy materialization.



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to