mysql_stat中条目的含义是什么?

时间:2012-08-20 09:48:19

标签: php mysql statistics

我在PHP中调用了函数mysql_stat(),它给了我以下结果:

  • 正常运行时间:7733455
  • 主题:1
  • 问题:2218231
  • 慢查询:1552
  • 开放时间:14989
  • 同花表:1
  • 打开表格:6
  • 每秒查询数:0.287

我在6天前创建了数据库,但是uptime建议,这是近90天前(或者这是服务器的最后一次重启?)

查询beeing slow query的阈值是什么?

我可以以某种方式检查,哪些查询哪个慢?

如果我的数据库中只有3个表,那么open Tables如何才能为6?

条目ThreadsOpensFlush tables的含义是什么?

是否可以重置统计信息?

2 个答案:

答案 0 :(得分:6)

由于PHP DOCS使用mysql延期,因此不建议使用mysqli。请改用 o Uptime The number of seconds the MySQL server has been running. o Threads The number of active threads (clients). o Questions The number of questions (queries) from clients since the server was started. o Slow queries The number of queries that have taken more than long_query_time seconds. (MySQL DOSC "The Slow Query Log" section). o Opens The number of tables the server has opened. o Flush tables The number of flush-*, refresh, and reload commands the server has executed. o Open tables The number of tables that currently are open. o Memory in use The amount of memory allocated directly by mysqld. This value is displayed only when MySQL has been compiled with safemalloc, which is available only before MySQL 5.5.6. o Maximum memory used The maximum amount of memory allocated directly by mysqld. This value is displayed only when MySQL has been compiled with safemalloc, which is available only before MySQL 5.5.6.

字段的含义:

#> mysqladmin flush-host

要重置此值,请在mysql服务器终端中使用{{1}}。

答案 1 :(得分:2)

如果您的网站托管在共享托管中,那么该信息可能来自多个数据库,而不仅仅是您的! :)