Nvarchar perform better than varchar?

2019-05-11 14:16发布

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条回答
不美不萌又怎样
2楼-- · 2019-05-11 15:08

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

查看更多
登录 后发表回答