[MDEV-6398] ANALYZE UPDATE does not populate r_rows Created: 2014-06-26  Updated: 2014-10-17  Resolved: 2014-06-26

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: N/A
Fix Version/s: 10.1.0

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: analyze-stmt

Issue Links:
Relates
relates to MDEV-406 ANALYZE $stmt Closed

 Description   

In the example below, UPDATE modifies 4 rows, status confirms there were 5 reads, and r_filtered in the plan is 100%, but r_rows is NULL. It does not look right.

MariaDB [test]> create table t1 (i int);
Query OK, 0 rows affected (0.66 sec)
 
MariaDB [test]> insert into t1 values (1),(2),(3),(4);
Query OK, 4 rows affected (0.08 sec)
Records: 4  Duplicates: 0  Warnings: 0

MariaDB [test]> flush status;
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [test]> analyze update t1 set i=8;
+------+-------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------+
| id   | select_type | table | type | possible_keys | key  | key_len | ref  | rows | r_rows | filtered | r_filtered | Extra |
+------+-------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------+
|    1 | SIMPLE      | t1    | ALL  | NULL          | NULL | NULL    | NULL |    4 |   NULL |   100.00 |     100.00 |       |
+------+-------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------+
1 row in set (0.08 sec)

MariaDB [test]> show status like 'Handler_read%';
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| Handler_read_first       | 0     |
| Handler_read_key         | 0     |
| Handler_read_last        | 0     |
| Handler_read_next        | 0     |
| Handler_read_prev        | 0     |
| Handler_read_rnd         | 0     |
| Handler_read_rnd_deleted | 0     |
| Handler_read_rnd_next    | 5     |
+--------------------------+-------+
8 rows in set (0.00 sec)

Branch: 10.1
commit 12d6f89b073351169e070355e8db363d0d649749
Author: Sergei Petrunia <psergey@askmonty.org>
Date:   Thu Jun 26 15:55:25 2014 +0400


Generated at Thu Feb 08 07:11:36 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.