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 Administration (2000)
 Time outs and Dbase performance

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 you
Chris

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-08-12 : 14:19:13
What does SP do?
Go to Top of Page

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 Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

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.

Regards
Chris




Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-08-13 : 12:41:07
quote:
Originally posted by flumonion

Hi Tara,

I have never defragmented indexes and updated statsitics.
How do i do this and does it make a big difference?




It makes a huge difference.

You can use my scripts to do it or use the _crappy_ maintenance plans:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -