国产探花免费观看_亚洲丰满少妇自慰呻吟_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.


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 黄冈市| 沈阳市| 安泽县| 鹿泉市| 沈丘县| 孟村| 平山县| 永春县| 井研县| 锡林郭勒盟| 阿坝| 林口县| 宝清县| 托克托县| 唐河县| 阳朔县| 玉山县| 繁昌县| 绥江县| 新乡市| 岢岚县| 丰城市| 黄大仙区| 盐源县| 崇礼县| 高青县| 乌兰县| 寿阳县| 宜阳县| 田东县| 廉江市| 碌曲县| 岢岚县| 宝鸡市| 芦山县| 沈丘县| 巩留县| 两当县| 克拉玛依市| 扬中市| 济源市|