473,396 Members | 2,057 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Select, insert and delete queries timing out

I am using a sql server 2000 database to log the results from a monitor
that I have running - essentially every minuite, the table described
below has a insert and delete statements similar to the ones below run
againt it.

Everything is fine for a few weeks, and then without fail, all accesses
to the table start slowing down, to the point where even trying to
select all rows starts timing out.

At that point, the only way to make things right that I have found, is
to delete the table and recreate it.

Am I doing something specific that sql server really doesn't like? Is
there a better solution then deleting and recreating the table?

CREATE TABLE [www2] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[stamp] [datetime] NULL CONSTRAINT [DF_www2_stamp] DEFAULT (getdate()),
[success] [bit] NULL ,
[report] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[level] [int] NULL ,
[iistrace] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

INSERT INTO [www2] ([Report],[Success],[Level],[iistrace],[Stamp])
VALUES ('Error on: <a
href="http://www2.klickit.com/include/asp/system_test.asp">http://www2.k
lickit.com/include/asp/system_test.asp</a><br><br>The operation timed
out
<br><br>(Test Activated From: Lynx/2.8.2rel.1
libwww-FM/2.14)',0,1,'',getDate())

DELETE FROM [www2] WHERE (Stamp<getDate()-3) AND (Success=1) AND (Report
Not Like 'Reset
Thanks in advance,
Simon Withers
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #1
1 3838
Simon Withers (si***@klickit.com) writes:
I am using a sql server 2000 database to log the results from a monitor
that I have running - essentially every minuite, the table described
below has a insert and delete statements similar to the ones below run
againt it.

Everything is fine for a few weeks, and then without fail, all accesses
to the table start slowing down, to the point where even trying to
select all rows starts timing out.

At that point, the only way to make things right that I have found, is
to delete the table and recreate it.

Am I doing something specific that sql server really doesn't like? Is
there a better solution then deleting and recreating the table?


I can't see any indexes on the table, so once the table start to
fill up, the DELETE statement will have more and more rows to scan.
That could also cause the INSERTS to block. A clustered index on stamp
seems to be in place. Maybe Success should be included too.

You could also consider whether you really need to have the report
and listtrace columns as text, maybe a varchar(4000) each could do?


--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: John Keeling | last post by:
Dear all, I tried the test program below. My interest is to examine timing differences between insert vs. append & reverse for a list. My results on my XP Python 2.3.4 are as follows:...
1
by: Craig Stadler | last post by:
Can someone help with query syntax regarding IN/EXISTS.. I'm trying to do this: insert into table2 (field1) select field1 from table1 where field1 not in (select field1 from table2) delete...
11
by: Jeff Sandler | last post by:
I need a MySQL select statement as part of a PHP script. I want to find rows where a certain column either starts with or equals a user-supplied string. The string will be 1 or more characters in...
3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
1
by: Grant McLean | last post by:
Hi First a simple question ... I have a table "access_log" that has foreign keys "app_id" and "app_user_id" that reference the "application_type" and "app_user" tables. When I insert into...
11
by: Eugene Anthony | last post by:
The code bellow functions well when I attemp to delete a record. But when I attemp to insert a record I am getting the following error -2147217900:Syntax error in INSERT INTO statement. How do I...
2
by: paulmitchell507 | last post by:
I think I am attempting a simple procedure but I just can't figure out the correct syntax. My asp (classic) page runs a SELECT query to obtain dates and ID's from 2 tables uSQL = "SELECT...
3
by: tdickerson | last post by:
Hi, I'm encountering a strange error after an upgrade has been run on a test site. Attempting to SELECT * FROM table or even just entering SELECT * (no table specified) returns the following...
6
by: BobRoyAce | last post by:
Let's say that I am performing a bunch of insert/update queries within a transaction that is created as follows: Dim cnn As New SqlClient.SqlConnection(My.Settings.GRPConnectionString)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.