how can space be released from tables?
From: Sean T (T_at_discussions.microsoft.com)
Date: 02/22/05
- Next message: Peter: "Is there any limit to Left Join ?"
- Previous message: Venkat: "Urgent - SQL Server 2000 Linked Server Problem"
- Next in thread: mark baekdal: "RE: how can space be released from tables?"
- Reply: mark baekdal: "RE: how can space be released from tables?"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 21 Feb 2005 19:21:02 -0800
In our enterprise, data is frequently transfered between databse servers
running SQL Svr 2k, via DTS packages and bulk insert. We transfer large
amounts of data at a time, usually around 100k rows but sometimes in excess
of 500k into a temporary, staging table on the destination server. This data
is then merged into the main tables on the same server and deleted from the
staging table.
As a result of this usage pattern, the number of rows in the staging table
can flutuate wildly, from 0 rows up to over a million.
I am often finding that although the rows in the staging table are processed
and removed, the space allocated to the table stays much higher than one
would expect. I thought that SQL Server would release the space once it was
no longer required. After a day of processing here is a typical output from
sp_spaceused
name rows reserved data
index_size unused
helper_Xfer_CallAttempts 0 2133288 KB 1787600 KB 560 KB
345128 KB
and dbcc checktable
DBCC results for 'helper_Xfer_CallAttempts'.
There are 0 rows in 223450 pages for object 'helper_Xfer_CallAttempts'.
I know that these numbers seem to reflect reailty because even executing a
statement that results in a table scan, such as select * from mytable, takes
much longer than it should for a table with 0 rows!
Does anybody have any experience of this, and have any ideas as to what
causes it/what can be done about it? I don't want to resort to forcing a
TRUNCATE TABLE, which is the only thing I have found that reclaims the space.
Thanks,
Sean.
- Next message: Peter: "Is there any limit to Left Join ?"
- Previous message: Venkat: "Urgent - SQL Server 2000 Linked Server Problem"
- Next in thread: mark baekdal: "RE: how can space be released from tables?"
- Reply: mark baekdal: "RE: how can space be released from tables?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|