Showing posts with label rowmodctr. Show all posts
Showing posts with label rowmodctr. Show all posts

Friday, March 30, 2012

RowModCtr Not Updating ?

I would like to use the RowModCtr to evaluate how quickly several indexes ar
e
changing on a table but it seems I'm only witnessing an increment on a
clustered index. Suppose I have this:
CustInfoTable
CustNum
SSN
FName
LName
... with indexes like ...
clustered (PK) on custnum
non-clustered on ssn
non-clustered on fname, lname
Let's pretend I UPDATE ssn, I see the rowmodctr in sysindexes incremented
against the custnum (pk), not against the index on ssn. How does SQL Server
figure the number of rowmods against the index SSN ? Again, if I were to
UPDATE one row against fname, lname I see the reference in sysindexes
incrementing against the clustered (pk).
AutoUpdate Stats is off.
Can anyone shine light on this behavior? I am ultimately am trying to
figure out how quickly fragmentation is occuring on each index of a table so
that I can pin-point which to DBREINDEX during my maintenance window rather
than just blindly doing all.
Thanx.
-CqlboyI am pretty sure that the only one that counts in SQL2000 is the one on the
clustered index or heap. In 2005 each column is tracked individually and
thus a lot more accurate and useful overall.
Andrew J. Kelly SQL MVP
"Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
news:97050225-F44A-4DC3-A11B-0C424D3F1099@.microsoft.com...
>I would like to use the RowModCtr to evaluate how quickly several indexes
>are
> changing on a table but it seems I'm only witnessing an increment on a
> clustered index. Suppose I have this:
> CustInfoTable
> CustNum
> SSN
> FName
> LName
> ... with indexes like ...
> clustered (PK) on custnum
> non-clustered on ssn
> non-clustered on fname, lname
> Let's pretend I UPDATE ssn, I see the rowmodctr in sysindexes incremented
> against the custnum (pk), not against the index on ssn. How does SQL
> Server
> figure the number of rowmods against the index SSN ? Again, if I were to
> UPDATE one row against fname, lname I see the reference in sysindexes
> incrementing against the clustered (pk).
> AutoUpdate Stats is off.
> Can anyone shine light on this behavior? I am ultimately am trying to
> figure out how quickly fragmentation is occuring on each index of a table
> so
> that I can pin-point which to DBREINDEX during my maintenance window
> rather
> than just blindly doing all.
> Thanx.
> -Cqlboy|||Thanx. Yes, it seems that SQL Svr 2000 only increments the clustered or hea
p
and the rowmodctr value for other indexes is not maintained at all. Bummer.
-Cqlboy
"Andrew J. Kelly" wrote:

> I am pretty sure that the only one that counts in SQL2000 is the one on th
e
> clustered index or heap. In 2005 each column is tracked individually and
> thus a lot more accurate and useful overall.
> --
> Andrew J. Kelly SQL MVP
>
> "Cqlboy" <Cqlboy@.discussions.microsoft.com> wrote in message
> news:97050225-F44A-4DC3-A11B-0C424D3F1099@.microsoft.com...
>
>

rowmodctr & SMO.

From MSDN pg for sp_updatestats:

http://msdn2.microsoft.com/en-us/library/ms173804.aspx

'...In SQL Server 2005, sp_updatestats updates only those statistics that require updating based on the rowmodctr information in the sys.sysindexes compatibility view; therefore, preventing unnecessary updates of unchanged items...'

I was hoping that somewhere in the SMO namespace I would find a way to programmatically obtain rowmodctr info., (in order to determine when stats need updating), but I failed to find any method or property within the stats-related classes through which I could do this. If I've missed something, or there is another way to programmatically obtain the same, then any suggestions/comments would be gratefully received.

Many thanks,

Tamim.

Tamim, because that information is available in the system view your best bet is to use ADO.Net and issue the appropriate queries against the system views to get the details you need.|||Thanks Allen, that's exactly what I've done.

rowmodctr

why rowmodctr in sysindexes table shows negative values instead of zero after
a index rebuild in sql 2000 ?
Thanks,
Ranga
Ranga,
The value of [rowmodctr] is increased just for index ID 0 or 1. For the
rest of indexes and statistics, it shows a relative value that has to be
added to the [rowmodctr] of the index 0 or 1 to get the true number of
changed rows for this index.
Statistics Used by the Query Optimizer in Microsoft SQL Server 2000
http://msdn2.microsoft.com/en-us/library/aa902688(SQL.80).aspx
AMB
"Ranga" wrote:

