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
4 changes: 3 additions & 1 deletion storage/eloq/ha_eloq.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4152,6 +4152,7 @@ int ha_eloq::PkIndexScanOpen(const txservice::TxKey *start_key,
bool require_recs= decode_flag_ > 0;
bool require_sort= eloq_random_scan_sort ||
(active_index != MAX_INDEXES && decode_flag_ > 0);
end_specified_= end_key != nullptr;

auto [yield_func, resume_func]= my_tx->CoroFunctors();

Expand Down Expand Up @@ -4211,6 +4212,7 @@ int ha_eloq::SkIndexScanOpen(const txservice::TxKey *start_index_key,
bool is_require_keys= has_hidden_pk(table) || decode_flag_ > 0;
bool is_require_recs= is_require_keys;
bool is_require_sort= is_require_keys;
end_specified_= end_index_key != nullptr;

auto [yield_func, resume_func]= my_tx->CoroFunctors();

Expand Down Expand Up @@ -5212,7 +5214,7 @@ int ha_eloq::IndexScanClose()
ccm_scan_key_= nullptr;
ccm_scan_rec_= nullptr;
ccm_scan_rec_status_= txservice::RecordStatus::Unknown;

end_specified_= false;
scan_batch_idx_= UINT64_MAX;
if (scan_batch_.size() > DEFAULT_SCAN_TUPLE_SIZE)
{
Expand Down
7 changes: 7 additions & 0 deletions storage/eloq/ha_eloq.h
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,12 @@ class ha_eloq : public handler

uint32_t PrefetchSize()
{
if (end_specified_)
{
// Prefetch more agressively if end key is specified as the scan
// will not prefetch beyond the end key.
return 256;
}
std::array<uint32_t, 5> boundaries= {1, 4, 16, 64, 256};

size_t idx= 0;
Expand Down Expand Up @@ -774,6 +780,7 @@ class ha_eloq : public handler
txservice::TxKey search_tx_key_{&search_key_};
EloqKey scan_end_key_;
txservice::TxKey scan_end_tx_key_{&scan_end_key_};
bool end_specified_{false};

uint64_t scan_alias_{UINT64_MAX};
// index currently used if scan is active
Expand Down