MySQL Forums
Forum List  »  Optimizer & Parser

(How) are subqueries optimized involving the same table?
Posted by: Jakobus Dornier
Date: July 13, 2006 08:02AM

Hi,

I couldn't find this in the docs:

In a query like

SELECT
foo,
(SELECT field1 FROM t2 WHERE t2.id = 123),
(SELECT field2 FROM t2 WHERE t2.id = 123),
(SELECT field3 FROM t2 WHERE t2.id = 123)
FROM
t1 WHERE id = 7;

--> does mysql have to access the table "t2" three times?

Thank you in advance for any advie.
Jay

Options: ReplyQuote




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.