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