【发布时间】:2012-09-16 00:52:10
【问题描述】:
在我安装 MySQL 并在其上导入一些数据库后,我的基于 debian 的启动速度非常慢。寻找一些声明,我在启动时找到了这个:
mysql> show full processlist;
+----+------------------+-----------+------+---------+------+----------------+----------------------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------------------+-----------+------+---------+------+----------------+----------------------------------------------------------------------+
| 9 | debian-sys-maint | localhost | NULL | Query | 12 | Opening tables | select count(*) into @discard from `information_schema`.`PARTITIONS` |
| 10 | root | localhost | NULL | Query | 0 | NULL | show full processlist |
+----+------------------+-----------+------+---------+------+----------------+----------------------------------------------------------------------+
2 rows in set (0.00 sec)
这里是造成麻烦的声明:
select count(*) into @discard from `information_schema`.`PARTITIONS`
我有 +-10 个数据库,总计超过 8GB 的数据。
是否有任何配置可以在系统启动时禁用此查询?如果是,为什么要在启动时运行它?
信息
我有一个没有自定义配置的标准 MySQL 安装。
最好的问候。
【问题讨论】:
-
如果您在问题中运行慢查询,您返回的执行时间是多少?计数的结果是什么? (即你有多少张桌子?)
-
嗨 Erik,查询结果是:'4955'(36.40 秒)
-
手动计数,所有数据库中的表总数为5000...此查询计算表数?我能做些什么来减少/停止这种情况?
标签: mysql linux configuration debian linux-mint