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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 which type of index?

Author  Topic 

sql777
Constraint Violating Yak Guru

314 Posts

Posted - 2005-06-08 : 22:19:59
Hi,

I have a table with a Identity PK (1,1). Most of my lookups are using a string PageName VARCHAR(255).

What sort of index should I put on this field? (it is a unique value also)

sql777
Constraint Violating Yak Guru

314 Posts

Posted - 2005-06-08 : 22:24:51
Ok I just put a index on it (non-clustered).

within seconds the operations went from taking 2 minutes to literally 2-3 seconds!
Go to Top of Page

nathans
Aged Yak Warrior

938 Posts

Posted - 2005-06-09 : 18:37:11
yes, indexes are pretty kewl. You've seen their impact on performace, now undestand why.

get with Graz:

http://www.databasejournal.com/features/mssql/article.php/1467801

http://www.sqlteam.com/filtertopics.asp?topicID=163
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-06-09 : 18:39:21
My vote would be to add a clustered index on PageName, so the PK would be non-clustered. But we'd need to some queries to decide for sure.

Tara
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-06-09 : 19:32:29
What is your query to search this column? Are you searching for a single row, or many rows?

Is this being used for lookups for a Web application or for reports?

That's a very big index if your data is really 255 characters wide. How many rows do you have and expect to have in this table?

If this column is your primary lookup on this table, Tara's suggestion of making the index on this column clustered would be a good way to go, and would save a lot of apace.

What is the DLL and Query for this table?





CODO ERGO SUM
Go to Top of Page
   

- Advertisement -