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

Commit 3bff300

Browse files
committed
Add rows_sent tracking to analyze_statement_digest()
1 parent 56c88ac commit 3bff300

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

procedures/analyze_statement_digest.sql

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ BEGIN
135135
lock_time BIGINT,
136136
errors BIGINT,
137137
mysql_errno BIGINT,
138+
rows_sent BIGINT,
138139
rows_affected BIGINT,
139140
rows_examined BIGINT,
140141
created_tmp_tables BIGINT,
@@ -168,7 +169,7 @@ BEGIN
168169

169170
INSERT IGNORE INTO stmt_trace
170171
SELECT thread_id, timer_start, event_id, sql_text, timer_wait, lock_time, errors, mysql_errno,
171-
rows_affected, rows_examined, created_tmp_tables, created_tmp_disk_tables, no_index_used
172+
rows_sent, rows_affected, rows_examined, created_tmp_tables, created_tmp_disk_tables, no_index_used
172173
FROM performance_schema.events_statements_history_long
173174
WHERE digest = in_digest;
174175

@@ -191,7 +192,8 @@ BEGIN
191192
SELECT COUNT(*) executions,
192193
format_time(SUM(timer_wait)) AS exec_time,
193194
format_time(SUM(lock_time)) AS lock_time,
194-
SUM(rows_affected) AS rows_sent,
195+
SUM(rows_sent) AS rows_sent,
196+
SUM(rows_affected) AS rows_affected,
195197
SUM(rows_examined) AS rows_examined,
196198
SUM(created_tmp_tables) AS tmp_tables,
197199
SUM(no_index_used) AS full_scans
@@ -209,7 +211,8 @@ BEGIN
209211
SELECT thread_id,
210212
format_time(timer_wait) AS exec_time,
211213
format_time(lock_time) AS lock_time,
212-
rows_affected AS rows_sent,
214+
rows_sent,
215+
rows_affected,
213216
rows_examined,
214217
created_tmp_tables AS tmp_tables,
215218
no_index_used AS full_scan

0 commit comments

Comments
 (0)