forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd2e5e20
committed
Add xl_btree_delete optimization.
Commit558a916 taught _bt_delitems_delete() to produce its own XIDhorizon on the primary. Standbys no longer needed to generate their ownlatestRemovedXid, since they could just use the explicitly logged valuefrom the primary instead. The deleted offset numbers array from thexl_btree_delete WAL record was no longer used by the REDO routine foranything other than deleting the items.This enables a minor optimization: We now treat the array as bufferstate, not generic WAL data, following _bt_delitems_vacuum()'s example.This should be a minor win, since it allows us to avoid including thedeleted items array in cases where XLogInsert() stores the whole bufferanyway. The primary goal here is to make the code more maintainable,though. Removing inessential differences between the two functionshighlights the fundamental differences that remain.Also change xl_btree_delete to use uint32 for the size of the array ofitem offsets being deleted. This brings xl_btree_delete closer toxl_btree_vacuum. Furthermore, it seems like a good idea to use anexplicit-width integer type (the field was previously an "int").Bump XLOG_PAGE_MAGIC because xl_btree_delete changed.Discussion:https://postgr.es/m/CAH2-Wzkz4TjmezzfAbaV1zYrh=fr0bCpzuJTvBe5iUQ3aUPsCQ@mail.gmail.com1 parent56a3921 commitd2e5e20
6 files changed
+32
-42
lines changedLines changed: 21 additions & 27 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
961 | 961 |
| |
962 | 962 |
| |
963 | 963 |
| |
964 |
| - | |
965 |
| - | |
966 |
| - | |
967 |
| - | |
968 |
| - | |
| 964 | + | |
969 | 965 |
| |
970 | 966 |
| |
971 | 967 |
| |
972 | 968 |
| |
973 | 969 |
| |
974 | 970 |
| |
975 |
| - | |
976 |
| - | |
977 |
| - | |
| 971 | + | |
| 972 | + | |
978 | 973 |
| |
979 | 974 |
| |
980 | 975 |
| |
| |||
1030 | 1025 |
| |
1031 | 1026 |
| |
1032 | 1027 |
| |
1033 |
| - | |
1034 |
| - | |
1035 |
| - | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
1036 | 1031 |
| |
1037 | 1032 |
| |
1038 | 1033 |
| |
| |||
1046 | 1041 |
| |
1047 | 1042 |
| |
1048 | 1043 |
| |
1049 |
| - | |
1050 |
| - | |
1051 |
| - | |
| 1044 | + | |
1052 | 1045 |
| |
1053 | 1046 |
| |
1054 |
| - | |
1055 |
| - | |
| 1047 | + | |
| 1048 | + | |
1056 | 1049 |
| |
1057 | 1050 |
| |
1058 |
| - | |
1059 |
| - | |
| 1051 | + | |
| 1052 | + | |
1060 | 1053 |
| |
1061 | 1054 |
| |
1062 | 1055 |
| |
1063 |
| - | |
| 1056 | + | |
1064 | 1057 |
| |
1065 | 1058 |
| |
1066 | 1059 |
| |
1067 | 1060 |
| |
1068 | 1061 |
| |
1069 | 1062 |
| |
1070 | 1063 |
| |
1071 |
| - | |
| 1064 | + | |
1072 | 1065 |
| |
1073 | 1066 |
| |
1074 | 1067 |
| |
1075 | 1068 |
| |
1076 |
| - | |
| 1069 | + | |
1077 | 1070 |
| |
1078 | 1071 |
| |
1079 | 1072 |
| |
1080 | 1073 |
| |
1081 | 1074 |
| |
1082 |
| - | |
| 1075 | + | |
1083 | 1076 |
| |
1084 | 1077 |
| |
1085 | 1078 |
| |
| |||
1098 | 1091 |
| |
1099 | 1092 |
| |
1100 | 1093 |
| |
1101 |
| - | |
| 1094 | + | |
1102 | 1095 |
| |
1103 | 1096 |
| |
1104 | 1097 |
| |
1105 | 1098 |
| |
1106 | 1099 |
| |
1107 | 1100 |
| |
1108 |
| - | |
1109 |
| - | |
1110 |
| - | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
1111 | 1104 |
| |
1112 |
| - | |
| 1105 | + | |
| 1106 | + | |
1113 | 1107 |
| |
1114 | 1108 |
| |
1115 | 1109 |
| |
|
Lines changed: 3 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
449 | 449 |
| |
450 | 450 |
| |
451 | 451 |
| |
452 |
| - | |
453 |
| - | |
454 |
| - | |
455 |
| - | |
456 |
| - | |
| 452 | + | |
457 | 453 |
| |
458 |
| - | |
| 454 | + | |
459 | 455 |
| |
460 |
| - | |
461 |
| - | |
| 456 | + | |
462 | 457 |
| |
463 | 458 |
| |
464 | 459 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
56 |
| - | |
57 |
| - | |
| 56 | + | |
| 57 | + | |
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
779 | 779 |
| |
780 | 780 |
| |
781 | 781 |
| |
782 |
| - | |
| 782 | + | |
| 783 | + | |
783 | 784 |
| |
784 | 785 |
| |
785 | 786 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
126 | 126 |
| |
127 | 127 |
| |
128 | 128 |
| |
129 |
| - | |
| 129 | + | |
130 | 130 |
| |
131 |
| - | |
| 131 | + | |
132 | 132 |
| |
133 | 133 |
| |
134 |
| - | |
| 134 | + | |
135 | 135 |
| |
136 | 136 |
| |
137 | 137 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
34 |
| - | |
| 34 | + | |
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
|
0 commit comments
Comments
(0)