Commit 01a5216b authored by Sergei Petrunia's avatar Sergei Petrunia

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?)
parent 746f35d6
...@@ -97,6 +97,7 @@ namespace myrocks { ...@@ -97,6 +97,7 @@ namespace myrocks {
static st_global_stats global_stats; static st_global_stats global_stats;
static st_export_stats export_stats; static st_export_stats export_stats;
#ifdef MARIAROCKS_NOT_YET
/** /**
Updates row counters based on the table type and operation type. Updates row counters based on the table type and operation type.
*/ */
...@@ -108,6 +109,7 @@ void ha_rocksdb::update_row_stats(operation_type type) { ...@@ -108,6 +109,7 @@ void ha_rocksdb::update_row_stats(operation_type type) {
else else
global_stats.rows[type].inc(); global_stats.rows[type].inc();
} }
#endif
void dbug_dump_database(rocksdb::DB *db); void dbug_dump_database(rocksdb::DB *db);
static handler *rocksdb_create_handler(my_core::handlerton *hton, static handler *rocksdb_create_handler(my_core::handlerton *hton,
...@@ -6111,9 +6113,9 @@ int ha_rocksdb::secondary_index_read(const int keyno, uchar *buf) ...@@ -6111,9 +6113,9 @@ int ha_rocksdb::secondary_index_read(const int keyno, uchar *buf)
{ {
DBUG_ASSERT(buf != nullptr); DBUG_ASSERT(buf != nullptr);
DBUG_ASSERT(table != nullptr); DBUG_ASSERT(table != nullptr);
#ifdef MARIAROCKS_NOT_YET
stats.rows_requested++; stats.rows_requested++;
#endif
/* Use STATUS_NOT_FOUND when record not found or some error occurred */ /* Use STATUS_NOT_FOUND when record not found or some error occurred */
table->status= STATUS_NOT_FOUND; table->status= STATUS_NOT_FOUND;
...@@ -6150,9 +6152,11 @@ int ha_rocksdb::secondary_index_read(const int keyno, uchar *buf) ...@@ -6150,9 +6152,11 @@ int ha_rocksdb::secondary_index_read(const int keyno, uchar *buf)
if (!rc) if (!rc)
{ {
table->status= 0; table->status= 0;
#ifdef MARIAROCKS_NOT_YET
stats.rows_read++; stats.rows_read++;
stats.rows_index_next++; stats.rows_index_next++;
update_row_stats(ROWS_READ); update_row_stats(ROWS_READ);
#endif
} }
return rc; return rc;
} }
...@@ -6256,8 +6260,9 @@ int ha_rocksdb::index_read_map_impl(uchar *buf, const uchar *key, ...@@ -6256,8 +6260,9 @@ int ha_rocksdb::index_read_map_impl(uchar *buf, const uchar *key,
/* By default, we don't need the retrieved records to match the prefix */ /* By default, we don't need the retrieved records to match the prefix */
m_sk_match_prefix= nullptr; m_sk_match_prefix= nullptr;
#ifdef MARIAROCKS_NOT_YET
stats.rows_requested++; stats.rows_requested++;
#endif
if (active_index == table->s->primary_key && if (active_index == table->s->primary_key &&
find_flag == HA_READ_KEY_EXACT && using_full_key) find_flag == HA_READ_KEY_EXACT && using_full_key)
{ {
...@@ -6270,9 +6275,11 @@ int ha_rocksdb::index_read_map_impl(uchar *buf, const uchar *key, ...@@ -6270,9 +6275,11 @@ int ha_rocksdb::index_read_map_impl(uchar *buf, const uchar *key,
rc= get_row_by_rowid(buf, m_pk_packed_tuple, size); rc= get_row_by_rowid(buf, m_pk_packed_tuple, size);
if (!rc) if (!rc)
{ {
#ifdef MARIAROCKS_NOT_YET
stats.rows_read++; stats.rows_read++;
stats.rows_index_first++; stats.rows_index_first++;
update_row_stats(ROWS_READ); update_row_stats(ROWS_READ);
#endif
} }
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -6397,9 +6404,11 @@ int ha_rocksdb::index_read_map_impl(uchar *buf, const uchar *key, ...@@ -6397,9 +6404,11 @@ int ha_rocksdb::index_read_map_impl(uchar *buf, const uchar *key,
else else
{ {
table->status= 0; table->status= 0;
#ifdef MARIAROCKS_NOT_YET
stats.rows_read++; stats.rows_read++;
stats.rows_index_first++; stats.rows_index_first++;
update_row_stats(ROWS_READ); update_row_stats(ROWS_READ);
#endif
} }
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -6962,8 +6971,10 @@ int ha_rocksdb::index_first_intern(uchar *buf) ...@@ -6962,8 +6971,10 @@ int ha_rocksdb::index_first_intern(uchar *buf)
index_next is always incremented on success, so decrement if it is index_next is always incremented on success, so decrement if it is
index_first instead index_first instead
*/ */
#ifdef MARIAROCKS_NOT_YET
stats.rows_index_first++; stats.rows_index_first++;
stats.rows_index_next--; stats.rows_index_next--;
#endif
} }
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -7094,8 +7105,10 @@ int ha_rocksdb::index_last_intern(uchar *buf) ...@@ -7094,8 +7105,10 @@ int ha_rocksdb::index_last_intern(uchar *buf)
index_next is always incremented on success, so decrement if it is index_next is always incremented on success, so decrement if it is
index_first instead index_first instead
*/ */
#ifdef MARIAROCKS_NOT_YET
stats.rows_index_first++; stats.rows_index_first++;
stats.rows_index_next--; stats.rows_index_next--;
#endif
} }
DBUG_RETURN(rc); DBUG_RETURN(rc);
} }
...@@ -7266,8 +7279,10 @@ int ha_rocksdb::write_row(uchar *buf) ...@@ -7266,8 +7279,10 @@ int ha_rocksdb::write_row(uchar *buf)
if (rv == 0) if (rv == 0)
{ {
#ifdef MARIAROCKS_NOT_YET
stats.rows_inserted++; stats.rows_inserted++;
update_row_stats(ROWS_INSERTED); update_row_stats(ROWS_INSERTED);
#endif
} }
DBUG_RETURN(rv); DBUG_RETURN(rv);
} }
...@@ -8047,8 +8062,9 @@ int ha_rocksdb::rnd_next_with_direction(uchar *buf, bool move_forward) ...@@ -8047,8 +8062,9 @@ int ha_rocksdb::rnd_next_with_direction(uchar *buf, bool move_forward)
DBUG_ENTER("ha_rocksdb::rnd_next"); DBUG_ENTER("ha_rocksdb::rnd_next");
table->status= STATUS_NOT_FOUND; table->status= STATUS_NOT_FOUND;
#ifdef MARIAROCKS_NOT_YET
stats.rows_requested++; stats.rows_requested++;
#endif
if (!m_scan_it || !m_scan_it->Valid()) if (!m_scan_it || !m_scan_it->Valid())
{ {
/* /*
...@@ -8123,9 +8139,11 @@ int ha_rocksdb::rnd_next_with_direction(uchar *buf, bool move_forward) ...@@ -8123,9 +8139,11 @@ int ha_rocksdb::rnd_next_with_direction(uchar *buf, bool move_forward)
rc= HA_ERR_END_OF_FILE; rc= HA_ERR_END_OF_FILE;
if (!rc) { if (!rc) {
#ifdef MARIAROCKS_NOT_YET
stats.rows_read++; stats.rows_read++;
stats.rows_index_next++; stats.rows_index_next++;
update_row_stats(ROWS_READ); update_row_stats(ROWS_READ);
#endif
} }
DBUG_RETURN(rc); DBUG_RETURN(rc);
...@@ -8239,8 +8257,10 @@ int ha_rocksdb::delete_row(const uchar *buf) ...@@ -8239,8 +8257,10 @@ int ha_rocksdb::delete_row(const uchar *buf)
{ {
DBUG_RETURN(HA_ERR_INTERNAL_ERROR); DBUG_RETURN(HA_ERR_INTERNAL_ERROR);
} }
#ifdef MARIAROCKS_NOT_YET
stats.rows_deleted++; stats.rows_deleted++;
update_row_stats(ROWS_DELETED); update_row_stats(ROWS_DELETED);
#endif
DBUG_RETURN(0); DBUG_RETURN(0);
} }
...@@ -8429,7 +8449,9 @@ int ha_rocksdb::rnd_pos(uchar *buf, uchar *pos) ...@@ -8429,7 +8449,9 @@ int ha_rocksdb::rnd_pos(uchar *buf, uchar *pos)
size_t len; size_t len;
DBUG_ENTER("ha_rocksdb::rnd_pos"); DBUG_ENTER("ha_rocksdb::rnd_pos");
#ifdef MARIAROCKS_NOT_YET
stats.rows_requested++; stats.rows_requested++;
#endif
len= m_pk_descr->key_length(table, rocksdb::Slice((const char*)pos, len= m_pk_descr->key_length(table, rocksdb::Slice((const char*)pos,
ref_length)); ref_length));
if (len == size_t(-1)) if (len == size_t(-1))
...@@ -8441,8 +8463,10 @@ int ha_rocksdb::rnd_pos(uchar *buf, uchar *pos) ...@@ -8441,8 +8463,10 @@ int ha_rocksdb::rnd_pos(uchar *buf, uchar *pos)
if (!rc) if (!rc)
{ {
#ifdef MARIAROCKS_NOT_YET
stats.rows_read++; stats.rows_read++;
update_row_stats(ROWS_READ); update_row_stats(ROWS_READ);
#endif
} }
DBUG_RETURN(rc); DBUG_RETURN(rc);
...@@ -8504,8 +8528,10 @@ int ha_rocksdb::update_row(const uchar *old_data, uchar *new_data) ...@@ -8504,8 +8528,10 @@ int ha_rocksdb::update_row(const uchar *old_data, uchar *new_data)
if (rv == 0) if (rv == 0)
{ {
#ifdef MARIAROCKS_NOT_YET
stats.rows_updated++; stats.rows_updated++;
update_row_stats(ROWS_UPDATED); update_row_stats(ROWS_UPDATED);
#endif
} }
DBUG_RETURN(rv); DBUG_RETURN(rv);
} }
......
...@@ -467,9 +467,9 @@ class ha_rocksdb: public my_core::handler ...@@ -467,9 +467,9 @@ class ha_rocksdb: public my_core::handler
__attribute__((__nonnull__, __warn_unused_result__)); __attribute__((__nonnull__, __warn_unused_result__));
bool has_hidden_pk(const TABLE* table) bool has_hidden_pk(const TABLE* table)
__attribute__((__nonnull__, __warn_unused_result__)); __attribute__((__nonnull__, __warn_unused_result__));
#ifdef MARIAROCKS_NOT_YET
void update_row_stats(operation_type type); void update_row_stats(operation_type type);
#endif
void set_last_rowkey(const uchar *old_data); void set_last_rowkey(const uchar *old_data);
/* /*
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef RDB_MARIADB_PORT_H #ifndef RDB_MARIADB_PORT_H
#define RDB_MARIADB_PORT_H #define RDB_MARIADB_PORT_H
#include "my_global.h" /* ulonglong */
#include "atomic_stat.h" #include "atomic_stat.h"
/* Struct used for IO performance counters, shared among multiple threads */ /* 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; ...@@ -29,5 +30,7 @@ typedef struct my_io_perf_atomic_struct my_io_perf_atomic_t;
*/ */
#define abort_with_stack_traces() { abort(); } #define abort_with_stack_traces() { abort(); }
////////////////////////////////////////////////////////////////////////////
typedef struct my_io_perf_struct my_io_perf_t;
#endif #endif
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <my_config.h> #include <my_config.h>
#include "rdb_mariadb_port.h"
/* This C++ file's header file */ /* This C++ file's header file */
#include "./rdb_perf_context.h" #include "./rdb_perf_context.h"
...@@ -222,9 +223,12 @@ void Rdb_io_perf::end_and_record(uint32_t perf_context_level) ...@@ -222,9 +223,12 @@ void Rdb_io_perf::end_and_record(uint32_t perf_context_level)
rocksdb::perf_context.block_read_time; rocksdb::perf_context.block_read_time;
my_io_perf_sum_atomic_helper(m_shared_io_perf_read, &io_perf_read); my_io_perf_sum_atomic_helper(m_shared_io_perf_read, &io_perf_read);
#ifdef MARIAROCKS_NOT_YET
my_io_perf_sum(&m_stats->table_io_perf_read, &io_perf_read); my_io_perf_sum(&m_stats->table_io_perf_read, &io_perf_read);
#endif
} }
#ifdef MARIAROCKS_NOT_YET
if (m_stats) { if (m_stats) {
if (rocksdb::perf_context.internal_key_skipped_count != 0) if (rocksdb::perf_context.internal_key_skipped_count != 0)
{ {
...@@ -237,6 +241,7 @@ void Rdb_io_perf::end_and_record(uint32_t perf_context_level) ...@@ -237,6 +241,7 @@ void Rdb_io_perf::end_and_record(uint32_t perf_context_level)
rocksdb::perf_context.internal_delete_skipped_count; rocksdb::perf_context.internal_delete_skipped_count;
} }
} }
#endif
} }
} // namespace myrocks } // namespace myrocks
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment