File: analyze

package info (click to toggle)
postgresql-common 267
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,516 kB
  • sloc: perl: 4,121; sh: 1,568; makefile: 312; sql: 13; ansic: 10
file content (33 lines) | stat: -rwxr-xr-x 507 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
#
# Run ANALYZE on all databases in the upgraded cluster

set -eu

oldversion="$1"
cluster="$2"
newversion="$3"
phase="$4"

case $newversion in
    9.2|9.3)
        analyze="--analyze-only"
        ;;
    *)
        analyze="--analyze-in-stages"
        ;;
esac

case $newversion in
    9.5|9.6|[1-7]*)
        [ "${PGJOBS:-}" ] && jobs="--jobs=$PGJOBS"
        ;;
esac

case $phase in
    finish)
        vacuumdb --cluster "$newversion/$cluster" --all $analyze ${jobs:-}
        ;;
esac

exit 0