开发者

Nvarchar perform better than varchar?

开发者 https://www.devze.com 2023-03-10 11:47 出处:网络
I am really surprisde to see that in my MS SQL table, I am defining a field varchar and doing group by with another table\'s field.

I am really surprisde to see that in my MS SQL table, I am defining a field varchar and doing group by with another table's field.

When I do the same thing with the column as nvarchar it is 3 second faster than varchar when, theoretically, varchar should be faster because of 1 byte char.

Can anyone explain me why nvarc开发者_如何学运维har is faster in this instance?

Thanks in advance.


Operating systems use Unicode internally. I think that makes nvarchar faster since it does not need any converting.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号