[Commits] b345ab69f4c: Apply patch: Consolidate rnd_init/rnd_next/rnd_end into index_*

psergey sergey at mariadb.com
Mon May 17 17:13:08 EEST 2021


revision-id: b345ab69f4c44dec6e94865ec6d43178159a4fa6 (percona-202102-47-gb345ab69f4c)
parent(s): 76354bb2bd5ae7776f7f5771ffa24b562b73d420
author: Sergei Petrunia
committer: Sergei Petrunia
timestamp: 2021-05-17 17:13:06 +0300
message:

Apply patch: Consolidate rnd_init/rnd_next/rnd_end into index_*

Summary: Instead of maintaining separate code paths for full table scans, merge them into full index scan code paths. Full table scans are just full index scans on the primary key anyway.

Test Plan: mtr

Reviewers: luqun, herman, yzha

Subscribers: pgl, vinaybhat

Differential Revision: https://phabricator.intern.facebook.com/D23358422

---
 storage/rocksdb/ha_rocksdb.cc | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index c9ce203fb6c..b7f2cd29acb 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -9877,7 +9877,6 @@ int ha_rocksdb::records_from_index(ha_rows *num_rows, uint index) {
 int ha_rocksdb::index_next(uchar *const buf) {
   DBUG_ENTER_FUNC();
   check_build_decoder();
-
   ha_statistic_increment(&System_status_var::ha_read_next_count);
   DBUG_RETURN(index_next_intern(buf));
 }
@@ -9890,7 +9889,6 @@ int ha_rocksdb::index_next(uchar *const buf) {
 int ha_rocksdb::index_prev(uchar *const buf) {
   DBUG_ENTER_FUNC();
   check_build_decoder();
-
   ha_statistic_increment(&System_status_var::ha_read_prev_count);
   DBUG_RETURN(index_prev_intern(buf));
 }
@@ -11268,8 +11266,8 @@ int ha_rocksdb::rnd_init(bool) {
 
   m_need_build_decoder = true;
   active_index = table->s->primary_key;
-
   m_rnd_scan_started = false;
+
   DBUG_RETURN(
       index_init(has_hidden_pk(table) ? MAX_KEY : pk_index(table, m_tbl_def),
                  false /* sorted */));
@@ -11427,11 +11425,9 @@ int ha_rocksdb::rnd_next_with_direction(uchar *const buf, bool move_forward) {
 
 int ha_rocksdb::rnd_end() {
   DBUG_ENTER_FUNC();
-  DBUG_RETURN(index_end());
   m_need_build_decoder = false;
-
+  DBUG_RETURN(index_end());
 }
-
 void ha_rocksdb::build_decoder() {
   m_converter->setup_field_decoders(table->read_set, active_index,
                                     m_keyread_only,


More information about the commits mailing list