Skip to content

Commit

Permalink
chore(cdk-ops): add thoughts about VACUUM
Browse files Browse the repository at this point in the history
- Adds thoughts about VACUUM as comments to `lambda/load-access-logs`.

issue codemonger-io#30
  • Loading branch information
kikuomax committed Oct 9, 2022
1 parent 27d4910 commit b0d9808
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cdk-ops/lambda/load-access-logs/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,11 @@ def lambda_handler(event, _):
)
LOGGER.debug('accessing database as %s', res['dbUser'])
execute_load_script(target_date)
# we need VACUUM to sort updated tables.
# run VACUUM in a different session (e.g., Step Functions) because,
# - VACUUM needs an owner or superuser privilege
# - VACUUM is time consuming
# - only one VACUUM can run at the same time
else:
LOGGER.debug('no access logs on %s', str(target_date))
return {}

0 comments on commit b0d9808

Please sign in to comment.