Skip to content

Commit 7d14e90

Browse files
obdevlinbo-lin
authored andcommitted
[CP] fix set_force_partition
Co-authored-by: linbo-lin <1434442536@qq.com>
1 parent 215df8f commit 7d14e90

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

src/sql/optimizer/ob_log_table_scan.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2817,7 +2817,14 @@ int ObLogTableScan::allocate_granule_post(AllocGIContext &ctx)
28172817
ctx.hash_part_ = table_schema->is_hash_part() || table_schema->is_hash_subpart()
28182818
|| table_schema->is_key_part() || table_schema->is_key_subpart();
28192819
//Before GI is adapted to the real agent table, block gi cannot be assigned to it
2820-
if (table_schema->is_spatial_index() || table_schema->is_vec_index()) {
2820+
if (is_text_retrieval_scan()
2821+
|| is_vec_idx_scan_post_filter()
2822+
|| is_multivalue_index_scan()
2823+
|| use_index_merge()
2824+
|| is_ivf_adaptive_scan()
2825+
|| is_ipivf_adaptive_scan()
2826+
|| table_schema->is_spatial_index()
2827+
|| table_schema->is_vec_index()) {
28212828
ctx.set_force_partition();
28222829
}
28232830
} else { /*do nothing*/ }

src/sql/optimizer/ob_log_table_scan.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@ struct ObVecIndexInfo
270270
vector_index_param_.type_ == ObVectorIndexAlgorithmType::VIAT_HNSW_BQ ||
271271
vector_index_param_.type_ == ObVectorIndexAlgorithmType::VIAT_IPIVF;
272272
}
273+
inline bool is_ipivf_vec_scan() const
274+
{
275+
return vector_index_param_.type_ == ObVectorIndexAlgorithmType::VIAT_IPIVF;
276+
}
273277
inline bool is_spiv_scan() const { return vector_index_param_.type_ == ObVectorIndexAlgorithmType::VIAT_SPIV; }
274278
inline bool is_ivf_vec_scan() const
275279
{
@@ -290,6 +294,8 @@ struct ObVecIndexInfo
290294
|| ObVecIndexType::VEC_INDEX_POST_ITERATIVE_FILTER == vec_type_; }
291295
inline bool is_vec_adaptive_scan() const { return vec_type_ == ObVecIndexType::VEC_INDEX_ADAPTIVE_SCAN; }
292296
inline bool is_vec_adaptive_iter_scan() const { return is_vec_adaptive_scan() && (adaptive_try_path_ == ObVecIdxAdaTryPath::VEC_INDEX_ITERATIVE_FILTER || adaptive_try_path_ == ObVecIdxAdaTryPath::VEC_INDEX_POST_FILTER); }
297+
inline bool is_ivf_adaptive_scan() const { return is_ivf_vec_scan() && is_vec_adaptive_scan(); }
298+
inline bool is_ipivf_adaptive_scan() const { return is_ipivf_vec_scan() && is_vec_adaptive_scan(); }
293299
inline bool need_index_back() const { return is_ivf_vec_scan() || is_hnsw_vec_scan() || is_spiv_scan();}
294300
uint64_t get_aux_table_id(ObVectorAuxTableIdx idx) const { return idx < aux_table_id_.count() ? aux_table_id_[idx] : OB_INVALID_ID; }
295301
ObColumnRefRawExpr* get_aux_table_column(int idx) const { return idx < aux_table_column_.count() ? aux_table_column_[idx] : nullptr; }
@@ -1025,6 +1031,8 @@ class ObLogTableScan : public ObLogicalOperator
10251031
inline bool is_vec_idx_scan_post_filter() const { return is_index_scan() && vector_index_info_.vec_index_post_filter(); }
10261032
inline bool is_vec_idx_scan() const { return is_vec_idx_scan_pre_filter() || is_vec_idx_scan_post_filter(); }
10271033
inline bool is_vec_adaptive_scan() const { return vector_index_info_.is_vec_adaptive_scan(); }
1034+
inline bool is_ivf_adaptive_scan() const { return vector_index_info_.is_ivf_adaptive_scan(); }
1035+
inline bool is_ipivf_adaptive_scan() const { return vector_index_info_.is_ipivf_adaptive_scan(); }
10281036
inline bool is_spiv_vec_scan() const {return vector_index_info_.is_spiv_scan();}
10291037
inline ObVecIndexInfo &get_vector_index_info() { return vector_index_info_; }
10301038
inline const ObVecIndexInfo &get_vector_index_info() const { return vector_index_info_; }

0 commit comments

Comments
 (0)