Skip to content

Commit

Permalink
[opt](mow) opt mow lookup with sequence column (apache#38287)
Browse files Browse the repository at this point in the history
Compare primary key without sequence column is expensive,
if full key is exact_match, the primary key without sequence column
should also the same,
do not need to compare again.
  • Loading branch information
cambyzju committed Jul 26, 2024
1 parent bdbbcb7 commit 8b93924
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion be/src/olap/rowset/segment_v2/segment_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ Status SegmentIterator::_lookup_ordinal_from_pk_index(const RowCursor& key, bool

// The sequence column needs to be removed from primary key index when comparing key
bool has_seq_col = _segment->_tablet_schema->has_sequence_col();
if (has_seq_col) {
if (has_seq_col && !exact_match) {
size_t seq_col_length =
_segment->_tablet_schema->column(_segment->_tablet_schema->sequence_col_idx())
.length() +
Expand Down

0 comments on commit 8b93924

Please sign in to comment.