Skip to content

Commit 12c42bd

Browse files
committed
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.
1 parent a82bb5d commit 12c42bd

File tree

4 files changed

+1
-62
lines changed

4 files changed

+1
-62
lines changed

storage/xtradb/btr/btr0pcur.cc

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -34,39 +34,6 @@ Created 2/23/1996 Heikki Tuuri
3434
#include "trx0trx.h"
3535
#include "srv0srv.h"
3636

37-
/** Updates fragmentation statistics for a single page transition.
38-
@param[in] page the current page being processed
39-
@param[in] page_no page number to move to (next_page_no
40-
if forward_direction is true,
41-
prev_page_no otherwise.
42-
@param[in] forward_direction move direction: true means moving
43-
forward, false - backward. */
44-
static
45-
void
46-
btr_update_scan_stats(const page_t* page, ulint page_no, bool forward_direction)
47-
{
48-
fragmentation_stats_tstats;
49-
memset(&stats, 0, sizeof(stats));
50-
ulint extracted_page_no = page_get_page_no(page);
51-
ulint delta = forward_direction ?
52-
page_no - extracted_page_no :
53-
extracted_page_no - page_no;
54-
55-
if (delta == 1) {
56-
++stats.scan_pages_contiguous;
57-
} else {
58-
++stats.scan_pages_disjointed;
59-
}
60-
stats.scan_pages_total_seek_distance +=
61-
extracted_page_no > page_no ?
62-
extracted_page_no - page_no :
63-
page_no - extracted_page_no;
64-
65-
stats.scan_data_size += page_get_data_size(page);
66-
stats.scan_deleted_recs_size +=
67-
page_header_get_field(page, PAGE_GARBAGE);
68-
thd_add_fragmentation_stats(current_thd, &stats);
69-
}
7037
/**************************************************************//**
7138
Allocates memory for a persistent cursor object and initializes the cursor.
7239
@return own: persistent cursor */
@@ -460,8 +427,6 @@ btr_pcur_move_to_next_page(
460427

461428
ut_ad(next_page_no != FIL_NULL);
462429

463-
btr_update_scan_stats(page, next_page_no, true /* forward */);
464-
465430
next_block = btr_block_get(space, zip_size, next_page_no,
466431
cursor->latch_mode,
467432
btr_pcur_get_btr_cur(cursor)->index, mtr);
@@ -545,10 +510,6 @@ btr_pcur_move_backward_from_page(
545510

546511
prev_page_no = btr_page_get_prev(page, mtr);
547512

548-
if (prev_page_no != FIL_NULL) {
549-
btr_update_scan_stats(page, prev_page_no, false /* backward */);
550-
}
551-
552513
if (prev_page_no == FIL_NULL) {
553514
} else if (btr_pcur_is_before_first_on_page(cursor)) {
554515

storage/xtradb/handler/ha_innodb.cc

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,22 +1090,6 @@ static SHOW_VAR innodb_status_variables[]= {
10901090
(char*) &export_vars.innodb_sec_rec_cluster_reads_avoided, SHOW_LONG},
10911091
{"buffered_aio_submitted",
10921092
(char*) &export_vars.innodb_buffered_aio_submitted, SHOW_LONG},
1093-
1094-
{"scan_pages_contiguous",
1095-
(char*) &export_vars.innodb_fragmentation_stats.scan_pages_contiguous,
1096-
SHOW_LONG},
1097-
{"scan_pages_disjointed",
1098-
(char*) &export_vars.innodb_fragmentation_stats.scan_pages_disjointed,
1099-
SHOW_LONG},
1100-
{"scan_pages_total_seek_distance",
1101-
(char*) &export_vars.innodb_fragmentation_stats.scan_pages_total_seek_distance,
1102-
SHOW_LONG},
1103-
{"scan_data_size",
1104-
(char*) &export_vars.innodb_fragmentation_stats.scan_data_size,
1105-
SHOW_LONG},
1106-
{"scan_deleted_recs_size",
1107-
(char*) &export_vars.innodb_fragmentation_stats.scan_deleted_recs_size,
1108-
SHOW_LONG},
11091093
{NullS, NullS, SHOW_LONG}
11101094
};
11111095

@@ -2940,7 +2924,7 @@ ha_innobase::ha_innobase(
29402924
HA_BINLOG_ROW_CAPABLE |
29412925
HA_CAN_GEOMETRY | HA_PARTIAL_COLUMN_READ |
29422926
HA_TABLE_SCAN_ON_INDEX | HA_CAN_FULLTEXT |
2943-
HA_CAN_FULLTEXT_EXT | HA_CAN_EXPORT | HA_ONLINE_ANALYZE),
2927+
HA_CAN_FULLTEXT_EXT | HA_CAN_EXPORT),
29442928
start_of_scan(0),
29452929
num_write_row(0)
29462930
{}

storage/xtradb/include/srv0srv.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,9 +1131,6 @@ struct export_var_t{
11311131
ulint innodb_sec_rec_cluster_reads_avoided; /*!< srv_sec_rec_cluster_reads_avoided */
11321132

11331133
ulint innodb_buffered_aio_submitted;
1134-
1135-
fragmentation_stats_t innodb_fragmentation_stats;/*!< Fragmentation
1136-
statistics */
11371134
};
11381135

11391136
/** Thread slot in the thread table. */

storage/xtradb/srv/srv0srv.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1996,9 +1996,6 @@ srv_export_innodb_status(void)
19961996
export_vars.innodb_buffered_aio_submitted =
19971997
srv_stats.n_aio_submitted;
19981998

1999-
thd_get_fragmentation_stats(current_thd,
2000-
&export_vars.innodb_fragmentation_stats);
2001-
20021999
mutex_exit(&srv_innodb_monitor_mutex);
20032000
}
20042001

0 commit comments

Comments
 (0)