Remove xtradb "fragmentation-statistics" patches
The patches are implemented using server changes in THD. We are not interested in having special code for certain storage engines, if possible.
This commit is contained in:
parent
a82bb5d316
commit
12c42bd2c7
@ -34,39 +34,6 @@ Created 2/23/1996 Heikki Tuuri
|
||||
#include "trx0trx.h"
|
||||
#include "srv0srv.h"
|
||||
|
||||
/** Updates fragmentation statistics for a single page transition.
|
||||
@param[in] page the current page being processed
|
||||
@param[in] page_no page number to move to (next_page_no
|
||||
if forward_direction is true,
|
||||
prev_page_no otherwise.
|
||||
@param[in] forward_direction move direction: true means moving
|
||||
forward, false - backward. */
|
||||
static
|
||||
void
|
||||
btr_update_scan_stats(const page_t* page, ulint page_no, bool forward_direction)
|
||||
{
|
||||
fragmentation_stats_t stats;
|
||||
memset(&stats, 0, sizeof(stats));
|
||||
ulint extracted_page_no = page_get_page_no(page);
|
||||
ulint delta = forward_direction ?
|
||||
page_no - extracted_page_no :
|
||||
extracted_page_no - page_no;
|
||||
|
||||
if (delta == 1) {
|
||||
++stats.scan_pages_contiguous;
|
||||
} else {
|
||||
++stats.scan_pages_disjointed;
|
||||
}
|
||||
stats.scan_pages_total_seek_distance +=
|
||||
extracted_page_no > page_no ?
|
||||
extracted_page_no - page_no :
|
||||
page_no - extracted_page_no;
|
||||
|
||||
stats.scan_data_size += page_get_data_size(page);
|
||||
stats.scan_deleted_recs_size +=
|
||||
page_header_get_field(page, PAGE_GARBAGE);
|
||||
thd_add_fragmentation_stats(current_thd, &stats);
|
||||
}
|
||||
/**************************************************************//**
|
||||
Allocates memory for a persistent cursor object and initializes the cursor.
|
||||
@return own: persistent cursor */
|
||||
@ -460,8 +427,6 @@ btr_pcur_move_to_next_page(
|
||||
|
||||
ut_ad(next_page_no != FIL_NULL);
|
||||
|
||||
btr_update_scan_stats(page, next_page_no, true /* forward */);
|
||||
|
||||
next_block = btr_block_get(space, zip_size, next_page_no,
|
||||
cursor->latch_mode,
|
||||
btr_pcur_get_btr_cur(cursor)->index, mtr);
|
||||
@ -545,10 +510,6 @@ btr_pcur_move_backward_from_page(
|
||||
|
||||
prev_page_no = btr_page_get_prev(page, mtr);
|
||||
|
||||
if (prev_page_no != FIL_NULL) {
|
||||
btr_update_scan_stats(page, prev_page_no, false /* backward */);
|
||||
}
|
||||
|
||||
if (prev_page_no == FIL_NULL) {
|
||||
} else if (btr_pcur_is_before_first_on_page(cursor)) {
|
||||
|
||||
|
@ -1090,22 +1090,6 @@ static SHOW_VAR innodb_status_variables[]= {
|
||||
(char*) &export_vars.innodb_sec_rec_cluster_reads_avoided, SHOW_LONG},
|
||||
{"buffered_aio_submitted",
|
||||
(char*) &export_vars.innodb_buffered_aio_submitted, SHOW_LONG},
|
||||
|
||||
{"scan_pages_contiguous",
|
||||
(char*) &export_vars.innodb_fragmentation_stats.scan_pages_contiguous,
|
||||
SHOW_LONG},
|
||||
{"scan_pages_disjointed",
|
||||
(char*) &export_vars.innodb_fragmentation_stats.scan_pages_disjointed,
|
||||
SHOW_LONG},
|
||||
{"scan_pages_total_seek_distance",
|
||||
(char*) &export_vars.innodb_fragmentation_stats.scan_pages_total_seek_distance,
|
||||
SHOW_LONG},
|
||||
{"scan_data_size",
|
||||
(char*) &export_vars.innodb_fragmentation_stats.scan_data_size,
|
||||
SHOW_LONG},
|
||||
{"scan_deleted_recs_size",
|
||||
(char*) &export_vars.innodb_fragmentation_stats.scan_deleted_recs_size,
|
||||
SHOW_LONG},
|
||||
{NullS, NullS, SHOW_LONG}
|
||||
};
|
||||
|
||||
@ -2940,7 +2924,7 @@ ha_innobase::ha_innobase(
|
||||
HA_BINLOG_ROW_CAPABLE |
|
||||
HA_CAN_GEOMETRY | HA_PARTIAL_COLUMN_READ |
|
||||
HA_TABLE_SCAN_ON_INDEX | HA_CAN_FULLTEXT |
|
||||
HA_CAN_FULLTEXT_EXT | HA_CAN_EXPORT | HA_ONLINE_ANALYZE),
|
||||
HA_CAN_FULLTEXT_EXT | HA_CAN_EXPORT),
|
||||
start_of_scan(0),
|
||||
num_write_row(0)
|
||||
{}
|
||||
|
@ -1131,9 +1131,6 @@ struct export_var_t{
|
||||
ulint innodb_sec_rec_cluster_reads_avoided; /*!< srv_sec_rec_cluster_reads_avoided */
|
||||
|
||||
ulint innodb_buffered_aio_submitted;
|
||||
|
||||
fragmentation_stats_t innodb_fragmentation_stats;/*!< Fragmentation
|
||||
statistics */
|
||||
};
|
||||
|
||||
/** Thread slot in the thread table. */
|
||||
|
@ -1996,9 +1996,6 @@ srv_export_innodb_status(void)
|
||||
export_vars.innodb_buffered_aio_submitted =
|
||||
srv_stats.n_aio_submitted;
|
||||
|
||||
thd_get_fragmentation_stats(current_thd,
|
||||
&export_vars.innodb_fragmentation_stats);
|
||||
|
||||
mutex_exit(&srv_innodb_monitor_mutex);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user