Commit fdc039db authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-28540 Deprecate and ignore the parameter innodb_prefix_index_cluster_optimization

The parameter innodb_prefix_index_cluster_optimization used to enable an
optimization that was added in cb37c557
and was disabled by default.

We will unconditionally enable the extension and mark the parameter
as deprecated.

Related to this, the counters
Innodb_secondary_index_triggered_cluster_reads and
Innodb_secondary_index_triggered_cluster_reads_avoided
allowed to determine the usefulness of this optimization.

Now that the configuration parameter is disabled, the counters
do not serve any useful purpose and can be removed.

row_search_with_covering_prefix(): Fix a bug that caused an
incorrect result to be returned.
parent 0dab74ff
...@@ -70,8 +70,6 @@ buffer_pool_pages_free buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL N ...@@ -70,8 +70,6 @@ buffer_pool_pages_free buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL N
buffer_pages_created buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages created (innodb_pages_created) buffer_pages_created buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages created (innodb_pages_created)
buffer_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages written (innodb_pages_written) buffer_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages written (innodb_pages_written)
buffer_pages_read buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages read (innodb_pages_read) buffer_pages_read buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages read (innodb_pages_read)
buffer_index_sec_rec_cluster_reads buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of secondary record reads triggered cluster read
buffer_index_sec_rec_cluster_reads_avoided buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of secondary record reads avoided triggering cluster read
buffer_data_reads buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Amount of data read in bytes (innodb_data_reads) buffer_data_reads buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Amount of data read in bytes (innodb_data_reads)
buffer_data_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Amount of data written in bytes (innodb_data_written) buffer_data_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Amount of data written in bytes (innodb_data_written)
buffer_flush_batch_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages scanned as part of flush batch buffer_flush_batch_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages scanned as part of flush batch
......
...@@ -98,8 +98,6 @@ INNODB_INSTANT_ALTER_COLUMN ...@@ -98,8 +98,6 @@ INNODB_INSTANT_ALTER_COLUMN
INNODB_ONLINEDDL_ROWLOG_ROWS INNODB_ONLINEDDL_ROWLOG_ROWS
INNODB_ONLINEDDL_ROWLOG_PCT_USED INNODB_ONLINEDDL_ROWLOG_PCT_USED
INNODB_ONLINEDDL_PCT_PROGRESS INNODB_ONLINEDDL_PCT_PROGRESS
INNODB_SECONDARY_INDEX_TRIGGERED_CLUSTER_READS
INNODB_SECONDARY_INDEX_TRIGGERED_CLUSTER_READS_AVOIDED
INNODB_ENCRYPTION_ROTATION_PAGES_READ_FROM_CACHE INNODB_ENCRYPTION_ROTATION_PAGES_READ_FROM_CACHE
INNODB_ENCRYPTION_ROTATION_PAGES_READ_FROM_DISK INNODB_ENCRYPTION_ROTATION_PAGES_READ_FROM_DISK
INNODB_ENCRYPTION_ROTATION_PAGES_MODIFIED INNODB_ENCRYPTION_ROTATION_PAGES_MODIFIED
......
...@@ -36,8 +36,6 @@ buffer_pool_pages_free disabled ...@@ -36,8 +36,6 @@ buffer_pool_pages_free disabled
buffer_pages_created disabled buffer_pages_created disabled
buffer_pages_written disabled buffer_pages_written disabled
buffer_pages_read disabled buffer_pages_read disabled
buffer_index_sec_rec_cluster_reads disabled
buffer_index_sec_rec_cluster_reads_avoided disabled
buffer_data_reads disabled buffer_data_reads disabled
buffer_data_written disabled buffer_data_written disabled
buffer_flush_batch_scanned disabled buffer_flush_batch_scanned disabled
......
SET @start_global_value = @@global.innodb_prefix_index_cluster_optimization;
SELECT @start_global_value;
@start_global_value
0
#
# exists as global only
#
Valid values are 'ON' and 'OFF'
select @@global.innodb_prefix_index_cluster_optimization in (0, 1);
@@global.innodb_prefix_index_cluster_optimization in (0, 1)
1
select @@global.innodb_prefix_index_cluster_optimization;
@@global.innodb_prefix_index_cluster_optimization
0
select @@session.innodb_prefix_index_cluster_optimization;
ERROR HY000: Variable 'innodb_prefix_index_cluster_optimization' is a GLOBAL variable
show global variables like 'innodb_prefix_index_cluster_optimization';
Variable_name Value
innodb_prefix_index_cluster_optimization OFF
show session variables like 'innodb_prefix_index_cluster_optimization';
Variable_name Value
innodb_prefix_index_cluster_optimization OFF
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION OFF
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION OFF
#
# show that it's writable
#
set global innodb_prefix_index_cluster_optimization = 'OFF';
select @@global.innodb_prefix_index_cluster_optimization;
@@global.innodb_prefix_index_cluster_optimization
0
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION OFF
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION OFF
set @@global.innodb_prefix_index_cluster_optimization = 'ON';
select @@global.innodb_prefix_index_cluster_optimization;
@@global.innodb_prefix_index_cluster_optimization
1
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
set global innodb_prefix_index_cluster_optimization = 0;
select @@global.innodb_prefix_index_cluster_optimization;
@@global.innodb_prefix_index_cluster_optimization
0
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION OFF
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION OFF
set @@global.innodb_prefix_index_cluster_optimization = 1;
select @@global.innodb_prefix_index_cluster_optimization;
@@global.innodb_prefix_index_cluster_optimization
1
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
set session innodb_prefix_index_cluster_optimization = 'OFF';
ERROR HY000: Variable 'innodb_prefix_index_cluster_optimization' is a GLOBAL variable and should be set with SET GLOBAL
select @@global.innodb_prefix_index_cluster_optimization;
@@global.innodb_prefix_index_cluster_optimization
1
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
set @@session.innodb_prefix_index_cluster_optimization = 'ON';
ERROR HY000: Variable 'innodb_prefix_index_cluster_optimization' is a GLOBAL variable and should be set with SET GLOBAL
select @@global.innodb_prefix_index_cluster_optimization;
@@global.innodb_prefix_index_cluster_optimization
1
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
#
# incorrect types
#
set global innodb_prefix_index_cluster_optimization = 1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_prefix_index_cluster_optimization'
set global innodb_prefix_index_cluster_optimization = 1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_prefix_index_cluster_optimization'
set global innodb_prefix_index_cluster_optimization = 2;
ERROR 42000: Variable 'innodb_prefix_index_cluster_optimization' can't be set to the value of '2'
set global innodb_prefix_index_cluster_optimization = -3;
ERROR 42000: Variable 'innodb_prefix_index_cluster_optimization' can't be set to the value of '-3'
select @@global.innodb_prefix_index_cluster_optimization;
@@global.innodb_prefix_index_cluster_optimization
1
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
VARIABLE_NAME VARIABLE_VALUE
INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION ON
set global innodb_prefix_index_cluster_optimization = 'AUTO';
ERROR 42000: Variable 'innodb_prefix_index_cluster_optimization' can't be set to the value of 'AUTO'
#
# Cleanup
#
SET @@global.innodb_prefix_index_cluster_optimization = @start_global_value;
SELECT @@global.innodb_prefix_index_cluster_optimization;
@@global.innodb_prefix_index_cluster_optimization
0
...@@ -1256,10 +1256,10 @@ READ_ONLY YES ...@@ -1256,10 +1256,10 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION VARIABLE_NAME INNODB_PREFIX_INDEX_CLUSTER_OPTIMIZATION
SESSION_VALUE NULL SESSION_VALUE NULL
DEFAULT_VALUE OFF DEFAULT_VALUE ON
VARIABLE_SCOPE GLOBAL VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Enable prefix optimization to sometimes avoid cluster index lookups. VARIABLE_COMMENT Deprecated parameter with no effect
NUMERIC_MIN_VALUE NULL NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL NUMERIC_BLOCK_SIZE NULL
......
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_prefix_index_cluster_optimization;
SELECT @start_global_value;
--echo #
--echo # exists as global only
--echo #
--echo Valid values are 'ON' and 'OFF'
select @@global.innodb_prefix_index_cluster_optimization in (0, 1);
select @@global.innodb_prefix_index_cluster_optimization;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_prefix_index_cluster_optimization;
show global variables like 'innodb_prefix_index_cluster_optimization';
show session variables like 'innodb_prefix_index_cluster_optimization';
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
--echo #
--echo # show that it's writable
--echo #
set global innodb_prefix_index_cluster_optimization = 'OFF';
select @@global.innodb_prefix_index_cluster_optimization;
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
set @@global.innodb_prefix_index_cluster_optimization = 'ON';
select @@global.innodb_prefix_index_cluster_optimization;
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
set global innodb_prefix_index_cluster_optimization = 0;
select @@global.innodb_prefix_index_cluster_optimization;
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
set @@global.innodb_prefix_index_cluster_optimization = 1;
select @@global.innodb_prefix_index_cluster_optimization;
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
--error ER_GLOBAL_VARIABLE
set session innodb_prefix_index_cluster_optimization = 'OFF';
select @@global.innodb_prefix_index_cluster_optimization;
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
--error ER_GLOBAL_VARIABLE
set @@session.innodb_prefix_index_cluster_optimization = 'ON';
select @@global.innodb_prefix_index_cluster_optimization;
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
--echo #
--echo # incorrect types
--echo #
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_prefix_index_cluster_optimization = 1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_prefix_index_cluster_optimization = 1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_prefix_index_cluster_optimization = 2;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_prefix_index_cluster_optimization = -3;
select @@global.innodb_prefix_index_cluster_optimization;
select * from information_schema.global_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
select * from information_schema.session_variables where variable_name = 'innodb_prefix_index_cluster_optimization';
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_prefix_index_cluster_optimization = 'AUTO';
--echo #
--echo # Cleanup
--echo #
SET @@global.innodb_prefix_index_cluster_optimization = @start_global_value;
SELECT @@global.innodb_prefix_index_cluster_optimization;
...@@ -1052,13 +1052,6 @@ static SHOW_VAR innodb_status_variables[]= { ...@@ -1052,13 +1052,6 @@ static SHOW_VAR innodb_status_variables[]= {
{"onlineddl_pct_progress", {"onlineddl_pct_progress",
&export_vars.innodb_onlineddl_pct_progress, SHOW_SIZE_T}, &export_vars.innodb_onlineddl_pct_progress, SHOW_SIZE_T},
/* Times secondary index lookup triggered cluster lookup and
times prefix optimization avoided triggering cluster lookup */
{"secondary_index_triggered_cluster_reads",
&export_vars.innodb_sec_rec_cluster_reads, SHOW_SIZE_T},
{"secondary_index_triggered_cluster_reads_avoided",
&export_vars.innodb_sec_rec_cluster_reads_avoided, SHOW_SIZE_T},
/* Encryption */ /* Encryption */
{"encryption_rotation_pages_read_from_cache", {"encryption_rotation_pages_read_from_cache",
&export_vars.innodb_encryption_rotation_pages_read_from_cache, SHOW_SIZE_T}, &export_vars.innodb_encryption_rotation_pages_read_from_cache, SHOW_SIZE_T},
...@@ -19349,11 +19342,13 @@ static MYSQL_SYSVAR_UINT(spin_wait_delay, srv_spin_wait_delay, ...@@ -19349,11 +19342,13 @@ static MYSQL_SYSVAR_UINT(spin_wait_delay, srv_spin_wait_delay,
"Maximum delay between polling for a spin lock (4 by default)", "Maximum delay between polling for a spin lock (4 by default)",
NULL, NULL, 4, 0, 6000, 0); NULL, NULL, 4, 0, 6000, 0);
static my_bool innodb_prefix_index_cluster_optimization;
static MYSQL_SYSVAR_BOOL(prefix_index_cluster_optimization, static MYSQL_SYSVAR_BOOL(prefix_index_cluster_optimization,
srv_prefix_index_cluster_optimization, innodb_prefix_index_cluster_optimization,
PLUGIN_VAR_OPCMDARG, PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_DEPRECATED,
"Enable prefix optimization to sometimes avoid cluster index lookups.", "Deprecated parameter with no effect",
NULL, NULL, FALSE); nullptr, nullptr, TRUE);
static MYSQL_SYSVAR_STR(data_file_path, innobase_data_file_path, static MYSQL_SYSVAR_STR(data_file_path, innobase_data_file_path,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
......
...@@ -175,8 +175,6 @@ enum monitor_id_t { ...@@ -175,8 +175,6 @@ enum monitor_id_t {
MONITOR_OVLD_PAGE_CREATED, MONITOR_OVLD_PAGE_CREATED,
MONITOR_OVLD_PAGES_WRITTEN, MONITOR_OVLD_PAGES_WRITTEN,
MONITOR_OVLD_PAGES_READ, MONITOR_OVLD_PAGES_READ,
MONITOR_OVLD_INDEX_SEC_REC_CLUSTER_READS,
MONITOR_OVLD_INDEX_SEC_REC_CLUSTER_READS_AVOIDED,
MONITOR_OVLD_BYTE_READ, MONITOR_OVLD_BYTE_READ,
MONITOR_OVLD_BYTE_WRITTEN, MONITOR_OVLD_BYTE_WRITTEN,
MONITOR_FLUSH_BATCH_SCANNED, MONITOR_FLUSH_BATCH_SCANNED,
......
...@@ -116,12 +116,6 @@ struct srv_stats_t ...@@ -116,12 +116,6 @@ struct srv_stats_t
/** Number of data read in total (in bytes) */ /** Number of data read in total (in bytes) */
ulint_ctr_1_t data_read; ulint_ctr_1_t data_read;
/** Number of times secondary index lookup triggered cluster lookup */
ulint_ctr_n_t n_sec_rec_cluster_reads;
/** Number of times prefix optimization avoided triggering cluster lookup */
ulint_ctr_n_t n_sec_rec_cluster_reads_avoided;
/** Number of encryption_get_latest_key_version calls */ /** Number of encryption_get_latest_key_version calls */
ulint_ctr_n_t n_key_requests; ulint_ctr_n_t n_key_requests;
...@@ -227,10 +221,6 @@ extern ulong srv_purge_rseg_truncate_frequency; ...@@ -227,10 +221,6 @@ extern ulong srv_purge_rseg_truncate_frequency;
/** Enable or Disable Truncate of UNDO tablespace. */ /** Enable or Disable Truncate of UNDO tablespace. */
extern my_bool srv_undo_log_truncate; extern my_bool srv_undo_log_truncate;
/* Optimize prefix index queries to skip cluster index lookup when possible */
/* Enables or disables this prefix optimization. Disabled by default. */
extern my_bool srv_prefix_index_cluster_optimization;
/** Default size of UNDO tablespace (10MiB for innodb_page_size=16k) */ /** Default size of UNDO tablespace (10MiB for innodb_page_size=16k) */
constexpr ulint SRV_UNDO_TABLESPACE_SIZE_IN_PAGES= (10U << 20) / constexpr ulint SRV_UNDO_TABLESPACE_SIZE_IN_PAGES= (10U << 20) /
UNIV_PAGE_SIZE_DEF; UNIV_PAGE_SIZE_DEF;
...@@ -727,9 +717,6 @@ struct export_var_t{ ...@@ -727,9 +717,6 @@ struct export_var_t{
/* Number of temporary tablespace pages decrypted */ /* Number of temporary tablespace pages decrypted */
ib_int64_t innodb_n_temp_blocks_decrypted; ib_int64_t innodb_n_temp_blocks_decrypted;
ulint innodb_sec_rec_cluster_reads; /*!< srv_sec_rec_cluster_reads */
ulint innodb_sec_rec_cluster_reads_avoided;/*!< srv_sec_rec_cluster_reads_avoided */
ulint innodb_encryption_rotation_pages_read_from_cache; ulint innodb_encryption_rotation_pages_read_from_cache;
ulint innodb_encryption_rotation_pages_read_from_disk; ulint innodb_encryption_rotation_pages_read_from_disk;
ulint innodb_encryption_rotation_pages_modified; ulint innodb_encryption_rotation_pages_modified;
......
...@@ -3337,9 +3337,6 @@ Row_sel_get_clust_rec_for_mysql::operator()( ...@@ -3337,9 +3337,6 @@ Row_sel_get_clust_rec_for_mysql::operator()(
*out_rec = NULL; *out_rec = NULL;
trx = thr_get_trx(thr); trx = thr_get_trx(thr);
srv_stats.n_sec_rec_cluster_reads.inc(
thd_get_thread_id(trx->mysql_thd));
row_build_row_ref_in_tuple(prebuilt->clust_ref, rec, row_build_row_ref_in_tuple(prebuilt->clust_ref, rec,
sec_index, *offsets); sec_index, *offsets);
...@@ -4205,11 +4202,9 @@ bool row_search_with_covering_prefix( ...@@ -4205,11 +4202,9 @@ bool row_search_with_covering_prefix(
const dict_index_t* index = prebuilt->index; const dict_index_t* index = prebuilt->index;
ut_ad(!dict_index_is_clust(index)); ut_ad(!dict_index_is_clust(index));
if (dict_index_is_spatial(index)) { /* In ha_innobase::build_template() we choose to access the
return false; whole row when using exclusive row locks. */
} if (prebuilt->select_lock_type == LOCK_X || !index->is_btree()) {
if (!srv_prefix_index_cluster_optimization) {
return false; return false;
} }
...@@ -4276,7 +4271,6 @@ bool row_search_with_covering_prefix( ...@@ -4276,7 +4271,6 @@ bool row_search_with_covering_prefix(
ut_a(templ->rec_field_no != ULINT_UNDEFINED); ut_a(templ->rec_field_no != ULINT_UNDEFINED);
} }
srv_stats.n_sec_rec_cluster_reads_avoided.inc();
return true; return true;
} }
......
...@@ -278,18 +278,6 @@ static monitor_info_t innodb_counter_info[] = ...@@ -278,18 +278,6 @@ static monitor_info_t innodb_counter_info[] =
MONITOR_EXISTING | MONITOR_DEFAULT_ON), MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_PAGES_READ}, MONITOR_DEFAULT_START, MONITOR_OVLD_PAGES_READ},
{"buffer_index_sec_rec_cluster_reads", "buffer",
"Number of secondary record reads triggered cluster read",
static_cast<monitor_type_t>(
MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_INDEX_SEC_REC_CLUSTER_READS},
{"buffer_index_sec_rec_cluster_reads_avoided", "buffer",
"Number of secondary record reads avoided triggering cluster read",
static_cast<monitor_type_t>(
MONITOR_EXISTING | MONITOR_DEFAULT_ON),
MONITOR_DEFAULT_START, MONITOR_OVLD_INDEX_SEC_REC_CLUSTER_READS_AVOIDED},
{"buffer_data_reads", "buffer", {"buffer_data_reads", "buffer",
"Amount of data read in bytes (innodb_data_reads)", "Amount of data read in bytes (innodb_data_reads)",
static_cast<monitor_type_t>( static_cast<monitor_type_t>(
...@@ -1425,16 +1413,6 @@ srv_mon_process_existing_counter( ...@@ -1425,16 +1413,6 @@ srv_mon_process_existing_counter(
value = buf_pool.stat.n_pages_read; value = buf_pool.stat.n_pages_read;
break; break;
/* Number of times secondary index lookup triggered cluster lookup */
case MONITOR_OVLD_INDEX_SEC_REC_CLUSTER_READS:
value = srv_stats.n_sec_rec_cluster_reads;
break;
/* Number of times prefix optimization avoided triggering cluster
lookup */
case MONITOR_OVLD_INDEX_SEC_REC_CLUSTER_READS_AVOIDED:
value = srv_stats.n_sec_rec_cluster_reads_avoided;
break;
/* innodb_data_reads, the total number of data reads */ /* innodb_data_reads, the total number of data reads */
case MONITOR_OVLD_BYTE_READ: case MONITOR_OVLD_BYTE_READ:
value = srv_stats.data_read; value = srv_stats.data_read;
......
...@@ -291,10 +291,6 @@ uint srv_fast_shutdown; ...@@ -291,10 +291,6 @@ uint srv_fast_shutdown;
/** copy of innodb_status_file; generate a innodb_status.<pid> file */ /** copy of innodb_status_file; generate a innodb_status.<pid> file */
ibool srv_innodb_status; ibool srv_innodb_status;
/** innodb_prefix_index_cluster_optimization; whether to optimize
prefix index queries to skip cluster index lookup when possible */
my_bool srv_prefix_index_cluster_optimization;
/** innodb_stats_transient_sample_pages; /** innodb_stats_transient_sample_pages;
When estimating number of different key values in an index, sample When estimating number of different key values in an index, sample
this many index pages, there are 2 ways to calculate statistics: this many index pages, there are 2 ways to calculate statistics:
...@@ -1031,11 +1027,6 @@ srv_export_innodb_status(void) ...@@ -1031,11 +1027,6 @@ srv_export_innodb_status(void)
export_vars.innodb_onlineddl_rowlog_pct_used = onlineddl_rowlog_pct_used; export_vars.innodb_onlineddl_rowlog_pct_used = onlineddl_rowlog_pct_used;
export_vars.innodb_onlineddl_pct_progress = onlineddl_pct_progress; export_vars.innodb_onlineddl_pct_progress = onlineddl_pct_progress;
export_vars.innodb_sec_rec_cluster_reads =
srv_stats.n_sec_rec_cluster_reads;
export_vars.innodb_sec_rec_cluster_reads_avoided =
srv_stats.n_sec_rec_cluster_reads_avoided;
if (!srv_read_only_mode) { if (!srv_read_only_mode) {
export_vars.innodb_encryption_rotation_pages_read_from_cache = export_vars.innodb_encryption_rotation_pages_read_from_cache =
crypt_stat.pages_read_from_cache; crypt_stat.pages_read_from_cache;
......
...@@ -52,8 +52,6 @@ buffer_pool_pages_free buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL N ...@@ -52,8 +52,6 @@ buffer_pool_pages_free buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL N
buffer_pages_created buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages created (innodb_pages_created) buffer_pages_created buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages created (innodb_pages_created)
buffer_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages written (innodb_pages_written) buffer_pages_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages written (innodb_pages_written)
buffer_pages_read buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages read (innodb_pages_read) buffer_pages_read buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages read (innodb_pages_read)
buffer_index_sec_rec_cluster_reads buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of secondary record reads triggered cluster read
buffer_index_sec_rec_cluster_reads_avoided buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of secondary record reads avoided triggering cluster read
buffer_data_reads buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Amount of data read in bytes (innodb_data_reads) buffer_data_reads buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Amount of data read in bytes (innodb_data_reads)
buffer_data_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Amount of data written in bytes (innodb_data_written) buffer_data_written buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Amount of data written in bytes (innodb_data_written)
buffer_flush_batch_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages scanned as part of flush batch buffer_flush_batch_scanned buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_owner Total pages scanned as part of flush batch
......
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