July 8, 2017 at 9:26 am
Hi,
Is there anyway to find the total number of records inserted/deleted/updated in tables using sys.stats or sys.indexes views to understand which tables are highly transnational?
Wanted to formulate a plan to check when the SQL server plan changes against procedures and how to prevent this. This is one of the options to explore further.
Kindly suggest
Thanks.
July 8, 2017 at 12:07 pm
SQL-DBA-01 - Saturday, July 8, 2017 9:26 AMHi,Is there anyway to find the total number of records inserted/deleted/updated in tables using sys.stats or sys.indexes views to understand which tables are highly transnational?
Wanted to formulate a plan to check when the SQL server plan changes against procedures and how to prevent this. This is one of the options to explore further.
Kindly suggest
If you want to find row counts involved in your statistics, check out sys.dm_db_stats_properties.
July 10, 2017 at 7:21 am
SQL-DBA-01 - Saturday, July 8, 2017 9:26 AMWanted to formulate a plan to check when the SQL server plan changes against procedures and how to prevent this.Kindly suggest
I'll kindly suggest that, except in very rare cases, preventing plan changes is a form of "death by SQL" especially in the face of any scalability. There are times when you may want to optimize for a certain condition or force the use of a saved plan (usually because of the bad form of "SQL Injectio") but that's frequently akin to putting a Band-Aid on a stab wound. It's far better to analyze the code and figure out the best way to write the code to accommodate such eventually needed changes.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 12, 2017 at 9:12 am
For insert and delete you will need to take snapshots of sys.sysindexes before and after insert or delete. Look for rowcnt or rows columns. Alternatively you can also check sys.indexes-sys.partitions-sys.allocation_units or sys.dm_db_partition_stats.
For updates look for rowmodctr (it counts down) in sys.sysindexes
But this all not related to trans-nationality of table usages.
July 12, 2017 at 11:05 am
SQL Guy 1 - Wednesday, July 12, 2017 9:12 AMBut this all not related to trans-nationality of table usages.
Agreed - I don't think transnationality has any impact on much of anything here. 😉
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply