Skip to content

Commit

Permalink
misc(events) - Setup more aggressive autovacuum_vacuum_scale_factor s…
Browse files Browse the repository at this point in the history
…etting for events (getlago#2360)

## Description

Default postgres autovacuum settings are a bit too defensive for our
use-cases. We require frequent vacuuming of the events table, mostly to
keep the visibility map of the events table up to date.
  • Loading branch information
nudded authored and abdussamadbello committed Aug 8, 2024
1 parent 35dc8b6 commit 9658f28
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions db/migrate/20240801142242_alter_events_vacuum_settings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

class AlterEventsVacuumSettings < ActiveRecord::Migration[7.1]
def up
execute "ALTER TABLE events set (autovacuum_vacuum_scale_factor=0.005)"
end

def down
# revert to PG defaults
execute "ALTER TABLE events set (autovacuum_vacuum_scale_factor=0.1)"
end
end
2 changes: 1 addition & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9658f28

Please sign in to comment.