if I do
select *
from table1
where table1.col1 = 'xx'
and table1.col2 = 'yy'
and table1.col3= 'zz'`
the execution plan shows full table scan. The indexes on this table exist for col4 and col5. Do I need to set an index on each one of col1,col2,col3 to make the query perform better?
Also if the query is like this:
select *
from table1,table2
where table1.col1=table2.col2
and table1.col2 = 'yy'
and table1.col3= 'zz'
If we create an index on col1 and col2, will it suffice?