- Notifications
You must be signed in to change notification settings - Fork28
Commit7526e10
committed
BRIN auto-summarization
Previously, only VACUUM would cause a page range to get initiallysummarized by BRIN indexes, which for some use cases takes too much timesince the inserts occur. To avoid the delay, have brininsert request asummarization run for the previous range as soon as the first tuple isinserted into the first page of the next range. Autovacuum is in chargeof processing these requests, after doing all the regular vacuuming/analyzing work on tables.This doesn't impose any new tasks on autovacuum, because autovacuum wasalready in charge of doing summarizations. The only actual effect is tochange the timing, i.e. that it occurs earlier. For this reason, wedon't go any great lengths to record these requests very robustly; ifthey are lost because of a server crash or restart, they will happen ata later time anyway.Most of the new code here is in autovacuum, which can now be told about"work items" to process. This can be used for other things such as GINpending list cleaning, perhaps visibility map bit setting, both of whichare currently invoked during vacuum, but do not really depend on vacuumtaking place.The requests are at the page range level, a granularity for which we didnot have SQL-level access; we only had index-level summarizationrequests via brin_summarize_new_values(). It seems reasonable to addSQL-level access to range-level summarization too, so add a functionbrin_summarize_range() to do that.Authors: Álvaro Herrera, based on sketch from Simon Riggs.Reviewed-by: Thomas Munro.Discussion:https://postgr.es/m/20170301045823.vneqdqkmsd4as4ds@alvherre.pgsql1 parent7220c7b commit7526e10
File tree
13 files changed
+672
-25
lines changed- doc/src/sgml
- ref
- src
- backend
- access
- brin
- common
- postmaster
- include
- access
- catalog
- postmaster
- test/regress
- expected
- sql
13 files changed
+672
-25
lines changedLines changed: 7 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
77 |
| - | |
78 |
| - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
79 | 83 |
| |
| 84 | + | |
80 | 85 |
| |
81 | 86 |
| |
82 | 87 |
| |
|
Lines changed: 9 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19683 | 19683 |
| |
19684 | 19684 |
| |
19685 | 19685 |
| |
| 19686 | + | |
| 19687 | + | |
| 19688 | + | |
| 19689 | + | |
| 19690 | + | |
| 19691 | + | |
| 19692 | + | |
19686 | 19693 |
| |
19687 | 19694 |
| |
19688 | 19695 |
| |
| |||
19700 | 19707 |
| |
19701 | 19708 |
| |
19702 | 19709 |
| |
19703 |
| - | |
| 19710 | + | |
| 19711 | + | |
19704 | 19712 |
| |
19705 | 19713 |
| |
19706 | 19714 |
| |
|
Lines changed: 11 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
382 | 382 |
| |
383 | 383 |
| |
384 | 384 |
| |
385 |
| - | |
| 385 | + | |
386 | 386 |
| |
387 | 387 |
| |
388 | 388 |
| |
| |||
396 | 396 |
| |
397 | 397 |
| |
398 | 398 |
| |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
399 | 409 |
| |
400 | 410 |
| |
401 | 411 |
| |
|
Lines changed: 106 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| 29 | + | |
29 | 30 |
| |
30 | 31 |
| |
31 | 32 |
| |
| |||
60 | 61 |
| |
61 | 62 |
| |
62 | 63 |
| |
| 64 | + | |
| 65 | + | |
63 | 66 |
| |
64 | 67 |
| |
65 | 68 |
| |
66 |
| - | |
| 69 | + | |
67 | 70 |
| |
68 | 71 |
| |
69 | 72 |
| |
| |||
126 | 129 |
| |
127 | 130 |
| |
128 | 131 |
| |
| 132 | + | |
| 133 | + | |
| 134 | + | |
129 | 135 |
| |
130 |
| - | |
| 136 | + | |
131 | 137 |
| |
132 | 138 |
| |
133 | 139 |
| |
| |||
136 | 142 |
| |
137 | 143 |
| |
138 | 144 |
| |
| 145 | + | |
| 146 | + | |
139 | 147 |
| |
140 | 148 |
| |
141 | 149 |
| |
142 | 150 |
| |
143 | 151 |
| |
| 152 | + | |
144 | 153 |
| |
145 | 154 |
| |
146 | 155 |
| |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
147 | 163 |
| |
148 | 164 |
| |
149 | 165 |
| |
150 | 166 |
| |
151 | 167 |
| |
152 | 168 |
| |
153 |
| - | |
154 | 169 |
| |
155 | 170 |
| |
156 | 171 |
| |
157 | 172 |
| |
158 |
| - | |
159 |
| - | |
160 |
| - | |
161 |
| - | |
162 |
| - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
163 | 198 |
| |
164 | 199 |
| |
165 | 200 |
| |
| |||
747 | 782 |
| |
748 | 783 |
| |
749 | 784 |
| |
750 |
| - | |
| 785 | + | |
751 | 786 |
| |
752 | 787 |
| |
753 | 788 |
| |
| |||
765 | 800 |
| |
766 | 801 |
| |
767 | 802 |
| |
768 |
| - | |
| 803 | + | |
| 804 | + | |
769 | 805 |
| |
770 | 806 |
| |
771 | 807 |
| |
| |||
791 | 827 |
| |
792 | 828 |
| |
793 | 829 |
| |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
794 | 845 |
| |
795 | 846 |
| |
| 847 | + | |
| 848 | + | |
796 | 849 |
| |
797 | 850 |
| |
798 | 851 |
| |
799 | 852 |
| |
800 | 853 |
| |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
801 | 864 |
| |
802 | 865 |
| |
803 | 866 |
| |
| |||
837 | 900 |
| |
838 | 901 |
| |
839 | 902 |
| |
840 |
| - | |
| 903 | + | |
841 | 904 |
| |
842 | 905 |
| |
843 | 906 |
| |
| |||
1063 | 1126 |
| |
1064 | 1127 |
| |
1065 | 1128 |
| |
1066 |
| - | |
1067 |
| - | |
1068 |
| - | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
1069 | 1132 |
| |
1070 | 1133 |
| |
1071 | 1134 |
| |
1072 | 1135 |
| |
1073 | 1136 |
| |
1074 | 1137 |
| |
1075 |
| - | |
1076 |
| - | |
| 1138 | + | |
| 1139 | + | |
1077 | 1140 |
| |
1078 | 1141 |
| |
1079 | 1142 |
| |
| |||
1082 | 1145 |
| |
1083 | 1146 |
| |
1084 | 1147 |
| |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
1085 | 1155 |
| |
1086 | 1156 |
| |
1087 | 1157 |
| |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1088 | 1177 |
| |
1089 | 1178 |
| |
1090 | 1179 |
| |
1091 | 1180 |
| |
1092 |
| - | |
1093 |
| - | |
| 1181 | + | |
1094 | 1182 |
| |
1095 | 1183 |
| |
1096 | 1184 |
| |
|
Lines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
205 | 205 |
| |
206 | 206 |
| |
207 | 207 |
| |
208 |
| - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
209 | 213 |
| |
210 | 214 |
| |
211 | 215 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
92 | 92 |
| |
93 | 93 |
| |
94 | 94 |
| |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
95 | 104 |
| |
96 | 105 |
| |
97 | 106 |
| |
|
0 commit comments
Comments
(0)