3

I was routinely reviewing the slow log on one of my MySQL replication servers and found that the most common slow query was SHOW GLOBAL STATUS running at an average of 914s.

I already know why it is there (a monitoring probe is generating the request), my question is why is it taking so long to run?

The server is running MySQL Server 5.0.95.

Robin
  • 495
  • 1
  • 5
  • 18

1 Answers1

2

SHOW GLOBAL STATUS reads from a table called INFORMATION_SCHEMA.GLOBAL_VARIABLES which, being a MEMORY table, requires a full table lock on update.

If there is an operation in progress which would alter a global variable, SHOW GLOBAL STATUS would have to wait for this operation to complete.

Quassnoi
  • 413,100
  • 91
  • 616
  • 614