[CP] fix gis index parallel

This commit is contained in:
obdev 2023-04-04 02:18:00 +00:00 committed by ob-robot
parent 7466f362ea
commit d897a02f21
2 changed files with 27 additions and 1 deletions

View File

@ -2291,7 +2291,12 @@ int ObJoinOrder::get_valid_index_ids(const uint64_t table_id,
} else if (0 == valid_index_ids.count()) {
for (int64_t i = -1; OB_SUCC(ret) && i < index_count; ++i) {
const uint64_t tid = (i == -1) ? ref_table_id : tids[i]; //with base table
if (OB_FAIL(valid_index_ids.push_back(tid))) {
bool is_skip = false;
if (i != -1 && OB_FAIL(check_px_spatial_index(schema_guard, tid, is_skip))) {
LOG_WARN("fail to check px spatial index", K(ref_table_id), K(tid), K(ret));
}
if (OB_FAIL(ret) || is_skip) {
} else if (OB_FAIL(valid_index_ids.push_back(tid))) {
LOG_WARN("failed to push back index id", K(ret));
} else { /*do nothing*/ }
}
@ -2323,6 +2328,24 @@ int ObJoinOrder::get_valid_index_ids(const uint64_t table_id,
return ret;
}
int ObJoinOrder::check_px_spatial_index(ObSqlSchemaGuard *schema_guard, uint64_t index_id, bool &is_skip)
{
int ret = OB_SUCCESS;
is_skip = false;
const ObTableSchema *index_schema = NULL;
if (!OPT_CTX.use_intra_parallel()) {
// do nothing
} else if (OB_FAIL(schema_guard->get_table_schema(index_id, index_schema)) ||
OB_ISNULL(index_schema)) {
ret = OB_SCHEMA_ERROR;
LOG_WARN("fail to get table schema", K(index_id), K(ret));
} else if (index_schema->is_spatial_index()) {
is_skip = true;
}
return ret;
}
int ObJoinOrder::compute_cost_and_prune_access_path(PathHelper &helper,
ObIArray<AccessPath *> &access_paths)
{

View File

@ -2165,6 +2165,9 @@ struct NullAwareAntiJoinInfo {
int64_t &common_prefix_idx);
private:
int check_px_spatial_index(ObSqlSchemaGuard *schema_guard,
uint64_t index_id,
bool &res_tmp);
int compute_cost_and_prune_access_path(PathHelper &helper,
ObIArray<AccessPath *> &access_paths);
int revise_output_rows_after_creating_path(PathHelper &helper,