> why rowmodctr in sysindexes table shows negative values instead of zero after
> a index rebuild in sql 2000 ?
> Thanks,
> Ranga
|||Thanks...
I have two tables each has several non clustered indexes...for one of them
I see negative values in the rowmodctr, for the other table i see zero for
rowmodctr...though it is not causing any problems, just curious to know what
is behind this.
I did reindex first, and the value got set to zero, a nightly update
statistics job changed the zero value to a negative number ? Is this what
happenned ?
Ranga
"Alejandro Mesa" wrote:
[vbcol=seagreen]
> Ranga,
> The value of [rowmodctr] is increased just for index ID 0 or 1. For the
> rest of indexes and statistics, it shows a relative value that has to be
> added to the [rowmodctr] of the index 0 or 1 to get the true number of
> changed rows for this index.
> Statistics Used by the Query Optimizer in Microsoft SQL Server 2000
> http://msdn2.microsoft.com/en-us/library/aa902688(SQL.80).aspx
>
> AMB
> "Ranga" wrote:

rowmodctr

why rowmodctr in sysindexes table shows negative values instead of zero afte
r
a index rebuild in sql 2000 ?
Thanks,
RangaRanga,
The value of [rowmodctr] is increased just for index ID 0 or 1. For the
rest of indexes and statistics, it shows a relative value that has to be
added to the [rowmodctr] of the index 0 or 1 to get the true number of
changed rows for this index.
Statistics Used by the Query Optimizer in Microsoft SQL Server 2000
http://msdn2.microsoft.com/en-us/library/aa902688(SQL.80).aspx
AMB
"Ranga" wrote:

> why rowmodctr in sysindexes table shows negative values instead of zero af
ter
> a index rebuild in sql 2000 ?
> Thanks,
> Ranga|||Thanks...
I have two tables each has several non clustered indexes...for one of them
I see negative values in the rowmodctr, for the other table i see zero for
rowmodctr...though it is not causing any problems, just curious to know wha
t
is behind this.
I did reindex first, and the value got set to zero, a nightly update
statistics job changed the zero value to a negative number ? Is this what
happenned ?
Ranga
"Alejandro Mesa" wrote:
[vbcol=seagreen]
> Ranga,
> The value of [rowmodctr] is increased just for index ID 0 or 1. For t
he
> rest of indexes and statistics, it shows a relative value that has to be
> added to the [rowmodctr] of the index 0 or 1 to get the true number of
> changed rows for this index.
> Statistics Used by the Query Optimizer in Microsoft SQL Server 2000
> http://msdn2.microsoft.com/en-us/library/aa902688(SQL.80).aspx
>
> AMB
> "Ranga" wrote:
>sql

rowmodctr

why rowmodctr in sysindexes table shows negative values instead of zero after
a index rebuild in sql 2000 ?
Thanks,
RangaRanga,
The value of [rowmodctr] is increased just for index ID 0 or 1. For the
rest of indexes and statistics, it shows a relative value that has to be
added to the [rowmodctr] of the index 0 or 1 to get the true number of
changed rows for this index.
Statistics Used by the Query Optimizer in Microsoft SQL Server 2000
http://msdn2.microsoft.com/en-us/library/aa902688(SQL.80).aspx
AMB
"Ranga" wrote:
> why rowmodctr in sysindexes table shows negative values instead of zero after
> a index rebuild in sql 2000 ?
> Thanks,
> Ranga|||Thanks...
I have two tables each has several non clustered indexes...for one of them
I see negative values in the rowmodctr, for the other table i see zero for
rowmodctr...though it is not causing any problems, just curious to know what
is behind this.
I did reindex first, and the value got set to zero, a nightly update
statistics job changed the zero value to a negative number ? Is this what
happenned ?
Ranga
"Alejandro Mesa" wrote:
> Ranga,
> The value of [rowmodctr] is increased just for index ID 0 or 1. For the
> rest of indexes and statistics, it shows a relative value that has to be
> added to the [rowmodctr] of the index 0 or 1 to get the true number of
> changed rows for this index.
> Statistics Used by the Query Optimizer in Microsoft SQL Server 2000
> http://msdn2.microsoft.com/en-us/library/aa902688(SQL.80).aspx
>
> AMB
> "Ranga" wrote:
> > why rowmodctr in sysindexes table shows negative values instead of zero after
> > a index rebuild in sql 2000 ?
> >
> > Thanks,
> > Ranga