You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by "klion26 (via GitHub)" <gi...@apache.org> on 2024/07/29 06:39:33 UTC
Re: [PR] [AMORO-2893] optimize table page loading [amoro]
klion26 commented on code in PR #2914:
URL: https://github.com/apache/amoro/pull/2914#discussion_r1694659990
##########
amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/persistence/mapper/TableMetaMapper.java:
##########
@@ -424,4 +424,75 @@ List<ServerTableIdentifier> selectTableIdentifiersByCatalog(
typeHandler = MapLong2StringConverter.class)
})
List<TableRuntimeMeta> selectTableRuntimeMetas();
+
+ @Select(
+ "<script>"
+ + "<bind name=\"isMySQL\" value=\"_databaseId == 'MySQL'\" />"
+ + "<bind name=\"isPostgreSQL\" value=\"_databaseId == 'PostgreSQL'\" />"
+ + "<bind name=\"isDerby\" value=\"_databaseId == 'Derby'\" />"
+ + "SELECT table_id, catalog_name, db_name, table_name, current_snapshot_id, "
+ + "current_change_snapshotId, last_optimized_snapshotId, last_optimized_change_snapshotId, "
+ + "last_major_optimizing_time, last_minor_optimizing_time, last_full_optimizing_time, optimizing_status, "
+ + "optimizing_status_start_time, optimizing_process_id, "
+ + "optimizer_group, table_config, pending_input FROM table_runtime "
+ + "WHERE 1=1 "
+ + "<if test='optimizerGroup != null'> AND optimizer_group = #{optimizerGroup} </if> "
+ + "<if test='fuzzyDbName != null'> AND db_name like '%#{fuzzyDbName}%' </if>"
+ + "<if test='fuzzyTableName != null'> AND table_name like '%#{fuzzyTableName}%' </if>"
+ + "ORDER BY CASE optimizing_status "
+ + "WHEN 'MAJOR_OPTIMIZING' THEN 1 "
Review Comment:
in order to optimize the sql efficiency we need to change the optimizing_status from `varchar` to int and add index for (`optimizing_status`, `optimizing_status_start_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.
To unsubscribe, e-mail: commits-unsubscribe@amoro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org