Bug #87065 Release lock on table statistics after query plan created
Submitted: 13 Jul 2017 18:49 Modified: 6 Jun 2018 14:38
Reporter: Sveta Smirnova (OCA) Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version:5.7.18, 5.6.36 OS:Any
Assigned to: CPU Architecture:Any

[13 Jul 2017 18:49] Sveta Smirnova
Under concurrent environment running ANALYZE TABLE could lead to situation when hundreds of tables are in state "Waiting for table flush".

How to repeat:
Read https://www.percona.com/blog/2013/02/27/mysql-optimizer-analyze-table-and-waiting-for-tabl...

Suggested fix:
Implement new type of lock which holds statistics only and release it immediately after Optimizer creates execution plan.
[6 Jun 2018 14:38] MySQL Verification Team
HI Sveta,

Thank you for your report.

I consider this as a very positive and beneficial feature request.

[4 Dec 2020 14:19] Viktor Chernov
Hi, Dear MySQL Developers!

Are there any chances to prioritize this ticket? Our production bases are loaded 24/7 and every time we run the ANALYZE it locks the tables for several hours.

P.S. Looks like Percona engineers have created the fix two years ago - https://www.percona.com/blog/2018/03/27/analyze-table-is-no-longer-a-blocking-operation/
[4 Dec 2020 14:28] MySQL Verification Team

It has been considered as a feature for some 8.0 release, but no decision has been made yet. Also, these decisions are made on the level to which we do not have any access.