I am having an issue with a query causing Index scan and poor performance:
Here is an example of what I am doing:
SELECT orderid
FROM table1 o inner join table2 t
On CAST(o.invoiceid as char(10) = t.invoicedid
Where o.invoiceid = '123456'
How can I make the join searchable and or how to eliminate table scan?
Thank you so much!