The 1:MYSQ query optimizer uses a "select-projection-join" strategy to process the query by selecting (select Operations) based on the relevant restrictions to reduce the number of Ganso to be processed, and then projection (corresponding
The projection operation in relational algebra to reduce the number of attributes (fields) of the selected element Zuri, and finally to generate the final query results based on the join condition.
It uses the following rules:
* Horizontal exclusion of redundant data by calculating an expression in the WHERE clause
* Only the attributes (fields) that are listed in the Attribute (field) list, and those that need to be used when the join clause is last executed, all other data are excluded.
* Generate final query results based on join conditions
2: Caching and Buffers
2.1 Table Cache
Table caching is created to minimize the overhead of opening, reading, and closing tables (frm files on disk). Therefore, the main purpose of table caching is to keep metadata about the table in memory. This greatly speeds up the speed with which the thread reads table structure information without having to open the file every time.
2.2 Record caching
is created to speed up the sequential read performance of the storage engine. The record cache is used only during table scans. Record caching can greatly improve the performance of sequential read/write (referred to as the local domain), so it is usually used in conjunction with the MyISAM storage engine
2.3-Key caching
is actually a buffer for caching index data, the content of which is a block of data from the index file (b) tree, only the MyISAM table (on disk). Myi file) To use key caching, the index itself is encapsulated in the key-cache structure, which is stored as a linked list in memory.
2.4 Permission Cache
Authorization data for storing user accounts
2.5 Host Name cache
is another auxiliary caching mechanism, similar to the permissions cache.