John A DAVIS wrote:
left join where item in right table is null

That's still going to look at all records in both tables:

1) so it can work out if there is a match from table 1 to table 2
2) so it can then remember to display any records that don't have a match

I was thinking more that if you have something like this:

select * from table1 where id not in (select id from table2);

The db might take that and turn it into:

select * from table1 where id not in (id1,id2,id3);

But it doesn't really matter.

Either way you end up with full table or index scans (depending on the db and engine you are using if mysql) of both table1 and table2.

myisam tables might just be able to use an index to do this sort of work, innodb will have to do a table scan because it's mvcc (as will postgres and others).

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to