What is the difference between IN and Exists in Oracle?

Answer Posted / pankaj

In sql server,

WHEN YOU USE 'IN', WHILE CHECKING FOR WHERE CONDITION SQL SERVER ENGINE DOES WHOLE TABLE SCAN. IF YOU USE 'EXISTS' AS SOON AS ENGINE FINDS THE REQUIRED ROW IT WILL STOP EXECUTING QUERY AND GOING FURTHER SCANNING TABLE.

In Oracle,
EXISTS is very faster than IN (when the subquery results is very large)

IN is faster than EXISTS (when the subquery results is very small)

In Example -
select ename from emp
where mgr in (select empno from emp where ename = 'KING');

Exists Example -
Select ename from emp a where exists ( select 0/null from emp b where a.mgr=b.empno and ename='KING')

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you increase the performance in joiner transformation?

713


How do you load only null records into target?

742


What is joiner transformation in informatica?

629


Explain sessions and how many types of sessions are there?

586


Is it possible to use a client with different version than that of its Informatica server?

645






What are the conditions needed to improve the performance of informatica aggregator transformation?

585


What is Session and Batches?

666


TELL ME ONE COMPLEX MAPPING IN UR PROJECT? chandumba2005@gmai.com

1466


How to update a particular record in target with out running whole workflow?

1161


What is a shortcut and copy in Informatica and how two are different with each other?

688


What is resilience time?

655


write a query to retrieve the latest records from the table sorted by version(scd)

635


Tell me any other tools for scheduling purpose other than workflow manager pmcmd?

742


How many number of sessions can one group in batches?

696


Difference between Target-based loading and constraint-based loading?

555