This is an automated email from the ASF dual-hosted git repository. dataroaring pushed a commit to branch branch-3.0 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push: new b4a0d427500 [improvement](statistics)Remove read lock when doing db analyze. (#49250) (#49321) b4a0d427500 is described below commit b4a0d427500fa2c7ee7501a6e85a90955bfea4e9 Author: James <lijib...@selectdb.com> AuthorDate: Fri Mar 21 10:05:48 2025 +0800 [improvement](statistics)Remove read lock when doing db analyze. (#49250) (#49321) backport: https://github.com/apache/doris/pull/49250 --- .../apache/doris/statistics/AnalysisManager.java | 51 ++++++++++------------ 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java index d92179cf2f0..0db9e010c78 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java +++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java @@ -197,38 +197,33 @@ public class AnalysisManager implements Writable { public List<AnalysisInfo> buildAnalysisInfosForDB(DatabaseIf<TableIf> db, AnalyzeProperties analyzeProperties) throws AnalysisException { - db.readLock(); List<TableIf> tbls = db.getTables(); List<AnalysisInfo> analysisInfos = new ArrayList<>(); - try { - List<AnalyzeTblStmt> analyzeStmts = new ArrayList<>(); - for (TableIf table : tbls) { - if (table instanceof View) { - continue; - } - TableName tableName = new TableName(db.getCatalog().getName(), db.getFullName(), table.getName()); - // columnNames null means to add all visible columns. - // Will get all the visible columns in analyzeTblStmt.check() - AnalyzeTblStmt analyzeTblStmt = new AnalyzeTblStmt(analyzeProperties, tableName, - null, db.getId(), table); - try { - analyzeTblStmt.check(); - } catch (AnalysisException analysisException) { - LOG.warn("Failed to build analyze job: {}", - analysisException.getMessage(), analysisException); - } - analyzeStmts.add(analyzeTblStmt); + List<AnalyzeTblStmt> analyzeStmts = new ArrayList<>(); + for (TableIf table : tbls) { + if (table instanceof View) { + continue; } - for (AnalyzeTblStmt analyzeTblStmt : analyzeStmts) { - try { - analysisInfos.add(buildAndAssignJob(analyzeTblStmt)); - } catch (DdlException e) { - LOG.warn("Failed to build analyze job: {}", - e.getMessage(), e); - } + TableName tableName = new TableName(db.getCatalog().getName(), db.getFullName(), table.getName()); + // columnNames null means to add all visible columns. + // Will get all the visible columns in analyzeTblStmt.check() + AnalyzeTblStmt analyzeTblStmt = new AnalyzeTblStmt(analyzeProperties, tableName, + null, db.getId(), table); + try { + analyzeTblStmt.check(); + } catch (AnalysisException analysisException) { + LOG.warn("Failed to build analyze job: {}", + analysisException.getMessage(), analysisException); + } + analyzeStmts.add(analyzeTblStmt); + } + for (AnalyzeTblStmt analyzeTblStmt : analyzeStmts) { + try { + analysisInfos.add(buildAndAssignJob(analyzeTblStmt)); + } catch (DdlException e) { + LOG.warn("Failed to build analyze job: {}", + e.getMessage(), e); } - } finally { - db.readUnlock(); } return analysisInfos; } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org