table with few bln records is not being properly reflected in sysindex

  • Hi All,

    I have a table with about 1.8 bln records. However, when I run

    sp_spaceused or

    declare

    @table_name varchar(255)

    set

    @table_name = 'myTable''

    select

    rows from sysindexes

    where

    id = OBJECT_ID(@table_name) and

    indid

    < 2

    number of rows in both cases is same and it is INCORRECT.

    I managed to get the correct number of rows, however even with update usage of the database:

    1.

    DBCC updateusage ('myDatabase')

    2

    .sp_spaceused 'myTable', @updateusage = true

    sp_spaceused is showing wrong number (month old or so) despite multiple (mlns) inserts\updates\deletes.

    Anybody know how to get sp_spaceused to work on very big tables.

    TIA

     

  • I always use  DBCC updateusage ('myDatabase')   with count_rows

    and I run sp_updatestats afterward.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply