Hello DBA's i have also some question
- Why should we never run ANALYZE TABLE?
- How do I know for sure this table/db needs to be analyzed ? It seems that MySQL doesn't store when the last time "stat" was updated ?
Just for Example :- Assume i have queried
mysql> show index from goods;
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| goods | 0 | PRIMARY | 1 | id | A | 7765796 | NULL | NULL | | BTREE | | |
| goods | 1 | shop_id | 1 | shop_id | A | 14523 | NULL | NULL | | BTREE | | |
| goods | 1 | shop_id | 2 | create_date | A | 168168 | NULL | NULL | YES | BTREE | | |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
3 rows in set (0.00 sec)
So to see this output,how do i get to know for this table need to run analyze table command ?