Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 1.58 KB

PostgreSQL-tuning-202103.md

File metadata and controls

39 lines (25 loc) · 1.58 KB

PostgreSQL tuning - 2021/3

tags: tech workshop

autovacuum

  • autovacuum 會用到的參數

  • 可以透過類似 ALTER TABLE <table_name> SET (autovacuum_vacuum_cost_limit = <large_value>),針對某些 table 個別給定需要的參數值

    • 可以用 \d+ <table_name> 下面的 options 觀察目前 table 是否有 custom options
    • 或是 SELECT relname, reloptions FROM pg_class;
  • To check if the autovacuum daemon is running always:

    • $ps -axww | grep autovacuum
    • SELECT name, setting FROM pg_settings WHERE name = 'autovacuum';
  • 如何觀察 last_autovacuum/last_autoanalyze 的時間?

    • SELECT * FROM pg_stat_user_tables;

reference

fillfactor

ref