Skip to content
Advertisement

optimization select distinct query

How can i optimize this query, how to rewrite a request through exists:

Advertisement

Answer

Please use ANSI style join syntax, first of all.

Now, Coming to your question, according to my knowledge NVL perform worse when working with large data sets.

So how can we achieve the same functionality? — We can use DECODE or CASE WHEN.

Among these two also, CASE WHEN will be better when it comes to performance.

Compare the execution plan of query mentioned in your question and the execution plan of the following query and you will definitely find the difference.

Please make sure that PKs and FKs are properly created and proper indexes are also available as indexes are created mainly for performance.

Cheers!!

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement