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
 Which index to use?

Author  Topic 

dextrous
Starting Member

15 Posts

Posted - 2010-01-09 : 00:58:44
Hello,

This question is in relation to zipcodes and indexing. I have a database of zip+4 connected to cities (about 24 million rows). I have a cluster index over the zip+4.

When my program retrieves data, it is much faster when it retrieves the earlier numbers (which even to a newbie like me makes sense since it comes up first) and takes 2-3 times longer if the zip is say, 99999-9999.

I created views (5) on the index to divide it up but the problem seems to persist.

Any ideas on what might be the most efficient way to index zipcodes?

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-01-09 : 01:12:43
show the DDL and the Queries Also, set statistics io on and show us the results of that too.
Go to Top of Page

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2010-01-09 : 06:53:34
As well as information requested, consider usinng a non-clustered index - particuarly if selectivity is high - which would mean the data is relatively unique. But this is dependant on whatr type of query you are making. For example , if the zip codes are linked to cities - would I be right in thinking these are quite random seaeches?

Jack Vamvas
--------------------
http://www.ITjobfeed.com
Go to Top of Page
   

- Advertisement -