EXISTS subquery optimization

2005-09-14 Thread Matthias Pigulla
Hi all, the manual says: "If a subquery returns any rows at all, then EXISTS subquery is TRUE, and NOT EXISTS subquery is FALSE. ... Traditionally, an EXISTS subquery starts with SELECT *, but it could begin with SELECT 5 or SELECT column1 or anything at all. MySQL ignores the SELECT list in such

unexpected EXPLAIN result with subselect

2005-09-14 Thread Matthias Pigulla
Hi all, can someone explain me why this query gets executed the way it is? I simplified it as much as possible and think it's a conceptual/logical thing, so I'll omit - at least for now - the table definitions and sample data for brevity. -- "Superquery" EXPLAIN SELECT t1.id, t1.name FROM documen