MYSQ query optimizer

Source: Internet
Author: User

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.











Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.