-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update large tables statistics (#2146)
# Description After #2135 is deployed in staging, large tables row count metrics are not updated for hours. Statistics come from `pg_class` table, which is randomly updated by the DB itself according to internal thresholds. In order to guarantee statistics update for large tables, a new background task with hourly rate triggers `ANALYZE {large_table_name}`, which takes around 15s in staging. That is still significantly faster compared to the initial `SELECT COUNT(*)` query(150-600s). # Changes A new background task running each hour executes `ANALYZE` for each large table. ## How to test Logs observation
- Loading branch information
1 parent
ce4b58f
commit 9f62d7d
Showing
2 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters