Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit 8be270a

Browse files
committed
It is posssible that statement or file IO instrumentation is disabled, so use LEFT JOIN in the user_summary views
1 parent 23397d1 commit 8be270a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

views/p_s/user_summary.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ SELECT accounts.user,
5454
SUM(accounts.total_connections) AS total_connections,
5555
COUNT(DISTINCT host) AS unique_hosts
5656
FROM performance_schema.accounts
57-
JOIN sys.x$user_summary_by_statement_latency AS stmt ON accounts.user = stmt.user
58-
JOIN sys.x$user_summary_by_file_io AS io ON accounts.user = io.user
57+
LEFT JOIN sys.x$user_summary_by_statement_latency AS stmt ON accounts.user = stmt.user
58+
LEFT JOIN sys.x$user_summary_by_file_io AS io ON accounts.user = io.user
5959
WHERE accounts.user IS NOT NULL
6060
GROUP BY accounts.user;
6161

@@ -100,7 +100,7 @@ SELECT accounts.user,
100100
SUM(accounts.total_connections) AS total_connections,
101101
COUNT(DISTINCT host) AS unique_hosts
102102
FROM performance_schema.accounts
103-
JOIN sys.x$user_summary_by_statement_latency AS stmt ON accounts.user = stmt.user
104-
JOIN sys.x$user_summary_by_file_io AS io ON accounts.user = io.user
103+
LEFT JOIN sys.x$user_summary_by_statement_latency AS stmt ON accounts.user = stmt.user
104+
LEFT JOIN sys.x$user_summary_by_file_io AS io ON accounts.user = io.user
105105
WHERE accounts.user IS NOT NULL
106106
GROUP BY accounts.user;

0 commit comments

Comments
 (0)