Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
None
Description
InnoDB in MySQL 5.6 introduced persistent statistics, to help the optimizer choose query plans. The statistics are stored in two tables: mysql.innodb_index_stats and mysql.innodb_table_stats, using the InnoDB-internal SQL parser while holding an exclusive lock on the InnoDB data dictionary cache. This architecture involves a number of workarounds to locking problems. It could also break replication when users modify the statistics tables directly from SQL, because the internal transactions to modify the statistics tables are not replicated.
The natural place to store the statistics is within the data file. If there is a real need to tweak the statistics other than by running ANALYZE TABLE, then an external tool could be written for that.
Attachments
Issue Links
- blocks
-
MDEV-11633 Make the InnoDB system tablespace optional
-
- Open
-
-
MDEV-11655 Transactional data dictionary
-
- Open
-
-
MDEV-24579 Error table->get_ref_count() after update to 10.5.8
-
- Closed
-
-
MDEV-29883 Deadlock between InnoDB statistics update and BLOB insert
-
- Closed
-
- is duplicated by
-
MDEV-24632 MariaDB 10.3.27 crash on windows
-
- Closed
-
-
SAMU-278 Loading...
- relates to
-
MDEV-19556 Support native storage engine sampling of rows
-
- Open
-
-
MDEV-23670 Crash during OPTIMIZE TABLE mysql.innodb_table_stats
-
- Closed
-
-
MDEV-29883 Deadlock between InnoDB statistics update and BLOB insert
-
- Closed
-
-
MDEV-31979 Assertion `!internal' failed in void trx_t::free()
-
- Open
-
-
MDEV-33993 Possible server hang on DROP INDEX or RENAME INDEX
-
- Closed
-
-
MDEV-11658 Simpler, faster IMPORT of InnoDB tables
-
- Open
-
-
MDEV-13360 too long values in mysql.innodb_table_stats.table_name
-
- Stalled
-
-
MDEV-14583 innodb.innodb-index-online failed in buildbot
-
- Closed
-
-
MDEV-14941 Timeouts on persistent statistics tables caused by MDEV-14511
-
- Closed
-
-
MDEV-18381 Server crashes in ha_innobase::store_lock upon concurrent ALTER and TRUNCATE
-
- Closed
-
-
MDEV-30707 MariaDB can'T be stopped
-
- Closed
-
-
MDEV-35811 main.mysqldump-system fails with extra entries in innodb_index_stats
-
- Open
-
- links to
Activity
Field | Original Value | New Value |
---|---|---|
Link | This issue relates to MDEV-11658 [ MDEV-11658 ] |
Link |
This issue relates to |
Link | This issue blocks MDEV-11655 [ MDEV-11655 ] |
Summary | Store index statistics within the .ibd file | Store persistent statistics within the .ibd file |
Link |
This issue relates to |
Link | This issue relates to MDEV-13360 [ MDEV-13360 ] |
Fix Version/s | N/A [ 14700 ] |
Link | This issue blocks MDEV-11633 [ MDEV-11633 ] |
Parent | MDEV-11633 [ 59463 ] | |
Affects Version/s | 10.2 [ 14601 ] | |
Affects Version/s | 10.0 [ 16000 ] | |
Affects Version/s | 10.1 [ 16100 ] | |
Affects Version/s | 10.3 [ 22126 ] | |
Affects Version/s | 10.4 [ 22408 ] | |
Issue Type | Technical task [ 7 ] | Task [ 3 ] |
Component/s | Optimizer [ 10200 ] | |
Summary | Store persistent statistics within the .ibd file | Remove InnoDB persistent statistics, or store them within the .ibd file |
Remote Link | This issue links to "MySQL Bug #83079 long semaphore wait often resulting in crash, DICT_SYS mutex held by statistics (Web Link)" [ 29411 ] |
Labels | performance replication statistics | hang performance replication statistics upstream |
Assignee | Marko Mäkelä [ marko ] | Sergei Petrunia [ psergey ] |
Summary | Remove InnoDB persistent statistics, or store them within the .ibd file | Remove InnoDB persistent statistics dependency on InnoDB internal SQL parser |
Fix Version/s | N/A [ 14700 ] |
Fix Version/s | N/A [ 14700 ] |
Link |
This issue blocks |
Priority | Major [ 3 ] | Critical [ 2 ] |
Fix Version/s | 10.6 [ 24028 ] |
Link | This issue is blocked by MDEV-19556 [ MDEV-19556 ] |
Link |
This issue blocks |
Link |
This issue blocks |
Link |
This issue relates to |
Issue Type | Task [ 3 ] | Bug [ 1 ] |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] |
Priority | Critical [ 2 ] | Major [ 3 ] |
Priority | Major [ 3 ] | Critical [ 2 ] |
Link |
This issue blocks |
Link |
This issue blocks |
Link | This issue relates to MDEV-19556 [ MDEV-19556 ] |
Link | This issue is blocked by MDEV-19556 [ MDEV-19556 ] |
Assignee | Sergei Petrunia [ psergey ] | Marko Mäkelä [ marko ] |
Summary | Remove InnoDB persistent statistics dependency on InnoDB internal SQL parser | Server hangs due to InnoDB persistent statistics or innodb_stats_auto_recalc |
Fix Version/s | 10.6.5 [ 26034 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 84986 ] | MariaDB v4 [ 153613 ] |
Link |
This issue relates to |
Link |
This issue blocks |
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue is duplicated by |
Link | This issue relates to MDEV-31979 [ MDEV-31979 ] |
Remote Link | This issue links to "Page (MariaDB Confluence)" [ 36672 ] |
Remote Link | This issue links to "Page (MariaDB Confluence)" [ 36697 ] |
Remote Link | This issue links to "Page (MariaDB Confluence)" [ 36697 ] |
Link |
This issue relates to |
Zendesk Related Tickets | 201658 140713 175975 | |
Zendesk active tickets | 201658 |
Link | This issue relates to MDEV-35811 [ MDEV-35811 ] |
Remote Link | This issue links to "SAMU-278 (Jira)" [ 37295 ] |
Remote Link | This issue links to "Page (MariaDB Confluence)" [ 37296 ] |
Should we decide to keep using transactions for updating the statistics, there are some work-in-progress patches attached to
MDEV-14941.However, I think that it could make more sense to use only mini-transaction logging.
The .ibd file format change should also involve making the .ibd files self-contained with respect to metadata that is not stored in the SQL layer (a prerequisite for MDEV-11655). That is, we must store inside the .ibd file the root page number of each secondary index (and the location of the fulltext index files).