Skip to content
Snippets Groups Projects
Commit f0dd2ea0 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis
Browse files

Merge branch 'docs-non-packaged-postgres-statistics-wwjenkins' into 'master'

Clarify table statistics recreation - Docs

See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7038



Merged-by: default avatarAchilleas Pipinellis <axil@gitlab.com>
Approved-by: default avatarNikolay Samokhvalov <nik@postgres.ai>
Approved-by: default avatarStan Hu <stanhu@gmail.com>
Approved-by: default avatarEvan Read <eread@gitlab.com>
Approved-by: default avatarAchilleas Pipinellis <axil@gitlab.com>
Reviewed-by: default avatarEvan Read <eread@gitlab.com>
Co-authored-by: default avatarEvan Read <eread@gitlab.com>
Co-authored-by: default avatarWade Jenkins <wjenkins@gitlab.com>
parents 2201d568 8ccb90bd
No related branches found
No related tags found
3 merge requests!119heptapod#1448: making Heptapod 1.1 the new oldstable,!116heptapod#1395: make 1.1 the new stable,!115Merged upstream 16.7 stable branches first commit
...@@ -857,17 +857,12 @@ ...@@ -857,17 +857,12 @@
sudo gitlab-ctl start sudo gitlab-ctl start
``` ```
1. After a upgrading PostgreSQL to a new major release: 1. After upgrading PostgreSQL to a new major release, recreate the table statistics to ensure efficient query plans are picked and
to reduce database server CPU load.
- With Amazon RDS ([as recommended by AWS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.PostgreSQL.html)), or
- If the database server is running very high (near 100%) CPU utilization. If the upgrade was "in-place" using `pg_upgrade`, run the following query on the PostgreSQL database console:
Recreating the table statistics will ensure efficient query plans are picked
and reduce database server CPU load.
Run the following query on the PostgreSQL database console:
```SQL ```SQL
SET statement_timeout = 0; ANALYZE VERBOSE; SET statement_timeout = 0; ANALYZE VERBOSE;
``` ```
...@@ -869,8 +864,14 @@ ...@@ -869,8 +864,14 @@
```SQL ```SQL
SET statement_timeout = 0; ANALYZE VERBOSE; SET statement_timeout = 0; ANALYZE VERBOSE;
``` ```
If the upgrade used `pg_dump` and `pg_restore`, run the following query on the PostgreSQL database console:
```SQL
SET statement_timeout = 0; VACUUM ANALYZE VERBOSE;
```
### Seed the database (fresh installs only) ### Seed the database (fresh installs only)
WARNING: WARNING:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment