Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions be/src/olap/rowset/segment_v2/segment_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2895,19 +2895,7 @@ bool SegmentIterator::_no_need_read_key_data(ColumnId cid, vectorized::MutableCo
return false;
}

// seek_schema is set when get_row_ranges_by_keys, it is null when there is no primary key range
// in this case, we need to read data
if (!_seek_schema) {
return false;
}
// check if the column is in the seek_schema
if (std::none_of(_seek_schema->columns().begin(), _seek_schema->columns().end(),
[&](const Field* col) {
return (col && _opts.tablet_schema->field_index(col->unique_id()) == cid);
})) {
return false;
}
if (!_check_all_conditions_passed_inverted_index_for_column(cid, true)) {
if (!_check_all_conditions_passed_inverted_index_for_column(cid)) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
suite("test_pk_no_need_read_data", "nonConcurrent"){
suite("test_pk_no_need_read_data", "p0"){
def table1 = "test_pk_no_need_read_data"

sql "drop table if exists ${table1}"
Expand Down Expand Up @@ -56,15 +56,12 @@ suite("test_pk_no_need_read_data", "nonConcurrent"){
sql "set enable_count_on_index_pushdown = true"
sql """ set enable_common_expr_pushdown = true """

try {
GetDebugPoint().enableDebugPointForAllBEs("segment_iterator._read_columns_by_index")
qt_select_0 "SELECT COUNT() FROM ${table1} WHERE date='2017-10-01'"
} finally {
GetDebugPoint().disableDebugPointForAllBEs("segment_iterator._read_columns_by_index")
}
qt_select_0 "SELECT COUNT() FROM ${table1} WHERE date='2017-10-01'"
qt_select_1 "SELECT COUNT() FROM ${table1} WHERE year(date)='2017'"
// case2: disable count on index

// case1: disable count on index
sql "set enable_count_on_index_pushdown = false"

qt_select_2 "SELECT COUNT() FROM ${table1} WHERE date='2017-10-01'"
qt_select_3 "SELECT COUNT() FROM ${table1} WHERE year(date)='2017'"
}
Loading