-
Notifications
You must be signed in to change notification settings - Fork 1
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
Optimise Postgres post processing to speedup process #75
base: develop
Are you sure you want to change the base?
Conversation
fab259e
to
b8e10b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've proposed maintenance_work_mem Increase (to be confirmed by DBA).
PostgreSQL supports parallel query execution, e.g.
SET max_parallel_workers_per_gather = 4;
current value in SCXA db is max_parallel_workers_per_gather 2
. Increasing could help too with long data-intensive db operations.
- re-enable autovacuum (mandatory) | ||
- add a check constraint on the partition value (mandatory) | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increase memory for maintenance, current one used is 256MB
SET maintenance_work_mem = '16GB'; |
- cluster the partition tables on primary key (optional) -> blocking op | ||
- collect statistics on the partition tables (mandatory) | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SET maintenance_work_mem = '16GB'; |
*/ | ||
|
||
CLUSTER scxa_analytics_<EXP-ACCESSION> USING scxa_analytics_<EXP-ACCESSION>_pk; | ||
ANALYZE scxa_analytics_<EXP-ACCESSION>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ANALYZE scxa_analytics_<EXP-ACCESSION>; | |
ANALYZE scxa_analytics_<EXP-ACCESSION>; | |
RESET maintenance_work_mem ; |
Splitting up
05-post_processing.sql.template
into05-01-post_processing.sql.template
and05-02-post_processing.sql.template
with advise from DBA team to speedup process