pengxiangyu commented on a change in pull request #4778:
URL: https://github.com/apache/incubator-doris/pull/4778#discussion_r512514422



##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java
##########
@@ -248,7 +248,19 @@ public TListTableStatusResult 
listTableStatus(TGetTablesParams params) throws TE
         if (db != null) {
             db.readLock();
             try {
-                for (Table table : db.getTables()) {
+                List<Table> tables = null;
+                if (!params.isSetType() || params.getType() == null || 
params.getType().isEmpty()) {
+                    tables = db.getTables();
+                } else {
+                    switch (params.getType()) {
+                        case "VIEW":
+                            tables = db.getViews();
+                            break;
+                        default:
+                            tables = db.getTables();
+                    }
+                }

Review comment:
       If type is view, this will call getTables() which is not required. When 
the count of tables in this db is too many, this will take more time.




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

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