R_User
R_User

Reputation: 11082

What is the meaning of entries from mysql_stat?

I called the function mysql_stat() in PHP, which gave me the following result:

I created the database 6 days ago, but the uptime suggests, that it was nearly 90 days ago (or is this the last restart of the server?)

What is the threshold for a query beeing slow query?

Can I somehow check, which queries where slow?

How can open Tables be 6, if I only have 3 Tables in my database?

What is the meaning of the entries Threads, Opens and Flush tables?

Is it possible to reset the statistics?

Upvotes: 2

Views: 2420

Answers (2)

s.webbandit
s.webbandit

Reputation: 17000

Due to PHP DOCS use of mysql extension is discouraged. Use mysqli instead.

Meanings of fields:

   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.

To reset this values use #> mysqladmin flush-host in your mysql server terminal.

Upvotes: 7

Mariana
Mariana

Reputation: 21

If your site is hosted in a shared hosting, that info might come from several databases, not only yours! :)

Upvotes: 2

Related Questions