Nvarchar perform better than varchar?

99封情书 提交于 2019-12-07 16:47:11

问题


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 nvarchar is faster in this instance?

Thanks in advance.


回答1:


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



来源:https://stackoverflow.com/questions/6250728/nvarchar-perform-better-than-varchar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!