Prepare for your Next Interview
This is a discussion on IN operator in Oracle SQL within the SQL forums, part of the Databases category; Hi, I have one doubts in using the IN operator in the subquery from the performance point of view. If I use the IN operator, somebody is saying that it ...
|
|||
|
IN operator in Oracle SQL
Hi,
I have one doubts in using the IN operator in the subquery from the performance point of view. If I use the IN operator, somebody is saying that it should not be used, instead exists operator can be used. Please let me know if any body knows that why we should not use IN operator Thanks in advance Regards, Saravanan.P |
| Sponsored Links |
|
|||
|
Re: IN operator in Oracle SQL
Quote:
IN or EXISTS which gives better performance depends upon the situation. While using IN , optimizer runs subquery first and then joins it with main dataset. Table in the subqery is small and table in the main query is large then IN usaully makes sense. Using EXISTS, optimizer runs main query first and then applies dataset to the subquery. If the main table size is small and subquery table size is large then EXISTS usually makes sense. But in general IN is slower as the sub query need to be resolved before it can be tested where as Exists fire off the equivalent query as soon as single row is returned. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Java templates, operator overloading | ansahahmed | OOPS | 0 | 03-03-2008 02:06 PM |
| C++ Operator Overloading Part II | Lokesh M | C and C++ | 1 | 12-28-2007 02:21 AM |
| Using LIKE operator in multiple condition | Sant_parkash | SQL | 4 | 11-29-2007 02:47 AM |
| Operator OverLoading Code | vinodjallapally | Java | 1 | 08-31-2007 07:45 AM |
| Operator Overloading | sripri | C and C++ | 2 | 12-11-2006 10:12 AM |