- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit9879105
committed
vacuumdb: Don't skip empty relations in --missing-stats-only mode.
Presently, --missing-stats-only skips relations with reltuples setto 0 because empty relations don't get optimizer statistics.However, before v14, a reltuples value of 0 was ambiguous: it couldeither mean the relation is empty, or it could mean that it hadn'tyet been vacuumed or analyzed. (Commit3d351d9 taught v14 andnewer to use -1 for the latter case.) This ambiguity can cause--missing-stats-only to inadvertently skip relations that needoptimizer statistics after upgrades to v18 and newer (sincereltuples is now transferred from the old cluster).To fix, simply remove the check for reltuples != 0. This willcause --missing-stats-only to analyze some empty tables, but thatdoesn't seem too terrible a trade-off.Reported-by: Christoph Berg <myon@debian.org>Reviewed-by: Christoph Berg <myon@debian.org>Discussion:https://postgr.es/m/aAjyvW5_fRGNr7yF%40msg.df7cb.de1 parentd5f1b6a commit9879105
1 file changed
+0
-5
lines changedLines changed: 0 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
954 | 954 |
| |
955 | 955 |
| |
956 | 956 |
| |
957 |
| - | |
958 | 957 |
| |
959 | 958 |
| |
960 | 959 |
| |
| |||
967 | 966 |
| |
968 | 967 |
| |
969 | 968 |
| |
970 |
| - | |
971 | 969 |
| |
972 | 970 |
| |
973 | 971 |
| |
| |||
979 | 977 |
| |
980 | 978 |
| |
981 | 979 |
| |
982 |
| - | |
983 | 980 |
| |
984 | 981 |
| |
985 | 982 |
| |
| |||
994 | 991 |
| |
995 | 992 |
| |
996 | 993 |
| |
997 |
| - | |
998 | 994 |
| |
999 | 995 |
| |
1000 | 996 |
| |
| |||
1011 | 1007 |
| |
1012 | 1008 |
| |
1013 | 1009 |
| |
1014 |
| - | |
1015 | 1010 |
| |
1016 | 1011 |
| |
1017 | 1012 |
| |
|
0 commit comments
Comments
(0)