Can any one tell me how to increase the performance of a
sql query ie what are the performance tips in creating or
writing a sql query !!?

Answers were Sorted based on User's Feedback



Can any one tell me how to increase the performance of a sql query ie what are the performance tip..

Answer / manoj

1.
Use proper sequence of tables in from clause
i.e.
the table have more common column must in last
in form clause bcoz on firing of query engine link
last table in form clause
2.
Use "Exist" clause instead of "Not in"
Bcoz it return only true/false(boolean)

3.
Use "Hint" if Required

Is This Answer Correct ?    6 Yes 0 No

Can any one tell me how to increase the performance of a sql query ie what are the performance tip..

Answer / sathishrpillai

Hii..
for optimization of sql query
1.don't use select * from,choose particular fields itself
2.don't use both OR ,AND in same query
3.Minimise the use of aggreagate functions such sum,count
4.don't link unneccessary tables

Is This Answer Correct ?    5 Yes 2 No

Can any one tell me how to increase the performance of a sql query ie what are the performance tip..

Answer / hutashan

use Inline view to eleminate large number of rows
Avoid implicit datatype conversion
Avoid using function on an indexed column
Avoid comparing column value with NULL
Outer Join
Use OR carefully

Do not use outer join unless absolutely necessary. Degree
of optimizing outer join permutation is VERY LIMITED
Instead: Consider using default values in the base table to
avoid outer join
Do not outer join to a view. This typically results in a
non-mergable view execution plan
Always use NOT EXISTS instead of NOT IN


Remove DISTINCT keyword from SELECT if UNION is used

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

write a procedure to find top second no from a list of numbers

1 Answers   ABC,


What are all the different types of indexes?

0 Answers  


Can primary key be changed?

0 Answers  


Can we insert data into view?

0 Answers  


Is natural join same as inner join?

0 Answers  






What are the sql commands?

0 Answers  


How many joins can you have in sql?

0 Answers  


Why is there a need for sqlcode and sqlerrm variables?

0 Answers  


what is a database lock ? : Sql dba

0 Answers  


What are the default Oracle triggers??

3 Answers   CGI, Tech Mahindra,


What will be the output of the following String S = 1+2+"abc" S = ? String S1 = 1+2+"abc"+5+6 S1 = ?

1 Answers   ABC,


What is sequence in sql?

0 Answers  


Categories