Maison >base de données >tutoriel mysql >MySQL优化之数据库结构:数据对象优化_MySQL
bitsCN.com
mysql> desc statistics_news_category_history;+---------------+-------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+---------------+-------------+------+-----+---------+----------------+| id | int(10) | NO | PRI | NULL | auto_increment | | news_category | varchar(20) | YES | | NULL | | | news_num | int(10) | YES | | NULL | | | news_date | varchar(10) | YES | | NULL | | +---------------+-------------+------+-----+---------+----------------+4 rows in set (0.00 sec)
mysql> select * from statistics_news_category_history procedure analyse(9,256)/G;*************************** 1. row *************************** Field_name: datacrawldb.statistics_news_category_history.id Min_value: 26 Max_value: 30 Min_length: 2 Max_length: 2 Empties_or_zeros: 0 Nulls: 0Avg_value_or_avg_length: 28.0000 Std: 1.4142 Optimal_fieldtype: TINYINT(2) UNSIGNED NOT NULL*************************** 2. row *************************** Field_name: datacrawldb.statistics_news_category_history.news_category Min_value: bigdata Max_value: test Min_length: 4 Max_length: 10 Empties_or_zeros: 0 Nulls: 0Avg_value_or_avg_length: 6.6000 Std: NULL Optimal_fieldtype: ENUM('bigdata','cloud','datacenter','storage','test') NOT NULL*************************** 3. row *************************** Field_name: datacrawldb.statistics_news_category_history.news_num Min_value: 1 Max_value: 33 Min_length: 1 Max_length: 2 Empties_or_zeros: 0 Nulls: 0Avg_value_or_avg_length: 19.4000 Std: 11.9766 Optimal_fieldtype: TINYINT(2) UNSIGNED NOT NULL*************************** 4. row *************************** Field_name: datacrawldb.statistics_news_category_history.news_date Min_value: 2014-02-17 Max_value: 2014-02-17 Min_length: 10 Max_length: 10 Empties_or_zeros: 0 Nulls: 0Avg_value_or_avg_length: 10.0000 Std: NULL Optimal_fieldtype: ENUM('2014-02-17') NOT NULL4 rows in set (0.00 sec)