Skip to content

Commit

Permalink
[Enhancement] move time-consuming listMaterializedViewStatus out of d…
Browse files Browse the repository at this point in the history
…b lock scope (StarRocks#55281)

Signed-off-by: kaijian.ding <[email protected]>
  • Loading branch information
kaijianding authored Jan 21, 2025
1 parent 95f9515 commit cd512cc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fe/fe-core/src/main/java/com/starrocks/qe/ShowExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,18 +374,18 @@ public ShowResultSet visitShowMaterializedViewStatement(ShowMaterializedViewsStm
}
}
}

List<ShowMaterializedViewStatus> mvStatusList =
listMaterializedViewStatus(dbName, materializedViews, singleTableMVs);
List<List<String>> rowSets = mvStatusList.stream().map(ShowMaterializedViewStatus::toResultSet)
.collect(Collectors.toList());
return new ShowResultSet(statement.getMetaData(), rowSets);
} catch (Exception e) {
LOG.warn("listMaterializedViews failed:", e);
throw e;
} finally {
locker.unLockDatabase(db.getId(), LockType.READ);
}

List<ShowMaterializedViewStatus> mvStatusList =
listMaterializedViewStatus(dbName, materializedViews, singleTableMVs);
List<List<String>> rowSets = mvStatusList.stream().map(ShowMaterializedViewStatus::toResultSet)
.collect(Collectors.toList());
return new ShowResultSet(statement.getMetaData(), rowSets);
}

@Override
Expand Down

0 comments on commit cd512cc

Please sign in to comment.