Oracle Logbook

March 22, 2011

Exists and IN which is better?

Filed under: Uncategorized — Helio Dias @ 5:02 pm

Today I saw this question at: http://forums.oracle.com/forums/thread.jspa?messageID=9459258&#9459258

My answer was:

There are two major difference between IN and EXISTS

The first difference is about what table will be the driving table

The second and most important difference is that EXISTS is a bit more flexible, because even when you overuse EXISTS, most of the time , Oracle is smart enough to change it to a IN, So if you don´t understand very well the concept about driving table and execution path, use EXISTS.

Blog at WordPress.com.