Bug #8725 Statistics wrong in explain
Submitted: 23 Feb 2005 11:35 Modified: 23 Feb 2005 12:04
Reporter: Johan Andersson Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:4.1.10 binary OS:Any (*)
Assigned to: Assigned Account CPU Architecture:Any

[23 Feb 2005 11:35] Johan Andersson
Description:
The explain output always say 1 row or 10 for the topmost in the explain output.

NDB:

+----+-------------+--------+------+-----------------------------------------+----------+---------+----------------------+------+------------------------------+
| id | select_type | table  | type | possible_keys                           | key      | key_len | ref                  | rows | Extra                        |
+----+-------------+--------+------+-----------------------------------------+----------+---------+----------------------+------+------------------------------+
|  1 | SIMPLE      | memb2  | ref  | PRIMARY,groupid,personid                | personid |       4 | const                |   10 | Using where; Using temporary |
|  1 | SIMPLE      | gg2    | ref  | PRIMARY,gchildid,groupid,gchild_gid     | gchildid |       4 | test.memb2.groupid   |    1 |                              |
|  1 | SIMPLE      | sacl   | ref  | PRIMARY,groupid,structid                | groupid  |       4 | test.gg2.groupid     |    1 | Using where                  |
|  1 | SIMPLE      | outree | ref  | PRIMARY,orgid,orgchild,prim_orgtree_ix2 | orgid    |       4 | test.sacl.structid   |    1 |                              |
|  1 | SIMPLE      | gg1    | ref  | PRIMARY,groupid                         | groupid  |       4 | test.outree.orgchild |    1 |                              |
+----+-------------+--------+------+-----------------------------------------+----------+---------+----------------------+------+------------------------------+

Corresponding in MyISAM:

| id | select_type | table  | type | possible_keys                           | key        | key_len | ref                   | rows | Extra                        |
+----+-------------+--------+------+-----------------------------------------+------------+---------+-----------------------+------+------------------------------+
|  1 | SIMPLE      | memb2  | ref  | PRIMARY,groupid,personid                | personid   |       4 | const                 |    5 | Using where; Using temporary |
|  1 | SIMPLE      | gg2    | ref  | PRIMARY,gchildid,groupid,gchild_gid     | gchild_gid |       4 | test2.memb2.groupid   |    1 | Using index                  |
|  1 | SIMPLE      | sacl   | ref  | PRIMARY,groupid,structid                | groupid    |       4 | test2.gg2.groupid     |    1 | Using where                  |
|  1 | SIMPLE      | outree | ref  | PRIMARY,orgid,orgchild,prim_orgtree_ix2 | orgid      |       4 | test2.sacl.structid   |    4 |                              |
|  1 | SIMPLE      | gg1    | ref  | PRIMARY,groupid                         | groupid    |       4 | test2.outree.orgchild |    1 |                              |
+----+-------------+--------+------+-----------------------------------------+------------+---------+-----------------------+------+------------------------------+

How to repeat:
see internal info
[23 Feb 2005 12:04] Jonas Oreland
This due to the fact that we don't support records_in_range
There is a worklog for this.

Even when we do, this number will be a guess.
[13 Mar 2014 13:33] Omer Barnir
This bug is not scheduled to be fixed at this time.