国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

mysql中的analyze與optimize表

2019-11-08 20:35:59
字體:
來源:轉載
供稿:網友

analyze表分析和存儲表的鍵值分布,MySQL使用存儲的鍵值分布來決定當進行連接的順序,也會決定查詢中使用哪個索引。 默認情況下會把analyze table的語句寫入到二進制日志中去。 analyze復雜度 ANALYZE TABLE complexity for InnoDB tables is dependent on:

The number of pages sampled, as defined by innodb_stats_persistent_sample_pages.

The number of indexed columns in a table

The number of partitions. If a table has no partitions, the number of partitions is considered to be 1.

Using these parameters, an apPRoximate formula for estimating ANALYZE TABLE complexity would be:

The value of innodb_stats_persistent_sample_pages * number of indexed columns in a table * the number of partitions

Typically, the greater the resulting value, the greater the execution time for ANALYZE TABLE.

optimize table是重新組織表和相關索引的物理存儲的。為了減少存儲空間和提高io效率。在下面的情況考慮使用: After doing substantial insert, update, or delete Operations on an InnoDB table that has its own .ibd file because it was created with the innodb_file_per_table option enabled. The table and indexes are reorganized, and disk space can be reclaimed for use by the operating system.

After doing substantial insert, update, or delete operations on columns that are part of a FULLTEXT index in an InnoDB table. Set the configuration option innodb_optimize_fulltext_only=1 first. To keep the index maintenance period to a reasonable time, set the innodb_ft_num_Word_optimize option to specify how many words to update in the search index, and run a sequence of OPTIMIZE TABLE statements until the search index is fully updated.

After deleting a large part of a MyISAM or ARCHIVE table, or making many changes to a MyISAM or ARCHIVE table with variable-length rows (tables that have VARCHAR, VARBINARY, BLOB, or TEXT columns). Deleted rows are maintained in a linked list and subsequent INSERT operations reuse old row positions. You can use OPTIMIZE TABLE to reclaim the unused space and to defragment the data file. After extensive changes to a table, this statement may also improve performance of statements that use the table, sometimes significantly.


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 巴彦淖尔市| 武乡县| 松溪县| 北川| 石阡县| 常州市| 汕头市| 宿松县| 土默特左旗| 介休市| 饶河县| 焦作市| 正定县| 同心县| 内丘县| 阿坝县| 新巴尔虎右旗| 惠东县| 曲阳县| 江安县| 开阳县| 巧家县| 荥阳市| 贵定县| 遂平县| 延吉市| 四平市| 桂平市| 金塔县| 来安县| 岱山县| 屏南县| 正安县| 襄垣县| 保定市| 常宁市| 白朗县| 阿克| 松江区| 民县| 洮南市|