MySQL Forums
Forum List  »  Performance

Misinterpreting Subquery as Correlated
Posted by: Rob Williams
Date: January 03, 2006 04:53PM

I have a query that computes scores for a bunch of questions. Turns out I need to limit the questions that are being scored to questions that were asked at a particular location. So I think, this is 2m. I sit down and write subquery that references the same tables, but as different instances, and it still sees it as correlated and drifts off into the weeds.

If I do this:

SELECT T.blah
FROM Table T
WHERE T.ID IN (SELECT T2.ID FROM Table T2 WHERE T2.yada = true)

is that a correlated subquery? Yes it references the same table, but the inner query can definitely be evaluated just once.

Thanks,
Rob



Edited 1 time(s). Last edit at 01/03/2006 04:54PM by Rob Williams.

Options: ReplyQuote


Subject
Views
Written By
Posted
Misinterpreting Subquery as Correlated
1694
January 03, 2006 04:53PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.