How to automatically determine which tables need vacuum / reindex in postgresql

I wrote a maintenance script for our database and would like to run this script depending on which tables most need to be cleaned / reindexed during our downtime every day. is there any way to determine what in postgres?

I would classify tables requiring attention as follows:

  • tables requiring evacuation
  • tables that need reindexing (we find that this is of great importance for performance)

I see something roughly promising here

+3
source share
3

, -. ?

pg_stat_all_tables pg_stat_all_indexes.

. , .

+4

, -.

, , :

  • ( ?) :

, talbe 'foo' X X,

  • .

, ( ), / , .

, , custom-autovacuum-with-custom-'triggers'-criteria

0

, CRUD .

, , .

"" pl/sql, ...

, DB , script , , ... , (), ( ), , ...

0
source

Source: https://habr.com/ru/post/1710418/


All Articles