March 18, 2024 at 12:00 am
Comments posted to this topic are about the item Find Unused or Backup Tables
March 18, 2024 at 9:28 am
'%_Old%' won't find what you intend it to find. The underscore means "any character". The literal value needs to be '%[_]Old%'.
March 18, 2024 at 1:09 pm
One hiccup I've encountered using dm_db_index_usage_stats happens when I recently checked the table by doing a select. Suddenly I had a user_scan not related to production usage.
I try to remember to run this query before exploring the table.
A second approach was suggested in another blog (I have lost the reference). The writer defined a process whereby a job runs periodically, adding a record to a log table if there had been activity since the last time the dm_db_index_usage_stats query had been run.
Russel Loski, MCSE Business Intelligence, Data Platform
March 19, 2024 at 10:41 am
hi All,
When maintenace tables is running it will update stats in these DMV, that is not a production usage , we can't eliminate it , so we can't declare the table is unsed.
for me we need to configure a audit per table ( lock shared for example , extend events ,..)
June 15, 2024 at 1:04 pm
What exactly the scan means for the field "user_scans" being with the table "sys.dm_db_index_usage_stats" ?
Like, there are tables in our DB which aren't used for sure as the module is shutdown 4 years back but the DB holds all the tables related to that module. So, was trying to list out the untouched tables against the DB prior to upgrading our SQL. But found that user_scans for those untouched tables are getting updated on certain occasions. But unable to trace back the reasons.
So need some more info on what scenarios does these user_scans gets updated?
- Thank you!
June 15, 2024 at 5:10 pm
Hi All ,
fitst you need to disable all maintenance plan , perhaps your rebound or organise process all table without considering fragmentation .
also tha sal server audit can help you to identify the process that uses your tables
June 16, 2024 at 6:40 pm
Hi All ,
fitst you need to disable all maintenance plan , perhaps your rebound or organise process all table without considering fragmentation .
also tha sal server audit can help you to identify the process that uses your tables
Heh... as a bit of a sidebar, if you're using the supposed "Best Practice" 5/30 method for Index Maintenance, you should just turn your index maintenance off because doing it wrong is a whole lot worse than doing no index maintenance at all. Even the guy that came up with those numbers came out with a disclaimer years ago... if nothing else, read the very last sentence of this article.
I'll also tell you that REORGANIZE is mostly poison. It doesn't work the way most people envisioning it works and it actually sets up many different types of indexes for perpetual fragmentation.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply