1

i am using the below script(which is in the link) to update all the stats in all the tables for synapse database dedicated sql pool however the update if not happening for all the table.

https://github.com/techtalkcorner/AzSynapseAnalytics/blob/master/Scripts/T-SQL/%5Bdbo%5D.%5Bsyn_update_stats%5D.sql

Could you please share some help as in how to take it further and be able to update all the stats for all the table.

Thanks

CHEEKATLAPRADEEP
  • 12,191
  • 1
  • 19
  • 42
hari_agg
  • 15
  • 4

1 Answers1

0

Since, you are using third-party code, it's difficult to go through each and every line and identify what exact piece of code causing the issue.

Instead, you can take a look at official example code given by Microsoft in this official document.

One best practice is to update statistics on date columns each day as new dates are added. Each time new rows are loaded into the dedicated SQL pool, new load dates or transaction dates are added. These additions change the data distribution and make the statistics out of date.

The below two queries type can help you determine whether your statistics are stale.

Query 1: Find out the difference between the row count from the statistics (stats_row_count) and the actual row count (actual_row_count).

Query 2: Find out the age of your statistics by checking the last time your statistics were updated on each table.

Utkarsh Pal
  • 4,079
  • 1
  • 5
  • 14