Thursday, April 19, 2007
Today at work we had a brief discussion about whether using an IN or an EXISTS is more performant.  There were a couple different opinions, although most thought that EXISTS was faster.  It turns out that like most things in our wonderful software world there is not clear cut answer.  In general the below holds true:
  • If the majority of the filtering criteria are in the subquery then the IN variation may be more performant.
  • If the majority of the filtering criteria are in the top query then the EXISTS variation may be more performant.
Source: http://www.oracle-base.com/articles/misc/EfficientSQLStatements.php#Exists and this.

I assume the same holds true for SQL Server, although we're less interested in that at the moment.

Friday, April 20, 2007 1:45:29 AM (Eastern Daylight Time, UTC-04:00) |  |  | #
Tracked by:
"Ecommerce Tips and Resources" (Ecommerce Tips and Resources) [Trackback]
"Shared Hosting Resources" (Shared Hosting Resources) [Trackback]
Search
Archive
Links
Categories
Admin Login
Sign In
Blogroll
Themes
Pick a theme: