Add INFORMATION_SCHEMA table for time spent in different thread statuses

Bug #589487 reported by Baron Schwartz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Won't Fix
Wishlist
Unassigned
5.5
Triaged
Medium
Unassigned

Bug Description

SHOW PROFILES is great, but the most interesting thing is the timing data -- all the un-implemented functionality for other things is not necessary. I also don't like that it uses getrusage() which is inaccurate (only centisecond-level, and implemented by polling) and too expensive.

I propose an INFORMATION_SCHEMA table with global and session counters for the time spent in each thread status. It should also count the number of times that status was entered and exited. This will make it quite obvious when a particular status, such as "Statistics" or "Copying to tmp table," suddenly begins consuming more time than usual, or being entered more than usual. I propose that you should be able to do the following:

SELECT * FROM INFORMATION_SCHEMA.SESSION_THREAD_STATUS;
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_THREAD_STATUS;

and you'd get something like this:

+-------------------------------+------------+----------+
| Status | Count_Star | SUM_Time |
+-------------------------------+------------+----------+
| Statistics | 5 | 0.001 |
| Copying to tmp table | 11 | 0.238 |
| Waiting for query cache mutex | 1818 | 58.112 |
+-------------------------------+------------+----------+

This data would also be extremely good for building Cacti graphs!

Tags: fr

Related branches

affects: percona-patches → percona-server
Changed in percona-server:
importance: Undecided → Wishlist
status: New → Triaged
tags: added: fr
Revision history for this message
Vadim Tkachenko (vadim-tk) wrote :

There is patch from Xiaobin for this feature

Changed in percona-server:
status: Triaged → Won't Fix
Revision history for this message
Vadim Tkachenko (vadim-tk) wrote :

Assigned to Alexey to review patch

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-2309

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.