Premature optimization is the root of all evil in databases. Design with sanity in mind and then show us when you get into a problem. Rather than answering this question I am going to explain why it cannot be answered.
SQL is a declarative language, where you provide something kind of like a mathematical formula to the database system and it figures out how to run it optimally. Well, technically the query is a mathematical formula but the math mirrors SQL and SQL approximates another field of mathematics known as relational algebra.
The actual optimization process depends highly on read and write patterns, as well as the limitations of knowledge of the planner. Until you have an actual bottleneck there is no way of assessing the relative performance of one query over another, unless you do certain things not present in your example (NOT EXISTS
tends to be expensive and one tends to do better to write it as an outer join and filtering against cases of an inner join rather than as an antijoin. Presumably this will be addressed in the future). Even there, there are plenty of cases where an anti-join won't make a big difference and where gains in performance may not be worth worrying about.
So the point is you need to wait until you have an actual problem before optimizing the queries. Optimizing storage is very different, however.
order by .. limit 1
is a terrible way to restrict the subquery to one row, if that was your intention) – joop Sep 27 '13 at 8:45