1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Addressed the following issues from the review of the patch:

1. The PERSISTENT FOR clause of the ANALYZE command overrides
the setting of the system variable use_stat_tables: 
with this clause ANALYZE unconditionally collects persistent
statistics.
2. ANALYZE collects persistent statistics only for tables of
the USER category. So it never collects persistent statistics
for system tables.
This commit is contained in:
Igor Babaev
2012-12-05 22:51:11 -08:00
parent 81563081e5
commit dd119466c3
6 changed files with 105 additions and 5 deletions

View File

@ -397,13 +397,38 @@ ANALYZE TABLE t1;
SELECT * FROM mysql.column_stats;
SELECT * FROM mysql.index_stats;
DROP TABLE t1,t2;
DELETE FROM mysql.table_stats;
DELETE FROM mysql.column_stats;
DELETE FROM mysql.index_stats;
ANALYZE TABLE mysql.column_stats PERSISTENT FOR ALL;
ANALYZE TABLE mysql.column_stats;
SELECT * FROM mysql.table_stats;
SELECT * FROM mysql.column_stats;
SELECT * FROM mysql.index_stats;
set use_stat_tables='never';
ANALYZE TABLE t1 PERSISTENT FOR ALL;
SELECT * FROM mysql.table_stats;
SELECT * FROM mysql.column_stats;
SELECT * FROM mysql.index_stats;
SELECT * FROM mysql.table_stats;
SELECT * FROM mysql.column_stats;
SELECT * FROM mysql.index_stats;
DELETE FROM mysql.table_stats;
DELETE FROM mysql.column_stats;
DELETE FROM mysql.index_stats;
set use_stat_tables='never';
DROP TABLE t1,t2;
set names utf8;