forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc79f6df
committed
Do index FSM vacuuming sooner.
In btree and SP-GiST indexes, move the responsibility for callingIndexFreeSpaceMapVacuum from the vacuumcleanup phase to the bulkdeletephase, and do it if and only if we found some pages that could be put intoFSM. As in commit851a26e, the idea is to make free pages visible to FSMsearchers sooner when vacuuming very large tables (large enough to needmultiple bulkdelete scans). This adds more redundant work than that commitdid, since we have to scan the entire index FSM each time rather than beingable to localize what needs to be updated; but it still seems worthwhile.However, we can buy something back by not touching the FSM at all whenthere are no pages that can be put in it. That will result in slowerrecovery from corrupt upper FSM pages in such a scenario, but it doesn'tseem like that's a case we need to optimize for.Hash indexes don't use FSM at all. GIN, GiST, and bloom indexes updateFSM during the vacuumcleanup phase not bulkdelete, so that doing somethingcomparable to this would be a much more invasive change, and it's not clearit's worth it. BRIN indexes do things sufficiently differently that thischange doesn't apply to them, either.Claudio Freire, reviewed by Masahiko Sawada and Jing Wang, some additionaltweaks by meDiscussion:https://postgr.es/m/CAGTBQpYR0uJCNTt3M5GOzBRHo+-GccNO1nCaQ8yEJmZKSW5q1A@mail.gmail.com1 parent96030f9 commitc79f6df
2 files changed
+32
-9
lines changedLines changed: 15 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
832 | 832 |
| |
833 | 833 |
| |
834 | 834 |
| |
835 |
| - | |
836 |
| - | |
837 |
| - | |
838 | 835 |
| |
839 | 836 |
| |
840 | 837 |
| |
| |||
976 | 973 |
| |
977 | 974 |
| |
978 | 975 |
| |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
979 | 991 |
| |
980 | 992 |
| |
981 | 993 |
| |
|
Lines changed: 17 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
845 | 845 |
| |
846 | 846 |
| |
847 | 847 |
| |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
848 | 863 |
| |
849 | 864 |
| |
850 | 865 |
| |
| |||
916 | 931 |
| |
917 | 932 |
| |
918 | 933 |
| |
919 |
| - | |
920 | 934 |
| |
921 | 935 |
| |
922 | 936 |
| |
| |||
926 | 940 |
| |
927 | 941 |
| |
928 | 942 |
| |
929 |
| - | |
930 |
| - | |
| 943 | + | |
| 944 | + | |
931 | 945 |
| |
932 | 946 |
| |
933 | 947 |
| |
| |||
940 | 954 |
| |
941 | 955 |
| |
942 | 956 |
| |
943 |
| - | |
944 |
| - | |
945 |
| - | |
946 | 957 |
| |
947 | 958 |
| |
948 | 959 |
| |
|
0 commit comments
Comments
(0)