MySQL query optimization from start to run (iii) basic operation of the query

Source: Internet
Author: User
Tags joins mysql query mysql query optimization
basic operations for queries    1. The selection action corresponds to a constraint, and the Action object is a row of a two-dimensional table. Optimization mode: Select the operation of the push purpose: Minimize the number of yuan rental before the connection operation, so that the intermediate temporary relationship as small as possible (less than the number of tuples, the number of tuples to be connected) benefits: This may reduce IO and CPU consumption, save memory space 2. Projection Operations The purpose of the use of the Select Query Column object Optimization method: Projection Operation push the goal: Minimize the number of columns before the connection operation, so that the intermediate temporary relationship as small as possible (the selection operation is to make the number of tuples as few as possible, the projection operation is to make a tuple as little as possible) benefits: Although not reduced IO (most database storage , tuples are the most basic units of reading, so you have to read a row of data to manipulate the columns, but you can reduce the size of the tuple of the connected intermediate relationships and save memory space.     3. is the connection operation optimized? The answer is no doubt 1. The order in which each table is connected in a multi-table connection determines the efficiency of 2. Multiple table connections the order in which each table is concatenated is determined by user semantics (inner joins, left joins in outer joins, etc.) the 2 types of queries are based on the form characteristics of SQL statements, You can also make the following distinctions: 1. Query optimization for SPJ (e.g. three basic operations on appeal) 2. For non-SPJ query optimization (Group by, etc.) Note: From the next start to explain the logical query optimization and physical query optimization, these are the priority of database query optimization!!!

MySQL query optimization from start to run (iii) basic operation of the query

Related Article

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.