[MDEV-32281] EXAMINED_ROWS is not populated in information_schema.processlist upon SELECT Created: 2023-09-28  Updated: 2023-12-15

Status: Stalled
Project: MariaDB Server
Component/s: Information Schema
Affects Version/s: 10.4, 10.5, 10.6, 10.10, 10.11, 11.0, 11.1
Fix Version/s: 10.4, 10.5, 10.6, 10.11, 11.0, 11.1

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Michael Widenius
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-3953 Add columns for ROWS_EXAMINED & ROWS_... Closed

 Description   

The test case is not suitable for the regression suite, don't push it as is, create a deterministic one instead!

--source include/have_sequence.inc
 
--connect(con1,localhost,root,,)
--send
  select * from seq_1_to_10000000 where seq%1000000 = 0;
 
--connection default
--let $run= 10
while ($run)
{
  --sleep 1
  query_vertical select * from information_schema.processlist where id != connection_id();
  --dec $run
}
 
--connection con1
--reap

10.4 9b5275b8

select * from information_schema.processlist where id != connection_id();
ID	5
USER	root
HOST	localhost
DB	test
COMMAND	Query
TIME	10
STATE	Sending data
INFO	select * from seq_1_to_10000000 where seq%1000000 = 0
TIME_MS	10031.634
STAGE	0
MAX_STAGE	0
PROGRESS	0.000
MEMORY_USED	106424
MAX_MEMORY_USED	106424
EXAMINED_ROWS	0
QUERY_ID	23
INFO_BINARY	select * from seq_1_to_10000000 where seq%1000000 = 0
TID	2218428
connection con1;
seq
1000000
2000000
3000000
4000000
5000000
6000000
7000000
8000000
9000000
10000000

Reproducible on all existing versions.



 Comments   
Comment by Elena Stepanova [ 2023-09-28 ]

DELETE shows EXAMINED_ROWS.

Comment by Michael Widenius [ 2023-10-21 ]

The reason for 'examined_rows' not getting updated is that we update the number not on each row read but at end of query. (this is for efficiency)

Fixing this is a possible, but is a notable patch as all current accounting has to be changed

Comment by Michael Widenius [ 2023-10-22 ]

Fixed by keeping THD always up to date with examined_rows and sent_rows.

Generated at Thu Feb 08 10:30:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.