Consider the following situation
(1) If your data table to manage 40 million video information;
(2) If you manage 10 million kinds of product data sheets;
A simple paging query, you truly feel its efficiency over it? If users complain about slow response to your management system, in addition to open architecture, design, should also look at your sql.
Steps】 【Oracle Sql
SQL statements SQL statement execution steps of a process to go through the following steps.
A grammatical analysis of sentence syntax is compliant.
2 Semantic analysis of inspection statement of all database objects related to the existence of, and the user has the appropriate permissions.
3 view transformation will involve the view query is converted to the corresponding query the base table.
4 expression is converted to a complex SQL expression into a simpler expression equivalent connection.
5 Select a different optimizer optimizer generally have different "implementation plan"
6 Select the connection method to connect Oracle There are three ways to connect Oracle on multiple tables select the appropriate connection.
7 Select the connection order of the multi-table joins Oracle will choose the first link on the table, select the two tables in which the table as the source data table.
8 Select the data search path according to the above conditions select the appropriate data in the search path, so use full table search or use the index or other ways.
9 run "implementation plan"
a. RULE (rule) b. COST (based on cost)
】 【Oracle implementation plan
View the execution plan: pl / sql: (1) sql query window, press F5 (2) New Explain Plan Window
Under the implementation plan can be adjusted sql, analysis of consumption of resources, time, and find more optimized sql
(1) to do computing in the data table field can not effectively use the index
(2) with <>,!=, is not null, is null, can not effectively use the Index
(3) default CBO case! = And or the use of the same,
More differences can watch at work to see, there is always rewarding
】 【Sql optimization