Before starting get a clear understanding and quantitative definition of the issue.
Below are some points to be considered for oracle SQL performance tuning .
- Check for the explain plan, Check for the cost and number of rows that are being fetched.
- Do not include ' * ' in select statements.
- Only select the columns which you need in the query
- Use filters in "WHERE" conditions to restrict the size of the data set.
- Remove unnecessary JOINS.
- Use UNION ALL in case of UNION, Because UNION will perform extra sort operations.
- Avoid the use of IN condition in select statements.
- Avoid the use of the DISTINCT keyword.
- Always use an alias for table names
- If possible use EXISTS in subqueries, it will stop the search when it finds the match.
- Do not use indexes to tables that undergo more UPDATE or INSERT operations as indexes can slow down the performance in such cases.
- Avoid using VIEWS.
- Don't mix data types and do not convert numbers to characters.
- In some scenarios, we can create a new field rather than performing the calculation on JOIN or WHERE clause.
- Use GLOBAL Temporary tables(GTT), Whenever possible to simplify complication summarization quaries.
- Using of Hints, Hints allows to alter execution plans and force various approhes.
No comments:
Post a Comment