Hello,
I was able to duplicate the following sequence in both
4.0.14-max and 4.0.16. It happens in all my tables. I do not understand
why the cardinality for the date_created field does not = 223284.
mysql> select count(distinct date_created) from POSTING ;
+------------------------------+
| count(distinct date_created) |
+------------------------------+
| 223284 |
+------------------------------+
1 row in set (2.48 sec)
mysql> analyze table POSTING ;
+---------------+---------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+---------------+---------+----------+----------+
| TRIBE.POSTING | analyze | status | OK |
+---------------+---------+----------+----------+
1 row in set (16.74 sec)
mysql> show index from POSTING ;
+---------+------------+----------------------------+--------------+--------
--------+-----------+-------------+----------+--------+------+------------+-
--------+
| Table | Non_unique | Key_name | Seq_in_index |
Column_name | Collation | Cardinality | Sub_part | Packed | Null |
Index_type | Comment |
+---------+------------+----------------------------+--------------+--------
--------+-----------+-------------+----------+--------+------+------------+-
--------+
| POSTING | 0 | PRIMARY | 1 | ID
| A | 228383 | NULL | NULL | | BTREE |
|
| POSTING | 1 | posting_id_idx | 1 | ID
| A | 228383 | NULL | NULL | | BTREE |
|
| POSTING | 1 | posting_owner_id_idx | 1 |
OWNER_ID | A | 6010 | NULL | NULL | | BTREE
| |
| POSTING | 1 | posting_parent_id_idx | 1 |
PARENT_ID | A | 114191 | NULL | NULL | YES | BTREE
| |
| POSTING | 1 | posting_thread_id_idx | 1 |
THREAD_ID | A | 45676 | NULL | NULL | YES | BTREE
| |
| POSTING | 1 | posting_from_person_id_idx | 1 |
FROM_PERSON_ID | A | 9929 | NULL | NULL | | BTREE
| |
| POSTING | 1 | posting_date_created | 1 |
DATE_CREATED | A | 228383 | NULL | NULL | YES | BTREE
| |
| POSTING | 1 | posting_is_deleted_idx | 1 |
IS_DELETED | A | 1 | NULL | NULL | | BTREE
| |
+---------+------------+----------------------------+--------------+--------
--------+-----------+-------------+----------+--------+------+------------+-
--------+
8 rows in set (0.00 sec)
mysql> select count(distinct date_created) from POSTING ;
+------------------------------+
| count(distinct date_created) |
+------------------------------+
| 223284 |
Thanks,
Trevor