From: Date: April 16 2008 12:30am Subject: Re: select does too much work to find rows where primary key does not match List-Archive: http://lists.mysql.com/mysql/212303 Message-Id: <200804152230.m3FMUu3O023318@mx.swagman.com> > I would have thought your not = though is matching a lot more rows every time.. The field is UNIQUE PRIMARY KEY in both tables, so there should be 0 or 1 matches. > I would look into using where not exists as a subselect My MySQL book (O'Reilly second edition) does not mention subqueries or EXISTS. I am reading about it online now. > delete from bar where not exists (select 'y' from foo where foo.phone = bar.phone); > > something like that. Thanks, I'll give it a try.