Re: Mismatch between Count(*) and Properties -> Rows
- From: Roy Harvey <roy_harvey@xxxxxxxx>
- Date: Fri, 29 Jun 2007 22:10:31 -0400
On Fri, 29 Jun 2007 18:53:15 -0700, Ed Murphy <emurphy42@xxxxxxxxxxxx>
wrote:
Roy Harvey wrote:
On Fri, 29 Jun 2007 07:28:03 -0700, teddysnips@xxxxxxxxxxx wrote:
SELECT COUNT(*) AS NumRows FROM Answer
It returned 1,919,456. However, if I click on the Answer table in
Enterprise Manager and select Properties it tells me that there are
1,919,421 rows. I've tried doing a refresh but it didn't work.
Those statistics are not always accurate. To fix them run
DBCC UPDATEUSAGE(0) WITH COUNT_ROWS
Is it COUNT(*) or EM - Properties that is sometimes inaccurate? Under
what circumstances may it be inaccurate?
Enterprise Manager. EM gets the count from index information
maintained by the system. The overhead of keeping the numbers
absolutely accurate at all times would be prohibitive, so the row
count gets out of sync with reality at times. The same goes for space
allocation, which UPDATEUSAGE also fixes.
SELECT COUNT(*) will always be correct.
Roy Harvey
Beacon Falls, CT
.
- References:
- Mismatch between Count(*) and Properties -> Rows
- From: teddysnips
- Re: Mismatch between Count(*) and Properties -> Rows
- From: Roy Harvey
- Re: Mismatch between Count(*) and Properties -> Rows
- From: Ed Murphy
- Mismatch between Count(*) and Properties -> Rows
- Prev by Date: Re: Combining Values
- Next by Date: Re: Combining Values
- Previous by thread: Re: Mismatch between Count(*) and Properties -> Rows
- Next by thread: Connecting to SQL 2005 using VB6
- Index(es):