Basing on MySQL-8.0.18, as a reference @@ -535,10 +535,22 @@ dberr_t Parallel_reader::Ctx::traverse() { } const rec_t *rec = page_cur_get_rec(cur); offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap); + /* bug fix: compare with visible record may leads to many times waste of io recource, + because we may miss endpoint due to invisibility. + so, we use latest version of data to compare end point instead. */ + if (rec != nullptr && end_tuple != nullptr) { + auto ret = end_tuple->compare(rec, index, offsets); + + /* Note: The range creation doesn't use MVCC. Therefore it's possible + that the range boundary entry could have been deleted. */ + if (ret <= 0) { + break; + } + } + auto skip = !m_scan_ctx->check_visibility(rec, offsets, heap, &mtr);