Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autovacuum crypto_transfer, token_transfer, and transaction #1825

Merged
merged 7 commits into from
Apr 19, 2021
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-------------------
-- autovacuum insert-only tables more frequently to ensure most pages are visible for index-only scans
-- prior to postgresql 13, this can be achieved by configuring a more aggressive anti-wraparound autovacuum
-------------------

alter table if exists crypto_transfer set (
autovacuum_freeze_max_age = 100000,
autovacuum_freeze_table_age = 100000,
autovacuum_freeze_min_age = 0,
log_autovacuum_min_duration = 0
);

alter table if exists token_transfer set (
autovacuum_freeze_max_age = 100000,
autovacuum_freeze_table_age = 100000,
autovacuum_freeze_min_age = 0,
log_autovacuum_min_duration = 0
);

alter table if exists transaction set (
autovacuum_freeze_max_age = 100000,
autovacuum_freeze_table_age = 100000,
autovacuum_freeze_min_age = 0,
log_autovacuum_min_duration = 0
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-------------------
-- autovacuum insert-only tables more frequently to ensure most pages are visible for index-only scans
-- prior to postgresql 13, this can be achieved by configuring a more aggressive anti-wraparound autovacuum
-------------------

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

\set autovacuum_freeze_max_age '100000'
\set autovacuum_freeze_table_age '100000'

Or if there's value to configurability you can add it as property in the application.yaml under spring.flyway.placeholders

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed both to repeatable migrations and added properties to spring.flyway.placeholders

alter table if exists crypto_transfer set (
autovacuum_freeze_max_age = 100000,
autovacuum_freeze_table_age = 100000,
autovacuum_freeze_min_age = 0,
log_autovacuum_min_duration = 0
);

alter table if exists token_transfer set (
autovacuum_freeze_max_age = 100000,
autovacuum_freeze_table_age = 100000,
autovacuum_freeze_min_age = 0,
log_autovacuum_min_duration = 0
);

alter table if exists transaction set (
autovacuum_freeze_max_age = 100000,
autovacuum_freeze_table_age = 100000,
autovacuum_freeze_min_age = 0,
log_autovacuum_min_duration = 0
);