The view is:
SELECT tblCfsEvent.chrEventNumber, tblCfsEvent.dtDateTimeStart, tblCfsStreetName.chvStreetName
FROM tblCfsStreetName LEFT OUTER JOIN
tblCfsEvent ON dbo.tblCfsStreetName.ID =
tblCfsEvent.FK_insCfsStreetName
WHERE (tblCfsEvent.dtDateTimeStart > CONVERT(DATETIME, '2004-09-01 00:00:00', 102) AND tblCfsEvent.dtDateTimeStart < CONVERT(DATETIME,
'2004-10-15 00:00:00', 102)) AND (tblCfsStreetName.chvStreetName = 'Flora')
About 30 records are returned. If I use 10/5/2004 as the ending date, it runs in <1 second, if 10/6/2004 is used then it runs over 45 seconds and no additional records are returned.
As I just finished adding 7,000,000 records to the table a few weeks ago, I rebuilt all of the indexes. Since then, only about 10,000 records have been added to the file. The problem only started about a week back and it is very consistant.
The table holding the street names only has a table key and a street name and the table has about 10,000 entries.
I have run the same request in both the query analyzer and from SQL Manager and receive the same results. Requests continue to be very fast until I exceed some maximum size. The problem seems to be occurring on any requests using this database that exceed a certain size. At present, I do not know of any problems in any other of the databases on the server but all of the other applications have only a small percentage of as many records. As an example, I have a program run procedure, that searches three text fields in 60,000 records for the occurrance of specified text and it runs in under 2 seconds.
I will run DBCC UPDATEUSAGE when I get back to the office.
What do you mean by setting up a clustered index on the view?
S Cephus
Sephus S
|