Hi,

Russell Uman wrote:

howdy.

i trying to find items in one table that don't exist in another.
i'm using a left join with a where clause to do it:

SELECT t1.field, t2.field FROM table1 t1 LEFT JOIN table2 t2 ON t1.word = t2.word WHERE t2.word IS NULL;

both tables are quite large and the query is quite slow.

the field column is indexed in both tables, and explain shows the indexes being used.

is there a better way to construct this kind of query?

That is the right way, but if you show us the exact output of EXPLAIN we can help more. In particular, does it say "Using distinct/not exists" in Extra?

Baron

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to