The execution speed of Several SQL statements in the project is relatively slow, so these SQL statements have been being optimized recently. It is very interesting in the optimization process, because every step
A little improvement may improve the execution efficiency. In this regard, I have also summarized some small experiences that are built on the orcle system.
Of:
1. When performing a joint query, make sure to estimate the data in the table and then determine the sequence of the table during the query.
2. determine the order of query conditions based on database parsing rules. Here, we recommend that you filter a large amount of data in a table from the very beginning.
2. When performing a query, it is best to directly operate on the table. Therefore, if the table and view perform a joint query, the view is generally split.
4. When performing a query, minimize the number of table accesses. For example, when performing a query, You need to associate the query multiple times.CodeTable, you can consider how to minimize
The number of queries is reduced.
5. For the use of Union and Union all, if you do not need to remove duplicates, try to use Union all. Because union has the deduplication function, the efficiency is relative.
Lower.
6. For query clauses using in, use exists instead.
7. Do not use sorting or other statements in subqueries.
All of the above are aimed at optimizing Oracle itself under certain Oracle configuration conditions.