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

psergey sergey at mariadb.com
Mon May 17 17:12:22 EEST 2021


revision-id: 8bb3975f7079109ef49597208cddaf913578b70e (percona-202102-47-g8bb3975f707)
parent(s): 76354bb2bd5ae7776f7f5771ffa24b562b73d420
author: Sergei Petrunia
committer: Sergei Petrunia
timestamp: 2021-05-17 17:11:47 +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 | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index c9ce203fb6c..63199c24e32 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -9220,7 +9220,7 @@ int ha_rocksdb::index_read_intern(uchar *const buf, const uchar *const key,
   }
 
   const Rdb_key_def &kd = *m_key_descr_arr[active_index_pos()];
-  bool using_full_key = false;
+  //psergey-psergey-merge: bool using_full_key = false;
 
   /* By default, we don't need the retrieved records to match the prefix */
   m_sk_match_prefix = nullptr;
@@ -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