Bug #14243 Statistics on MySQL cluster
Submitted: 23 Oct 2005 19:45 Modified: 26 Dec 2006 16:33
Reporter: Yann Neuhaus Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.0 OS:Linux (Linux)
Assigned to: Assigned Account CPU Architecture:Any
Tags: 5.0.13
Triage: Triaged: D3 (Medium)

[23 Oct 2005 19:45] Yann Neuhaus
Description:
On a MySQL Server 5.0.13 an index is created on table located in the NDB storage engine (in our example countries). The cardinality of this index is directly available under INFORMATION_SCHEMA :

mysql> create index countries_country_id on countries(country_id);
Query OK, 19 rows affected (1.47 sec)
Records: 19  Duplicates: 0  Warnings: 0

mysql> use information_schema;
Database changed

mysql> select TABLE_NAME,INDEX_NAME,CARDINALITY from STATISTICS where TABLE_SCHEMA = 'NDBDB';
+------------+----------------------+-------------+
| TABLE_NAME | INDEX_NAME           | CARDINALITY |
+------------+----------------------+-------------+
| countries  | countries_country_id |          19 |
+------------+----------------------+-------------+
1 row in set (0.21 sec)

However on other MySQL servers using the same NDB cluster, the statistics for this index are not available which could of course have an impact on the performances of the MySQL server (Optimizer, SQL plans) :

mysql> select TABLE_NAME,CARDINALITY from STATISTICS where TABLE_SCHEMA = 'NDBDB';
Empty set (0.19 sec)

A restart of the other MySQL server is necessary which is DEFINITIVELY NOT A ACCEPTABLE PRODUCTION SITUATION.

Best Regards

Yann

How to repeat:
see above
[3 Feb 2006 14:56] Hartmut Holzgraefe
verified using 5.0.18