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