Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Need Help comprehending datatype chart.

$
0
0
Regarding this article:
https://www.sqlskills.com/blogs/jonathan/implicit-conversions-that-cause-index-scans/
It has a colored chart showing which implicit conversions can succeed without forfeiting index seeks.

Obviously I'm not comprehending the color chart because, to me, the results look self-contradictory. Green  means 'Seek'  and Yellow means 'Scan'. Now here's a section of the chart, I'll use words instead of colors.

.............varchar......nvarchar
varchar....Seek........Scan
nvarchar..Seek........SEEK

Okay so here's what I see.  With varchar vs. varchar we get a seek (obviously).  And likewise with nvarchar vs nvarchar we get a seek (obviously).

Now here's the apparent contradiction. On the top right it shows 'scan' (varchar vs. nvarchar). But on the bottom left, which is nvarchar vs varchar, we get a 'seek'?

Why would these two comparisons have different results?
nvarchar vs. varchar - scan?
varchar vs. nvarchar - seek?

What am I missing here? Does this have something to do with datatype precedence?  Could someone please explain.



Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>