@@ -435,16 +435,16 @@ p i a
435
435
4 3 zzzz
436
436
update t1 set p=3 where p=1;
437
437
update t2 set i=2 where i=1;
438
- show status like 'key_%';
439
- Variable_name Value
440
- Key_blocks_not_flushed 0
441
- Key_blocks_unused KEY_BLOCKS_UNUSED
442
- Key_blocks_used 4
443
- Key_blocks_warm 0
444
- Key_read_requests 22
445
- Key_reads 0
446
- Key_write_requests 26
447
- Key_writes 6
438
+ select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused ';
439
+ VARIABLE_NAME VARIABLE_VALUE
440
+ KEY_BLOCKS_NOT_FLUSHED 0
441
+ KEY_BLOCKS_USED 4
442
+ KEY_BLOCKS_WARM 0
443
+ KEY_READ_REQUESTS 22
444
+ KEY_READS 0
445
+ KEY_WRITE_REQUESTS 26
446
+ KEY_WRITES 6
447
+ select variable_value into @key_blocks_unused from information_schema.session_status where variable_name = 'Key_blocks_unused';
448
448
select * from information_schema.key_caches where segment_number is null;
449
449
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
450
450
default NULL NULL 2097152 1024 4 # 0 22 0 26 6
@@ -483,16 +483,18 @@ p i a
483
483
4 3 zzzz
484
484
update t1 set p=3 where p=1;
485
485
update t2 set i=2 where i=1;
486
- show status like 'key_%';
487
- Variable_name Value
488
- Key_blocks_not_flushed 0
489
- Key_blocks_unused KEY_BLOCKS_UNUSED
490
- Key_blocks_used 4
491
- Key_blocks_warm 0
492
- Key_read_requests 22
493
- Key_reads 0
494
- Key_write_requests 26
495
- Key_writes 6
486
+ select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused';
487
+ VARIABLE_NAME VARIABLE_VALUE
488
+ KEY_BLOCKS_NOT_FLUSHED 0
489
+ KEY_BLOCKS_USED 4
490
+ KEY_BLOCKS_WARM 0
491
+ KEY_READ_REQUESTS 22
492
+ KEY_READS 0
493
+ KEY_WRITE_REQUESTS 26
494
+ KEY_WRITES 6
495
+ select variable_value < @key_blocks_unused from information_schema.session_status where variable_name = 'Key_blocks_unused';
496
+ variable_value < @key_blocks_unused
497
+ 1
496
498
select * from information_schema.key_caches where segment_number is null;
497
499
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
498
500
default 2 NULL 2097152 1024 4 # 0 22 0 26 6
@@ -526,16 +528,18 @@ p i a
526
528
4 3 zzzz
527
529
update t1 set p=3 where p=1;
528
530
update t2 set i=2 where i=1;
529
- show status like 'key_%';
530
- Variable_name Value
531
- Key_blocks_not_flushed 0
532
- Key_blocks_unused KEY_BLOCKS_UNUSED
533
- Key_blocks_used 4
534
- Key_blocks_warm 0
535
- Key_read_requests 22
536
- Key_reads 0
537
- Key_write_requests 26
538
- Key_writes 6
531
+ select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused';
532
+ VARIABLE_NAME VARIABLE_VALUE
533
+ KEY_BLOCKS_NOT_FLUSHED 0
534
+ KEY_BLOCKS_USED 4
535
+ KEY_BLOCKS_WARM 0
536
+ KEY_READ_REQUESTS 22
537
+ KEY_READS 0
538
+ KEY_WRITE_REQUESTS 26
539
+ KEY_WRITES 6
540
+ select variable_value = @key_blocks_unused from information_schema.session_status where variable_name = 'Key_blocks_unused';
541
+ variable_value = @key_blocks_unused
542
+ 1
539
543
select * from information_schema.key_caches where segment_number is null;
540
544
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
541
545
default 1 NULL 2097152 1024 4 # 0 22 0 26 6
0 commit comments