Skip to content

Commit 01a5216

Browse files
committed
MariaRocks port: temporarily? disable Per-table Extra Stats
(why are table reads/writes/updates collected in ha_statistics? this structure was intended for table statistics that the engine reports.. and now it is also used for engine-agnostic statistics like rows_read, rows_requested, etc?)
1 parent 746f35d commit 01a5216

File tree

4 files changed

+40
-6
lines changed

4 files changed

+40
-6
lines changed

storage/rocksdb/ha_rocksdb.cc

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ namespace myrocks {
9797
static st_global_stats global_stats;
9898
static st_export_stats export_stats;
9999

100+
#ifdef MARIAROCKS_NOT_YET
100101
/**
101102
Updates row counters based on the table type and operation type.
102103
*/
@@ -108,6 +109,7 @@ void ha_rocksdb::update_row_stats(operation_type type) {
108109
else
109110
global_stats.rows[type].inc();
110111
}
112+
#endif
111113

112114
void dbug_dump_database(rocksdb::DB *db);
113115
static handler *rocksdb_create_handler(my_core::handlerton *hton,
@@ -6111,9 +6113,9 @@ int ha_rocksdb::secondary_index_read(const int keyno, uchar *buf)
61116113
{
61126114
DBUG_ASSERT(buf != nullptr);
61136115
DBUG_ASSERT(table != nullptr);
6114-
6116+
#ifdef MARIAROCKS_NOT_YET
61156117
stats.rows_requested++;
6116-
6118+
#endif
61176119
/* Use STATUS_NOT_FOUND when record not found or some error occurred */
61186120
table->status= STATUS_NOT_FOUND;
61196121

@@ -6150,9 +6152,11 @@ int ha_rocksdb::secondary_index_read(const int keyno, uchar *buf)
61506152
if (!rc)
61516153
{
61526154
table->status= 0;
6155+
#ifdef MARIAROCKS_NOT_YET
61536156
stats.rows_read++;
61546157
stats.rows_index_next++;
61556158
update_row_stats(ROWS_READ);
6159+
#endif
61566160
}
61576161
return rc;
61586162
}
@@ -6256,8 +6260,9 @@ int ha_rocksdb::index_read_map_impl(uchar *buf, const uchar *key,
62566260

62576261
/* By default, we don't need the retrieved records to match the prefix */
62586262
m_sk_match_prefix= nullptr;
6263+
#ifdef MARIAROCKS_NOT_YET
62596264
stats.rows_requested++;
6260-
6265+
#endif
62616266
if (active_index == table->s->primary_key &&
62626267
find_flag == HA_READ_KEY_EXACT && using_full_key)
62636268
{
@@ -6270,9 +6275,11 @@ int ha_rocksdb::index_read_map_impl(uchar *buf, const uchar *key,
62706275
rc= get_row_by_rowid(buf, m_pk_packed_tuple, size);
62716276
if (!rc)
62726277
{
6278+
#ifdef MARIAROCKS_NOT_YET
62736279
stats.rows_read++;
62746280
stats.rows_index_first++;
62756281
update_row_stats(ROWS_READ);
6282+
#endif
62766283
}
62776284
DBUG_RETURN(rc);
62786285
}
@@ -6397,9 +6404,11 @@ int ha_rocksdb::index_read_map_impl(uchar *buf, const uchar *key,
63976404
else
63986405
{
63996406
table->status= 0;
6407+
#ifdef MARIAROCKS_NOT_YET
64006408
stats.rows_read++;
64016409
stats.rows_index_first++;
64026410
update_row_stats(ROWS_READ);
6411+
#endif
64036412
}
64046413
DBUG_RETURN(rc);
64056414
}
@@ -6962,8 +6971,10 @@ int ha_rocksdb::index_first_intern(uchar *buf)
69626971
index_next is always incremented on success, so decrement if it is
69636972
index_first instead
69646973
*/
6974+
#ifdef MARIAROCKS_NOT_YET
69656975
stats.rows_index_first++;
69666976
stats.rows_index_next--;
6977+
#endif
69676978
}
69686979
DBUG_RETURN(rc);
69696980
}
@@ -7094,8 +7105,10 @@ int ha_rocksdb::index_last_intern(uchar *buf)
70947105
index_next is always incremented on success, so decrement if it is
70957106
index_first instead
70967107
*/
7108+
#ifdef MARIAROCKS_NOT_YET
70977109
stats.rows_index_first++;
70987110
stats.rows_index_next--;
7111+
#endif
70997112
}
71007113
DBUG_RETURN(rc);
71017114
}
@@ -7266,8 +7279,10 @@ int ha_rocksdb::write_row(uchar *buf)
72667279

72677280
if (rv == 0)
72687281
{
7282+
#ifdef MARIAROCKS_NOT_YET
72697283
stats.rows_inserted++;
72707284
update_row_stats(ROWS_INSERTED);
7285+
#endif
72717286
}
72727287
DBUG_RETURN(rv);
72737288
}
@@ -8047,8 +8062,9 @@ int ha_rocksdb::rnd_next_with_direction(uchar *buf, bool move_forward)
80478062
DBUG_ENTER("ha_rocksdb::rnd_next");
80488063

80498064
table->status= STATUS_NOT_FOUND;
8065+
#ifdef MARIAROCKS_NOT_YET
80508066
stats.rows_requested++;
8051-
8067+
#endif
80528068
if (!m_scan_it || !m_scan_it->Valid())
80538069
{
80548070
/*
@@ -8123,9 +8139,11 @@ int ha_rocksdb::rnd_next_with_direction(uchar *buf, bool move_forward)
81238139
rc= HA_ERR_END_OF_FILE;
81248140

81258141
if (!rc) {
8142+
#ifdef MARIAROCKS_NOT_YET
81268143
stats.rows_read++;
81278144
stats.rows_index_next++;
81288145
update_row_stats(ROWS_READ);
8146+
#endif
81298147
}
81308148

81318149
DBUG_RETURN(rc);
@@ -8239,8 +8257,10 @@ int ha_rocksdb::delete_row(const uchar *buf)
82398257
{
82408258
DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
82418259
}
8260+
#ifdef MARIAROCKS_NOT_YET
82428261
stats.rows_deleted++;
82438262
update_row_stats(ROWS_DELETED);
8263+
#endif
82448264

82458265
DBUG_RETURN(0);
82468266
}
@@ -8429,7 +8449,9 @@ int ha_rocksdb::rnd_pos(uchar *buf, uchar *pos)
84298449
size_t len;
84308450
DBUG_ENTER("ha_rocksdb::rnd_pos");
84318451

8452+
#ifdef MARIAROCKS_NOT_YET
84328453
stats.rows_requested++;
8454+
#endif
84338455
len= m_pk_descr->key_length(table, rocksdb::Slice((const char*)pos,
84348456
ref_length));
84358457
if (len == size_t(-1))
@@ -8441,8 +8463,10 @@ int ha_rocksdb::rnd_pos(uchar *buf, uchar *pos)
84418463

84428464
if (!rc)
84438465
{
8466+
#ifdef MARIAROCKS_NOT_YET
84448467
stats.rows_read++;
84458468
update_row_stats(ROWS_READ);
8469+
#endif
84468470
}
84478471

84488472
DBUG_RETURN(rc);
@@ -8504,8 +8528,10 @@ int ha_rocksdb::update_row(const uchar *old_data, uchar *new_data)
85048528

85058529
if (rv == 0)
85068530
{
8531+
#ifdef MARIAROCKS_NOT_YET
85078532
stats.rows_updated++;
85088533
update_row_stats(ROWS_UPDATED);
8534+
#endif
85098535
}
85108536
DBUG_RETURN(rv);
85118537
}

storage/rocksdb/ha_rocksdb.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,9 @@ class ha_rocksdb: public my_core::handler
467467
__attribute__((__nonnull__, __warn_unused_result__));
468468
bool has_hidden_pk(const TABLE* table)
469469
__attribute__((__nonnull__, __warn_unused_result__));
470-
470+
#ifdef MARIAROCKS_NOT_YET
471471
void update_row_stats(operation_type type);
472-
472+
#endif
473473
void set_last_rowkey(const uchar *old_data);
474474

475475
/*

storage/rocksdb/rdb_mariadb_port.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#ifndef RDB_MARIADB_PORT_H
66
#define RDB_MARIADB_PORT_H
77

8+
#include "my_global.h" /* ulonglong */
89
#include "atomic_stat.h"
910

1011
/* Struct used for IO performance counters, shared among multiple threads */
@@ -29,5 +30,7 @@ typedef struct my_io_perf_atomic_struct my_io_perf_atomic_t;
2930
*/
3031
#define abort_with_stack_traces() { abort(); }
3132

33+
////////////////////////////////////////////////////////////////////////////
34+
typedef struct my_io_perf_struct my_io_perf_t;
3235

3336
#endif

storage/rocksdb/rdb_perf_context.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include <my_config.h>
1919

20+
#include "rdb_mariadb_port.h"
2021
/* This C++ file's header file */
2122
#include "./rdb_perf_context.h"
2223

@@ -222,9 +223,12 @@ void Rdb_io_perf::end_and_record(uint32_t perf_context_level)
222223
rocksdb::perf_context.block_read_time;
223224

224225
my_io_perf_sum_atomic_helper(m_shared_io_perf_read, &io_perf_read);
226+
#ifdef MARIAROCKS_NOT_YET
225227
my_io_perf_sum(&m_stats->table_io_perf_read, &io_perf_read);
228+
#endif
226229
}
227230

231+
#ifdef MARIAROCKS_NOT_YET
228232
if (m_stats) {
229233
if (rocksdb::perf_context.internal_key_skipped_count != 0)
230234
{
@@ -237,6 +241,7 @@ void Rdb_io_perf::end_and_record(uint32_t perf_context_level)
237241
rocksdb::perf_context.internal_delete_skipped_count;
238242
}
239243
}
244+
#endif
240245
}
241246

242247
} // namespace myrocks

0 commit comments

Comments
 (0)