Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 performance difference of numeric and string

Author  Topic 

meera3112
Starting Member

1 Post

Posted - 2014-09-15 : 23:18:32
hello everyone,
I have one question what is performance difference between cluster index on numeric field or string field?
I know that numeric is faster but why it is faster?

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2014-09-16 : 00:36:22
That's really not the criteria to create CI.
Usually, you should create CI for the fields which are most used in the WHERE clause, may it be Numeric or String.

Usually CI is build on integer columns because they are used as key columns. As a side effect, an INT column usually consumes less bytes than a big Varchar column, as a result accomodating more rows per index page. However, that may not be always true. For example, if there is a Varchar column of length as 3, it takes less storage space than INT.

In a nutshell, creating CI is all about how your queries are built and not about a column's data type.

Harsh Athalye
http://www.letsgeek.net/
Go to Top of Page
   

- Advertisement -