What is the diffrence between IN and EXISTS.which one is
faster.
Answers were Sorted based on User's Feedback
Answer / neha
In the in clause, the inner query is executed first, hence if the inner query return less data than the outer query, then use IN clause, in the other scenario, user exists clause.
Also, in the exists clause the inner query always reference outer query's table, which may or may not be the case with in IN clause.
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / rashmi
> we use IN gives better performance when there is less number of record in a table (up to 999 records), But for large number records EXIST give better performance.
>In may or may not depends a sub query all time, But EXIST always depend on a sub query.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / manoranjan sethy
Exist operator always faster then In operator.
because assume that we gave value like in(10) then what is does? it will search my entire table and wherever 10 is found it will return as output.
but in exist operator if 10 found then optimizer will stop the searching process that is how exist gives more performance.
ii) In operator all ways conduct pattern search process but exist conduction boolean state of search process.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is a record in pl/sql?
what is the difference between a web-garden and a web-farm? : Sql dba
How to select the Nth maximum salary from Table Emp in Oracle SQL Plus ?
What are the two virtual tables available at the time of database trigger execution?
What is clustered and non-clustered indexes?
What packages(if any) has oracle provided for use by developers?
Explain raise_application_error.
wirte a query to filter improper date format follwing table? date 20-apr 22-may-2010 26-jun-2010 feb-2009 i want the output date 22-may-2010 26-jun-2010
how can i read write files from pl/sql
what is a trigger? : Sql dba
How to get the 3rd column(i.e all the data along with the column name)in a table?
what are set operators in sql? : Sql dba
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)