ycycse opened a new pull request, #12100:
URL: https://github.com/apache/iotdb/pull/12100

   EXPLAIN ANALYZE is a standard profiling tool for query to show details 
statistics in query execution. It will plan the query, instrument it and 
execute it while collecting metrics info and measuring time spent at various 
point.
   
   This PR supports EXPLAIN ANALYZE according to the way of query in IoTDB. 
Details function design can be seen in 
https://apache-iotdb.feishu.cn/docx/EiqpdacyGoKPy3xMjWAcy2lfnVe.
   
   You can simply try this function in the following way:
   ```
   IoTDB> explain analyze select s1 from root.** order by s2+s3
   
+----------------------------------------------------------------------------------------------------+
   |                                                                            
         Explain Analyze|
   
+----------------------------------------------------------------------------------------------------+
   |Analyze Cost: 18.511333999999998 ms                                         
                        |
   |Fetch Partition Cost: 2.924041 ms                                           
                        |
   |Fetch Schema Cost: 14.448082999999999 ms                                    
                        |
   |Logical Plan Cost: 0.162375 ms                                              
                        |
   |Distribution Plan Cost: 0.0 ms                                              
                        |
   |FRAGMENT-INSTANCE[Id: 20240229_024019_00007_1.2.0][IP: 127.0.0.1][Database: 
root.hhh][DataRegion: 1]|
   |  Total Wall Time: 36 ms                                                    
                        |
   |  Cost of initDataQuerySource: 0.780959 ms                                  
                        |
   |  Seq File(unclosed): 0, Seq File(closed): 104                              
                        |
   |  UnSeq File(unclosed): 0, UnSeq File(closed): 0                            
                        |
   |  ready queued time: 0.8182499999999999 ms, blocked queued time: 
2.7003749999999997 ms              |
   |    [PlanNodeId 13]: IdentitySinkNode(IdentitySinkOperator)                 
                        |
   |        CPU Time: 30.793872 ms                                              
                        |
   |        input: 17420 rows                                                   
                        |
   |        HasNext() Called Count: 37                                          
                        |
   |        Next() Called Count: 36                                             
                        |
   |        Estimated Memory Size: 1310720                                      
                        |
   |      [PlanNodeId 7]: TransformNode(TransformOperator)                      
                        |
   |          CPU Time: 30.730963 ms                                            
                        |
   |          input: 17420 rows                                                 
                        |
   |          HasNext() Called Count: 37                                        
                        |
   |          Next() Called Count: 36                                           
                        |
   |          Estimated Memory Size: 1310720                                    
                        |
   |        [PlanNodeId 6]: SortNode(SortOperator)                              
                        |
   |            CPU Time: 30.670492999999997 ms                                 
                        |
   |            input: 17420 rows                                               
                        |
   |            HasNext() Called Count: 37                                      
                        |
   |            Next() Called Count: 36                                         
                        |
   |            Estimated Memory Size: 0                                        
                        |
   |            sortCost/ns: 13573500                                           
                        |
   |            sortedDataSize: 387416                                          
                        |
   |            prepareCost/ns: 11800710                                        
                        |
   |          [PlanNodeId 5]: TransformNode(TransformOperator)                  
                        |
   |              CPU Time: 10.351251 ms                                        
                        |
   |              input: 17420 rows                                             
                        |
   |              HasNext() Called Count: 73                                    
                        |
   |              Next() Called Count: 18                                       
                        |
   |              Estimated Memory Size: 0                                      
                        |
   |            [PlanNodeId 4]: 
FullOuterTimeJoinNode(FullOuterTimeJoinOperator)                        |
   |                CPU Time: 5.670287 ms                                       
                        |
   |                input: 17420 rows                                           
                        |
   |                HasNext() Called Count: 73                                  
                        |
   |                Next() Called Count: 18                                     
                        |
   |                Estimated Memory Size: 0                                    
                        |
   |              [PlanNodeId 9]: SeriesScanNode(SeriesScanOperator)            
                        |
   |                  CPU Time: 6.628043 ms                                     
                        |
   |                  input: 17420 rows                                         
                        |
   |                  HasNext() Called Count: 19                                
                        |
   |                  Next() Called Count: 18                                   
                        |
   |                  Estimated Memory Size: 0                                  
                        |
   |                  SeriesPath: root.hhh.etth1.s3                             
                        |
   |              [PlanNodeId 10]: SeriesScanNode(SeriesScanOperator)           
                        |
   |                  CPU Time: 7.400207999999999 ms                            
                        |
   |                  input: 17420 rows                                         
                        |
   |                  HasNext() Called Count: 19                                
                        |
   |                  Next() Called Count: 18                                   
                        |
   |                  Estimated Memory Size: 0                                  
                        |
   |                  SeriesPath: root.hhh.etth2.s2                             
                        |
   |              [PlanNodeId 11]: SeriesScanNode(SeriesScanOperator)           
                        |
   |                  CPU Time: 8.358457 ms                                     
                        |
   |                  input: 17420 rows                                         
                        |
   |                  HasNext() Called Count: 19                                
                        |
   |                  Next() Called Count: 18                                   
                        |
   |                  Estimated Memory Size: 0                                  
                        |
   |                  SeriesPath: root.hhh.etth2.s1                             
                        |
   
+----------------------------------------------------------------------------------------------------+
   Total line number = 65
   ```
   EXPLAIN ANALYZE is a tool for everyone who wants to analyze the query in 
IoTDB, If you have more advice for EXPLAIN ANALYZE, please email 
[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]

Reply via email to