This example reports all tuning events that occurred on database MyDb during the specified time period.
.set sidetitles on
.set foldline on
CALL TDStats.AuditTrail('{"StartTime":"2022-01-18 15:00:00","DatabaseName":"MyDb","EventType":"A"}');
Result:
EventTimeStamp 2022-01-18 15:13:37
EventType M - Missing Stat Identified
DatabaseName MyDb
TableName MyTable
FieldNames x1
DDLText COLLECT STATISTICS COLUMN(x1 ) ON MyDb.MyTable
Description New stat collected on column that may benefit 10 queries with 5 cardinality estimation errors and 0 missed SLGs with an average Optimizer assigned importance of 2-High
.
.
.
EventTimeStamp 2022-01-18 15:13:41
EventType BR - Batched recollection of multiple stats
DatabaseName MyDb
TableName MyTable
FieldNames ?
DDLText COLLECT STATISTICS INDEX(pi ),COLUMN(x1 ),COLUMN(x2 ),COLUMN(x3 ),COLUMN(x4 ) ON "MyDb.MyTable;
Description Table level refresh of multiple stats