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.
Author |
Topic |
flumonion
Starting Member
4 Posts |
Posted - 2008-08-12 : 10:04:52
|
Hi, I am relatively new to MS SQL. I have the following issue:I have database with fairly large tables (+- 2m records). We originally had some stored procedures that were running slow. We changed the procedures and they are now running much faster, but the problem is when many people connect we are getting time out errors now. Where as before we did not.Thank youChris |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-08-12 : 14:19:13
|
What does SP do? |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-08-12 : 14:20:41
|
Show us the queries, the create table statements for the tables, and the indexes on those tables. Do you regularly defragment your indexes and update statistics?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
flumonion
Starting Member
4 Posts |
Posted - 2008-08-13 : 10:53:12
|
Hi Tara,I have never defragmented indexes and updated statsitics.How do i do this and does it make a big difference?The SP is fired from a ado connection that passes dynamic sql here would be an example:DECLARE @SQLString NVARCHAR(4000)SET @SQLString = N'SELECT COUNT(dbo.tblDO.doid) AS cnt FROM dbo.tblma_xy INNER JOIN dbo.tblDO ON dbo.tblma_xy.MA_ID = dbo.tblDO.MA_ID LEFT OUTER JOIN dbo.tblUserPropSearch ON dbo.tblDO.doID = dbo.tblUserPropSearch.doid WHERE dbo.tblDO.PropertyTypeID = ''U'' AND (dbo.tblDO.doIdStBlock = 4039228) EXEC(@SQLString)parts of the above query are passed dynamically from an asp page. Tblma_xy and tbldo consist of about 2 million records each.RegardsChris |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|