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 ??
Amar

2005-07-06, 7:23 am

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
Mike Epprecht (SQL MVP)

2005-07-06, 7:23 am

http://www.sql-server-performance.c...ing_indexes.asp
--
--------------------------------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland

MVP Program: http://www.microsoft.com/mvp

Blog: http://www.msmvps.com/epprecht/



"Amar" wrote:

> 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

sbt

2005-07-06, 7:23 am

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

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com