Rows_examined can be reset for sub queries

Bug #807198 reported by Eric Bergen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
New
Undecided
Michael Widenius

Bug Description

Rows_examined in the slow query log can be reset by the outer query when using a sub query. For these two queries the first one sets Rows_examined correctly but the second one has it reset even though the row stats work correctly.

# Time: 110702 9:44:23
# User@Host: [ebergen] @ localhost []
# Thread_id: 1 Schema: test QC_hit: No
# Query_time: 1.396374 Lock_time: 0.000093 Rows_sent: 1 Rows_examined: 677984
# Row_Stats: test:rows_read=677984,rows_changed=0,rows_changed_x_indexes=0;
# Index_Stats: test:rows_read=677984;
SET timestamp=1309625063;
select count(*) from t2;

# Time: 110702 9:44:49
# User@Host: [ebergen] @ localhost []
# Thread_id: 1 Schema: test QC_hit: No
# Query_time: 2.262701 Lock_time: 0.000126 Rows_sent: 1 Rows_examined: 0
# Row_Stats: test:rows_read=677984,rows_changed=0,rows_changed_x_indexes=0;#temp#:rows_read=0,rows_changed=677984,rows_changed_x_indexes=677984;
# Index_Stats: test:rows_read=677984;
SET timestamp=1309625089;
select count(*) from (select 1 from t2) as t;

The table I'm using looks like:
CREATE TABLE `t2` (
  `t` bigint(20) DEFAULT NULL,
  `u` bigint(20) DEFAULT NULL,
  `b` text,
  KEY `t` (`t`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1

Changed in maria:
assignee: nobody → Michael Widenius (monty)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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