Skip to content
Permalink
Browse files

0003793: Optimize routing query for Oracle when majority of sym_data …

…is unrouted
  • Loading branch information...
mmichalek committed Apr 4, 2019
1 parent dbec444 commit 1d2d96b00823d554cb02b504604b6ccfa47b0537
@@ -77,6 +77,10 @@ protected void buildSqlReplacementTokens() {
if (parameterService.is(ParameterConstants.DBDIALECT_ORACLE_USE_HINTS, true)) {
sqlReplacementTokens.put("selectDataUsingGapsSqlHint", "/*+ index(d " + parameterService.getTablePrefix() + "_IDX_D_CHANNEL_ID) */");
}
if (parameterService.is(ParameterConstants.DBDIALECT_ORACLE_USE_SELECT_START_DATA_ID_HINT, false)) {
sqlReplacementTokens.put("selectDataUsingStartDataIdHint", "/*+ full (d) */");
}

}

@Override
@@ -228,6 +228,7 @@ private ParameterConstants() {
public final static String DBDIALECT_ORACLE_USE_TRANSACTION_VIEW = "oracle.use.transaction.view";
public final static String DBDIALECT_ORACLE_TEMPLATE_NUMBER_SPEC = "oracle.template.precision";
public final static String DBDIALECT_ORACLE_USE_HINTS = "oracle.use.hints";
public final static String DBDIALECT_ORACLE_USE_SELECT_START_DATA_ID_HINT = "oracle.use.select.data.using.start.data.id.hint";
public final static String DBDIALECT_ORACLE_SEQUENCE_NOORDER = "oracle.sequence.noorder";
public final static String DBDIALECT_ORACLE_SEQUENCE_NOORDER_NEXTVALUE_DB_URLS = "oracle.sequence.noorder.nextvalue.db.urls";

@@ -39,7 +39,7 @@ public RouterServiceSqlMap(IDatabasePlatform platform, Map<String, String> repla
+ " from $(data) d where d.channel_id=? $(dataRange) ");

putSql("selectDataUsingStartDataId",
"select d.data_id, d.table_name, d.event_type, d.row_data as row_data, d.pk_data as pk_data, d.old_data as old_data, "
"select $(selectDataUsingStartDataIdHint) d.data_id, d.table_name, d.event_type, d.row_data as row_data, d.pk_data as pk_data, d.old_data as old_data, "
+ " d.create_time, d.trigger_hist_id, d.channel_id, d.transaction_id, d.source_node_id, d.external_data, d.node_list "
+ " from $(data) d where d.channel_id=? and data_id >= ? ");

0 comments on commit 1d2d96b

Please sign in to comment.
You can’t perform that action at this time.