PROCEDURE ANALYSE 通过分析select查询结果对现有的表的每一列给出优化的建议
语法
SELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max_elements,[max_memory]])
比如
SELECT * FROM TABLE1 PROCEDURE ANALYSE(15,256)
解释
The arguments are optional and are used as follows:
-
max_elements
(default 256) is the maximum number of distinct values thatANALYSE()
notices per column. This is used byANALYSE()
to check whether the optimal data type should be of typeENUM
; if there are more thanmax_elements
distinct values, thenENUM
is not a suggested type. -
max_memory
(default 8192) is the maximum amount of memory thatANALYSE()
should allocate per column while trying to find all distinct values.