November 13, 2013 at 2:12 pm
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!
November 13, 2013 at 2:57 pm
What's the reason for the CAST conversion?
It seems like o.invoiceid is already a character data type. What exact data type are the two columns referenced in the join predicate (o.invoiceid and t.invoicedid)? What does the actual execution plan look like?
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy