14.1.1 Benefits of Using InnoDB Tables

You may find InnoDB tables beneficial for the following reasons:
您可能會發現InnoDB表有以下好處:

  • If your server crashes because of a hardware or software issue, regardless of what was happening in the database at the time, you don't need to do anything special after restarting the database. InnoDB crash recovery automatically finalizes any changes that were committed before the time of the crash, and undoes any changes that were in process but not committed. Just restart and continue where you left off.
  • 如果你的服務器因爲軟件或硬件的問題崩潰了,無論當時數據庫中發生了什麼情況,數據庫重新啓動後你不需要做任何特殊的操作,InnoDB崩潰恢復自動完成崩潰前提交的任何更改,也會回滾任何未提交的數據,這樣重啓之後就可以在崩潰的時間點上繼續進行服務
  • The InnoDB storage engine maintains its own buffer pool that caches table and index data in main memory as data is accessed. Frequently used data is processed directly from memory. This cache applies to many types of information and speeds up processing. On dedicated database servers, up to 80% of physical memory is often assigned to the InnoDB buffer pool.
  • innodb存儲引擎有它自己的緩衝池,當數據被訪問時,它可以在主內存中緩存表和索引數據。,經常使用的數據直接從內存中處理,此緩存適用於多種類型的信息, 並加快了處理速度,在專門的數據庫服務器上面,高達80%的物理內存通常被分配到InnoDB緩衝池
  • If you split up related data into different tables, you can set up foreign keys that enforce referential integrity. Update or delete data, and the related data in other tables is updated or deleted automatically. Try to insert data into a secondary table without corresponding data in the primary table, and the bad data gets kicked out automatically.
  • 如果將相關數據拆分爲不同的表,你可以使用外鍵來強制數據的完整性,在對數據進行update或者delete的時候,其他表裏關聯的數據也會自動進行update或delete,如嘗試將數據插入到輔助表中, 而不在主表中輸入相應的數據,這種壞數據會自動被剔除
  • If data becomes corrupted on disk or in memory, a checksum mechanism alerts you to the bogus data before you use it.
  • 如果硬盤上或內存中的數據損壞了,一個叫做checksum的機制會在你使用它之前對你進行警告
  • When you design your database with appropriate primary key columns for each table, operations involving those columns are automatically optimized. It is very fast to reference the primary key columns in WHERE clauses, ORDER BYclauses, GROUP BY clauses, and join operations.
  • 在爲每個表設計相應的主鍵列時, 將自動優化涉及這些列的操作,在 WHERE 子句, ORDER BY子句, GROUP BY 子句和join操作的時候引用到了主鍵都是非常快的
  • Inserts, updates, and deletes are optimized by an automatic mechanism called change buffering. InnoDB not only allows concurrent read and write access to the same table, it caches changed data to streamline disk I/O.
  • inserts.updtes.deletes的優化是基於一個叫change buffering的自動機制來實現的,InnoDB 不允許對同一個表進行併發讀寫訪問,它緩存已更改的數據以簡化磁盤I/O。
  • Performance benefits are not limited to giant tables with long-running queries. When the same rows are accessed over and over from a table, a feature called the Adaptive Hash Index takes over to make these lookups even faster, as if they came out of a hash table.
  • 性能的優化並不限定義大表的長時間查詢,當從表中訪問同一行時,一個稱爲自適應哈希索引的功能將接管以使這些查找速度更快, 就像它們從哈希表中出來一樣。
  • You can compress tables and associated indexes.
  • 你可以壓縮表和相關的索引
  • You can create and drop indexes with much less impact on performance and availability.
  • 您可以創建和刪除對性能和可用性影響更小的索引。
  • Truncating a file-per-table tablespace is very fast, and can free up disk space for the operating system to reuse, rather than freeing up space within the system tablespace that only InnoDB could reuse.
  • 截斷file-per-table表空間是非常快的,並能爲操作系統釋放磁盤空間以便重新使用,而不是在系統表空間中釋放只有InnoDB可以重用的空間。
  • The storage layout for table data is more efficient for BLOB and long text fields, with the DYNAMIC row format.
  • 使用DYNAMIC格式,使用blob和text類型的表數據分佈在存儲上分佈的更有效率
  • You can monitor the internal workings of the storage engine by querying INFORMATION_SCHEMA tables.
  • 你可以通過查詢infromation_schema下面的表來監控存儲引擎內部的工作情況
  • You can monitor the performance details of the storage engine by querying Performance Schema tables.
  • 你可以通過查詢Performance Schema下面的表來監控存儲引擎的性能細節
  • You can freely mix InnoDB tables with tables from other MySQL storage engines, even within the same statement. For example, you can use a join operation to combine data from InnoDB and MEMORY tables in a single query.
  • 你可以自由地混合InnoDB表與其他MySQL存儲引擎的表,即使是在同一個語句中,例如,你可以在一個查詢中使用join操作來查出來自innodb表和memory表的結果集
  • InnoDB has been designed for CPU efficiency and maximum performance when processing large data volumes.
  • 在處理大數據時,innodb已經設計了CPU的效率和最大的性能
  • InnoDB tables can handle large quantities of data, even on operating systems where file size is limited to 2GB.
  • InnoDB表可以處理大量的數據,即使在文件大小限制爲2GB的操作系統上
    For InnoDB-specific tuning techniques you can apply in your application code, see Section 8.5, “Optimizing for InnoDB Tables”.
    關於適用於應用程序代碼的innodb特定的調優技術,請看Section 8.5, “Optimizing for InnoDB Tables”.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章