QuestionQ130

Performance

Question Image

Examine the following query:

Question Image

What information does this query return?

  • A total memory used across all connections associated with the user on connection number 10
  • B total memory used by the first 10 connections
  • C total memory used by thread number 10
  • D total memory used across all connections associated with the user on thread number 10
  • E total memory used by connection number 10
  • F total memory used by the first 10 threads
Explanation

memory_summary_by_thread_by_event_name contains current memory usage summarized for each thread and memory event. CURRENT_NUMBER_OF_BYTES_USED is the size of currently allocated memory, and summing it across the matching event rows yields the total for that thread. threads.PROCESSLIST_ID is the same identifier displayed as the connection Id by SHOW PROCESSLIST; filtering it to 10 therefore reports total memory used by connection number 10.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!