-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autovacuum crypto_transfer, token_transfer, and transaction (#1825)
- configure more frequent anti-wraparound autovacuum for crypto_transfer, token_transfer, and transaction for pg 9.6 - configure more frequent insert-only autovacuum for crypto_transfer, token_transfer, and transaction for pg 13 - upgrade to timescale/timescaledb-ha:pg13-ts2.2-latest - increase shm size for timescaledb container Signed-off-by: Xin Li <xin.li@hedera.com>
- Loading branch information
1 parent
0377e63
commit d0addee
Showing
11 changed files
with
69 additions
and
9 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
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
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
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
25 changes: 25 additions & 0 deletions
25
...a-mirror-importer/src/main/resources/db/migration/v1/R__autovacuum_insert_only_tables.sql
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
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 = ${autovacuumFreezeMaxAgeInsertOnly}, | ||
autovacuum_freeze_table_age = ${autovacuumFreezeMaxAgeInsertOnly}, | ||
autovacuum_freeze_min_age = 0, | ||
log_autovacuum_min_duration = 0 | ||
); | ||
|
||
alter table if exists token_transfer set ( | ||
autovacuum_freeze_max_age = ${autovacuumFreezeMaxAgeInsertOnly}, | ||
autovacuum_freeze_table_age = ${autovacuumFreezeMaxAgeInsertOnly}, | ||
autovacuum_freeze_min_age = 0, | ||
log_autovacuum_min_duration = 0 | ||
); | ||
|
||
alter table if exists transaction set ( | ||
autovacuum_freeze_max_age = ${autovacuumFreezeMaxAgeInsertOnly}, | ||
autovacuum_freeze_table_age = ${autovacuumFreezeMaxAgeInsertOnly}, | ||
autovacuum_freeze_min_age = 0, | ||
log_autovacuum_min_duration = 0 | ||
); |
21 changes: 21 additions & 0 deletions
21
...a-mirror-importer/src/main/resources/db/migration/v2/R__autovacuum_insert_only_tables.sql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
------------------- | ||
-- autovacuum insert-only tables more frequently to ensure most pages are visible for index-only scans | ||
------------------- | ||
|
||
alter table if exists crypto_transfer set ( | ||
autovacuum_vacuum_insert_scale_factor = 0, | ||
autovacuum_vacuum_insert_threshold = ${autovacuumVacuumInsertThresholdCryptoTransfer}, | ||
log_autovacuum_min_duration = 0 | ||
); | ||
|
||
alter table if exists token_transfer set ( | ||
autovacuum_vacuum_insert_scale_factor = 0, | ||
autovacuum_vacuum_insert_threshold = ${autovacuumVacuumInsertThresholdTokenTransfer}, | ||
log_autovacuum_min_duration = 0 | ||
); | ||
|
||
alter table if exists transaction set ( | ||
autovacuum_vacuum_insert_scale_factor = 0, | ||
autovacuum_vacuum_insert_threshold = ${autovacuumVacuumInsertThresholdTransaction}, | ||
log_autovacuum_min_duration = 0 | ||
); |
2 changes: 1 addition & 1 deletion
2
hedera-mirror-importer/src/test/resources/config/bootstrap-v2.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
embedded: | ||
postgresql: | ||
docker-image: timescale/timescaledb-ha:pg12.6-ts2.1.1-latest | ||
docker-image: timescale/timescaledb-ha:pg13-ts2.2-latest |
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