Ask a questionAsk a question
 

AnswerDifference in exits and inlist

  • Saturday, October 17, 2009 10:33 AMmanjil44 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,

    Tell me the difference between using exists and using in list in queries. Which one will work faster?

Answers

  • Saturday, October 17, 2009 7:09 PMOlaf Helper Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    ____ manjil44,

    in common an EXISTS query has a better performance the a IN () query.
    But both are solve into a JOIN operation; the say what is better you have to take a look at the execution plan of the queries.
    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de

All Replies

  • Saturday, October 17, 2009 7:09 PMOlaf Helper Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    ____ manjil44,

    in common an EXISTS query has a better performance the a IN () query.
    But both are solve into a JOIN operation; the say what is better you have to take a look at the execution plan of the queries.
    Olaf Helper ----------- * cogito ergo sum * errare humanum est * quote erat demonstrandum * Wenn ich denke, ist das ein Fehler und das beweise ich täglich http://olafhelper.over-blog.de