|
Home > Archive > MS SQL Server > July 2005 > int vs varchar Index ??
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
int vs varchar Index ??
|
|
|
| Is it quicker to retrieve data from an index on integer column than a varchar
column? If so could someone be able to point me right direction why is that
so?
Thanks in advance
Regards,
Amar
| |
|
|
|
| Generally, more data means the server has to perform more reads to scan the
entire index, reading data means sifting through index pages locating the
needed rows, so for instance an int index will take up only 1/10 of a
char(40) index, therefore the server only has to perform 10% of the reads
needed for the char(40) index, resulting in 10 times faster performance for
this particular example. Appart from that the CPU MAY under some
circumstances work more efficiently when working with int's rather than chars
"Amar" skrev:
> Is it quicker to retrieve data from an index on integer column than a varchar
> column? If so could someone be able to point me right direction why is that
> so?
>
>
> Thanks in advance
>
> Regards,
> Amar
|
|
|
|
|