diff --git a/src/sql/optimizer/ob_pwj_comparer.cpp b/src/sql/optimizer/ob_pwj_comparer.cpp index f5bd58c6d315cd86b42643148409da7a8eba3b90..f860c5cc8607a194479307ac6ace00de44ae5d21 100644 --- a/src/sql/optimizer/ob_pwj_comparer.cpp +++ b/src/sql/optimizer/ob_pwj_comparer.cpp @@ -411,7 +411,7 @@ int ObPwjComparer::is_sub_partition_logically_equal(const PwjTable& l_table, con } else { ObPartition* l_part = NULL; ObPartition* r_part = NULL; - for (int64_t i = 0; OB_SUCC(ret) && i < part_id_map_.count(); ++i) { + for (int64_t i = 0; OB_SUCC(ret) && is_equal && i < part_id_map_.count(); ++i) { int64_t l_part_index = part_index_map_.at(i).first; int64_t r_part_index = part_index_map_.at(i).second; l_used_partition_indexes.reuse();