mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 11:27:39 +02:00
MDEV-34223 Innodb - add status variable for number of bulk inserts
- Added a counter innodb_num_bulk_insert_operation in INFORMATION_SCHEMA.GLOBAL_STATUS. This counter is incremented whenever a InnoDB undergoes bulk insert operation. - Change the innodb_instant_alter_column to atomic variable.
This commit is contained in:
parent
f2302a62e3
commit
58a0e1e3dd
7 changed files with 29 additions and 2 deletions
|
|
@ -124,3 +124,4 @@ INNODB_ENCRYPTION_N_ROWLOG_BLOCKS_DECRYPTED
|
|||
INNODB_ENCRYPTION_N_TEMP_BLOCKS_ENCRYPTED
|
||||
INNODB_ENCRYPTION_N_TEMP_BLOCKS_DECRYPTED
|
||||
INNODB_ENCRYPTION_NUM_KEY_REQUESTS
|
||||
INNODB_BULK_OPERATIONS
|
||||
|
|
|
|||
|
|
@ -20,9 +20,17 @@ DROP TEMPORARY TABLE t;
|
|||
SET @save_ahi = @@global.innodb_adaptive_hash_index;
|
||||
SET GLOBAL innodb_adaptive_hash_index = 1;
|
||||
CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB;
|
||||
SET @old_bulk_op=
|
||||
(SELECT variable_value FROM information_schema.global_status
|
||||
WHERE variable_name = 'innodb_bulk_operations');
|
||||
BEGIN;
|
||||
INSERT INTO t1 SELECT * FROM seq_1_to_65536;
|
||||
ROLLBACK;
|
||||
SELECT variable_value-@old_bulk_op bulk_operations
|
||||
FROM information_schema.global_status
|
||||
WHERE variable_name = 'innodb_bulk_operations';
|
||||
bulk_operations
|
||||
1
|
||||
CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
|
|
|
|||
|
|
@ -26,9 +26,19 @@ DROP TEMPORARY TABLE t;
|
|||
SET @save_ahi = @@global.innodb_adaptive_hash_index;
|
||||
SET GLOBAL innodb_adaptive_hash_index = 1;
|
||||
CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB;
|
||||
|
||||
SET @old_bulk_op=
|
||||
(SELECT variable_value FROM information_schema.global_status
|
||||
WHERE variable_name = 'innodb_bulk_operations');
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO t1 SELECT * FROM seq_1_to_65536;
|
||||
ROLLBACK;
|
||||
|
||||
SELECT variable_value-@old_bulk_op bulk_operations
|
||||
FROM information_schema.global_status
|
||||
WHERE variable_name = 'innodb_bulk_operations';
|
||||
|
||||
CHECK TABLE t1;
|
||||
--echo #
|
||||
--echo # MDEV-24832 Root page AHI Removal fails fails during
|
||||
|
|
|
|||
|
|
@ -1061,7 +1061,7 @@ static SHOW_VAR innodb_status_variables[]= {
|
|||
{"defragment_count", &export_vars.innodb_defragment_count, SHOW_SIZE_T},
|
||||
|
||||
{"instant_alter_column",
|
||||
&export_vars.innodb_instant_alter_column, SHOW_ULONG},
|
||||
&export_vars.innodb_instant_alter_column, SHOW_SIZE_T},
|
||||
|
||||
/* Online alter table status variables */
|
||||
{"onlineddl_rowlog_rows",
|
||||
|
|
@ -1104,6 +1104,9 @@ static SHOW_VAR innodb_status_variables[]= {
|
|||
{"encryption_num_key_requests", &export_vars.innodb_encryption_key_requests,
|
||||
SHOW_LONGLONG},
|
||||
|
||||
/* InnoDB bulk operations */
|
||||
{"bulk_operations", &export_vars.innodb_bulk_operations, SHOW_SIZE_T},
|
||||
|
||||
{NullS, NullS, SHOW_LONG}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -7355,6 +7355,7 @@ error_handling_drop_uncached:
|
|||
ut_d(dict_table_check_for_dup_indexes(user_table,
|
||||
CHECK_PARTIAL_OK));
|
||||
if (ctx->need_rebuild()) {
|
||||
export_vars.innodb_bulk_operations++;
|
||||
ctx->new_table->acquire();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -713,7 +713,10 @@ struct export_var_t{
|
|||
operations*/
|
||||
|
||||
/** Number of instant ALTER TABLE operations that affect columns */
|
||||
ulong innodb_instant_alter_column;
|
||||
Atomic_counter<ulint> innodb_instant_alter_column;
|
||||
|
||||
/* Number of InnoDB bulk operations */
|
||||
Atomic_counter<ulint> innodb_bulk_operations;
|
||||
|
||||
ulint innodb_onlineddl_rowlog_rows; /*!< Online alter rows */
|
||||
ulint innodb_onlineddl_rowlog_pct_used; /*!< Online alter percentage
|
||||
|
|
|
|||
|
|
@ -2749,6 +2749,7 @@ err_exit:
|
|||
#else /* BTR_CUR_HASH_ADAPT */
|
||||
index->table->bulk_trx_id = trx->id;
|
||||
#endif /* BTR_CUR_HASH_ADAPT */
|
||||
export_vars.innodb_bulk_operations++;
|
||||
}
|
||||
|
||||
trx->bulk_insert = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue