Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    The extremely Royal borough of Kensington, London

    Unanswered: IN / EXISTS Computed for every row


    I would just like to know if the subquery of IN / EXISTS is RE-computed for every row in the outer query when the sub-query is independent of the outer. If this is so, would there still be much of a performance issue between this and JOIN.

    Two 10x10 tables using join cross product would be 100 rows scanned, where as IN / EXISTS computed for each outer row is also 100 rows searched. Although there is a difference what do other people know.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  2. #2
    Join Date
    Sep 2002
    Provided Answers: 1

    Re: IN / EXISTS Computed for every row

    If the sub-query is not correlated to the main query then it will normally be executed only once. However, any query that uses EXISTS normally is correlated, because it checks for existence of something matching the current row of the main query.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts