If your clustered index is on a natural key (ex: FirstName, LastName,
SSN) as opposed to a sequentially incremented key (such as an identity
column), then data and index fragmentation will result over time as SQL
Server attempts to re-organize data pages in physical order. This can be
especially noticable with a 2 billion row table. Run DBCC SHOWCONTIG on the
table to see what data or index fragmentation, if any, exist. You can use
DBCC INDEXDEFRAG or even better run a script to drop / recreate the indexes.
Remember to re-index the clustered index before the non-clustered indexes.
This may also be the time for you to consider physically vertical
partitioning of your data into seperate tables. Perhaps the data can be
split by year, customer, etc. Read up on how to implement a "partitioned
view" of multiple tables that share the same record structure.
[quoted text, click to view] "David Liu" <DavidLiu@discussions.microsoft.com> wrote in message
news:3DBF60C2-0D74-461D-B31A-1D76491054FD@microsoft.com...
> Thanks for the reply.
> Major problem is when you do select * from that table, you can not query
> out
> ( even generate estimate execute plan ), the process hang on there.
>
> --
> David Liu
> Sr. DBA
> MCSE/MCDBA
> Moneris Solutions
>
>
>
> "Myles.Matheson@gmail.com" wrote:
>
>> Hello David,
>>
>> Have you tried doing a straight row count?
>>
>> I think the sp_spaceused uses the table statistics to return row
>> counts.
>>
>> SQL server may not have updated the table statistics after operation
>> was completed. This is a common problem with large tables.
>>
>>
>>
>>
>> Hope this Helps
>>
>> Myles Matheson
>> Data Warehouse Architect
>>
>>