| 1 |
SET GLOBAL innodb_stats_persistent_sample_pages=17; |
| 2 |
CREATE TABLE test_ps_sample_pages_used ( |
| 3 |
a VARCHAR(512), PRIMARY KEY (a) |
| 4 |
) ENGINE=INNODB STATS_SAMPLE_PAGES=default; |
| 5 |
BEGIN; |
| 6 |
COMMIT; |
| 7 |
ANALYZE TABLE test_ps_sample_pages_used; |
| 8 |
Table Op Msg_type Msg_text |
| 9 |
test.test_ps_sample_pages_used analyze status OK |
| 10 |
SELECT stat_name, stat_value FROM mysql.innodb_index_stats |
| 11 |
WHERE table_name='test_ps_sample_pages_used' AND stat_name='n_leaf_pages'; |
| 12 |
stat_name stat_value |
| 13 |
n_leaf_pages 37 |
| 14 |
SELECT sample_size FROM mysql.innodb_index_stats |
| 15 |
WHERE table_name='test_ps_sample_pages_used' AND stat_name='n_diff_pfx01'; |
| 16 |
sample_size |
| 17 |
17 |
| 18 |
ALTER TABLE test_ps_sample_pages_used STATS_SAMPLE_PAGES=14; |
| 19 |
ANALYZE TABLE test_ps_sample_pages_used; |
| 20 |
Table Op Msg_type Msg_text |
| 21 |
test.test_ps_sample_pages_used analyze status OK |
| 22 |
SELECT sample_size FROM mysql.innodb_index_stats |
| 23 |
WHERE table_name='test_ps_sample_pages_used' AND stat_name='n_diff_pfx01'; |
| 24 |
sample_size |
| 25 |
14 |
| 26 |
DROP TABLE test_ps_sample_pages_used; |
| 27 |
SET GLOBAL innodb_stats_persistent_sample_pages=default; |