in reply to Combined SQL Queries (e.g., EXCEPT) and DBIx::Class
'Fast' means that it is definitely not slower than than the variant with subqueries, and it can be better optimized by the server.SELECT i.* FROM items AS i LEFT JOIN mapping AS m ON (m.item_id = i.item_id AND m.container_id= +1) WHERE m.container_id IS NULL
Generally, any EXCEPT statements can be rewritten using subqueries and often even using simple JOINs. Try this way :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Combined SQL Queries (e.g., EXCEPT) and DBIx::Class
by jgallagher (Pilgrim) on Jul 26, 2006 at 22:08 UTC | |
by Ieronim (Friar) on Jul 26, 2006 at 22:32 UTC |