unknown
2009-11-24 17:24:59 UTC
i have a table custtrans. sp_spaceused shows 900+ million
rows. We know it has over 900+ rows. Table has all the right
indexes used by application.
I want to do a count(*) to check how many actual rows are
present in this table. What is the best way to do this? I
ran "select count(*) from custtrans" and killed it after 1
day(24+ hours) without any results.
The live data gets inserted into this table(and was being
inserted when the counts(*) was running). No blocking
otherwise our block monitoring script would have started
spitting alerts.
what happens to select count(*) when the rows keeps growing
for a table? What is the best way to run such counts?
NOTE:
I am looking for a solution OTHER THAN having to use where
criteria to count ranges which would be based on index and
then sum them up.
rows. We know it has over 900+ rows. Table has all the right
indexes used by application.
I want to do a count(*) to check how many actual rows are
present in this table. What is the best way to do this? I
ran "select count(*) from custtrans" and killed it after 1
day(24+ hours) without any results.
The live data gets inserted into this table(and was being
inserted when the counts(*) was running). No blocking
otherwise our block monitoring script would have started
spitting alerts.
what happens to select count(*) when the rows keeps growing
for a table? What is the best way to run such counts?
NOTE:
I am looking for a solution OTHER THAN having to use where
criteria to count ranges which would be based on index and
then sum them up.