STATISTICS

Find last statistics updated date detail ?–Maintenance TIP #59

  Problem:- One of the pain point in any SQL engineer  is “Performance”. There are various reasons due to which your SQL Server database is slow. One of the possible reason is your maintenance.   You don’t know when statistics last updated and take further step if those are not updated Solution:- Here we have simple …

Maintenance of fragmented Heap table–TIP #55

  Friends, In last post  post #54  we understood what is a Heap table. Now the challenge is what if this table is highly fragmented so. Now our task is to run maintenance of this highly fragmented table. So you have to run following command “ALTER TABLE  TABLENAME REBUILD; For example  I run the Rebuild …

Performance tips – How to determine last statistics update in table ? TIP #46

Hi, For maintenance purpose we need to determine when the stats last update and analyze the data and if data is out dated then we need to update the stats. To determine this we need to run the following scripts SELECT OBJECT_NAME(s.object_id) AS [ObjectName]      ,s.name AS [StatisticName]      ,STATS_DATE(s.object_id, [stats_id]) AS [StatisticUpdateDate]FROM sys.stats sINNER JOIN sys.objects …