In a nutshell..
SELECT *
FROM tbl1
LEFT OUTER JOIN tbl2 ON tbl1.ID = tbl2.externalRefID
WHERE tbl1.varref = '12345' OR tbl2.varref = '12345';
With any volume of data in these tables this query takes forever. Yet I need the second table outer joined as it won't often match on the externalRefID. Indexes created for all columns that are referenced but makes no difference as I need an index across multiple tables (is that possible?)
this must be obvious but i can't see the wood for the trees...