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 2005 Forums
 Transact-SQL (2005)
 Query performance issue

Author  Topic 

aex
Yak Posting Veteran

60 Posts

Posted - 2007-06-13 : 23:37:13
Hi, I have a question regarding query performance issue. Quite some time before I've created a stored procedure to retrieve data from a table. The performance was good initially and it runs to bottleneck when the data in my table exceed 1 million rows. I have clustered this table on its primary key column, I am thinking is it possible to have another column indexed beside the indexing of my primary key columns. Also, I want to know if the extra column indexing is possible, what is the trade-off that I should expect if I do so?

Thanks in advance for any reply.

aex

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-06-13 : 23:42:46
Is the table updated a lot? How often do you rebuild index and/or update statistics on the table?
Go to Top of Page

pbguy
Constraint Violating Yak Guru

319 Posts

Posted - 2007-06-13 : 23:47:15
You can create many clusters on table which includes only one cluster index and rest can be non cluster..
First create a cluster index and then create non cluster index..creating more index will perform in a negative way..

check this link
http://www.microsoft.com/technet/community/chats/trans/sql/sql1014.mspx

--------------------------------------------------
S.Ahamed
Go to Top of Page

aex
Yak Posting Veteran

60 Posts

Posted - 2007-06-13 : 23:48:13
quote:
Originally posted by rmiao

Is the table updated a lot? How often do you rebuild index and/or update statistics on the table?



Ya, the table is updated (records insertion) everyday. Also, you give me an idea of rebuilding index and update statistics on the table. But what is that for? Do I need to rebuild database table as frequent possible? Or how about the update statistics, what is it meant for?

aex
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-06-13 : 23:57:58
Don't need rebuild table, those tasks will update data distribution info on the table so sql optimizer can build better query execution plan. Check related topics in books online.
Go to Top of Page

aex
Yak Posting Veteran

60 Posts

Posted - 2007-06-14 : 03:57:53
Thanks rmiao, i will go to refer to book online in order for me to ask a right question, because I still do not fully understand what those indexing are actually and which one should i use.

aex
Go to Top of Page
   

- Advertisement -