How do you optimize SQL queries ?
Answer Posted / hutashan
Avoid implicit datatype conversion
Avoid using function on an indexed column
Avoid comparing column value with NULL
Outer Join
Use OR carefully
Always use NOT EXISTS instead of NOT IN
Use UNION ALL whenever possible (no implicit sorts)
UNION will sort the result set for each SELECT before
combining the final result set
Remove DISTINCT keyword from SELECT if UNION is used
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Which sql most popular?
What is view explain with example?
Do stored procedures prevent sql injection?
How we can create a table in pl/sql block. Insert records into it? Is it possible by some procedure or function? Please give example?
What are field types?
What is clustered and nonclustered index in sql?
What are the various levels of constraints?
Does oracle use sql?
What is the difference between nested table and varray?
Why having clause is used in sql?
What are primary key and foreign key and how they work?
What does closing a cursor do?
Can you inner join the same table?
what are date and time data types? : Sql dba
what are the advantages of using stored procedures? : Sql dba