在MySQL(Azure)上查询Information_Schema花费的时间太长

问题描述 投票:0回答:1

问题正在从MySql读取信息架构...太慢:

步骤:

1. MySql dump created manually by scripting all objects from existing
   MySql db which is on AWS. (MySql Version 5.7)
2. Restored dump file on to Azure MySql (Version 5.7)
3. Re-pointed Application (Appian) which sits on AWS to newly created MySql db on Azure.
4. When tried to validate Application (Appian) Objects (Data Stores), which reads `Information_Schema` takes too long or gets timed out.
5. But reading data from the tables are faster.

根据检查的建议innodb_stats_on_metadata,将其设置为OFF。

仍然没有运气!有什么建议吗?

经过一番调查后发现以下查询是缓慢的查询。

SHOW FULL TABLES FROM `database` LIKE 'xyz'

大多数时候,它的工作是'checking permissions'

mysql amazon-web-services information-schema azure-mysql-database appian
1个回答
0
投票

Microsoft的回复:

在产品工程确认后,Azure MySQL 5.7上的[[Command show full tables]比预期的慢。每次测试,当只有1个连接线程和1500个表时,将需要800毫秒才能完成;当存储更多表和并行连接时,响应时间将相应增加。

关于此问题,有两种可能的方法我们现在可以尝试:

  1. [保持使用MySQL 5.7,下一个版本(2020年1月结束),可以通过将1500个表,1个线程的响应时间减少到50ms来缓解此问题。
  2. 运行show full tables时,切换为8.0的MySQL 8.0版本没有“列出所有目录”之类的操作。当前8.0正在发布预览中,暂定的GA也在2020年1月结束。
© www.soinside.com 2019 - 2024. All rights reserved.