I have a sql similar to the following:

select * from table a, table b
where a.pk = b.fk
and (a.code = 'X' and b.val > 1)
or (a.code = 'Y' and b.val < 1)

When I do the explain plan with the last line in there, I get full table scans. Why??


Is there a good book on how to tune up SQL and understanding the explain plan?

Thanks,

Paul