You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@iotdb.apache.org by "Eric Pai (Jira)" <ji...@apache.org> on 2021/09/26 02:18:00 UTC

[jira] [Created] (IOTDB-1738) Optimize getPaths() of batched insert plans

Eric Pai created IOTDB-1738:
-------------------------------

             Summary: Optimize getPaths() of batched insert plans
                 Key: IOTDB-1738
                 URL: https://issues.apache.org/jira/browse/IOTDB-1738
             Project: Apache IoTDB
          Issue Type: Bug
            Reporter: Eric Pai
            Assignee: Eric Pai
             Fix For: master branch


Currently, the successors of InsertPlan(InsertRowPlan, InsertRowsPlan, InsertRowsOfOneDevicePlan and InsertTabletPlan) have an important getter: getPaths().

This method may be called many times in the plan lifecycle. However, some implementations doesn't cache the result, a O(n) complexity iteration must be executed when calling, which may lead to a bad performance in batched insertion.

For example, see getValidStorageGroups in CMManager 

[https://github.com/apache/iotdb/blob/8ce16e9db08584974e028bf6d30c3bba8b8751c8/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java#L564-L573]

The condition in for-loop is O(n), and it will be executed O(n) times, so the whole method has O(n) complexity. Which leads to a bad performance if n is very large(We have tested with n=80000, which costs more than 5 minutes to finish). And we never know other misusage of the getPaths().

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)