forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit65c6cab
committed
Avoid O(N^2) behavior in SyncPostCheckpoint().
As in commits6301c3a ande9d9ba2, avoid doing repetitivelist_delete_first() operations, since that would be expensive whenthere are many files waiting to be unlinked. This is a slightlylarger change than in those cases. We have to keep the list statevalid for calls to AbsorbSyncRequests(), so it's necessary to invent a"canceled" field instead of immediately deleting PendingUnlinkEntryentries. Also, because we might not be able to process all theentries, we need a new list primitive list_delete_first_n().list_delete_first_n() is almost list_copy_tail(), but it modifies theinput List instead of making a new copy. I found a couple of existinguses of the latter that could profitably use the new function. (Theremight be more, but the other callers look like they probably shouldn'toverwrite the input List.)As before, back-patch to v13.Discussion:https://postgr.es/m/CD2F0E7F-9822-45EC-A411-AE56F14DEA9F@amazon.com1 parentd8dba4d commit65c6cab
File tree
5 files changed
+103
-14
lines changed- src
- backend
- nodes
- optimizer/util
- parser
- storage/sync
- include/nodes
5 files changed
+103
-14
lines changedLines changed: 66 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
906 | 906 |
| |
907 | 907 |
| |
908 | 908 |
| |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
909 | 975 |
| |
910 | 976 |
| |
911 | 977 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4139 | 4139 |
| |
4140 | 4140 |
| |
4141 | 4141 |
| |
4142 |
| - | |
| 4142 | + | |
4143 | 4143 |
| |
4144 | 4144 |
| |
4145 | 4145 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1691 | 1691 |
| |
1692 | 1692 |
| |
1693 | 1693 |
| |
1694 |
| - | |
| 1694 | + | |
1695 | 1695 |
| |
1696 | 1696 |
| |
1697 | 1697 |
| |
|
Lines changed: 34 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
| 72 | + | |
72 | 73 |
| |
73 | 74 |
| |
74 | 75 |
| |
| |||
195 | 196 |
| |
196 | 197 |
| |
197 | 198 |
| |
| 199 | + | |
198 | 200 |
| |
199 | 201 |
| |
200 |
| - | |
| 202 | + | |
201 | 203 |
| |
202 |
| - | |
| 204 | + | |
203 | 205 |
| |
204 | 206 |
| |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
205 | 211 |
| |
206 | 212 |
| |
207 | 213 |
| |
| |||
231 | 237 |
| |
232 | 238 |
| |
233 | 239 |
| |
234 |
| - | |
235 |
| - | |
236 |
| - | |
| 240 | + | |
| 241 | + | |
237 | 242 |
| |
238 | 243 |
| |
239 | 244 |
| |
240 | 245 |
| |
241 |
| - | |
242 |
| - | |
| 246 | + | |
243 | 247 |
| |
244 | 248 |
| |
245 | 249 |
| |
246 | 250 |
| |
247 | 251 |
| |
248 | 252 |
| |
249 | 253 |
| |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
250 | 274 |
| |
251 | 275 |
| |
252 | 276 |
| |
| |||
486 | 510 |
| |
487 | 511 |
| |
488 | 512 |
| |
489 |
| - | |
| 513 | + | |
490 | 514 |
| |
491 | 515 |
| |
492 | 516 |
| |
493 | 517 |
| |
494 | 518 |
| |
495 | 519 |
| |
496 |
| - | |
497 |
| - | |
498 |
| - | |
499 |
| - | |
| 520 | + | |
500 | 521 |
| |
501 | 522 |
| |
502 | 523 |
| |
| |||
508 | 529 |
| |
509 | 530 |
| |
510 | 531 |
| |
| 532 | + | |
511 | 533 |
| |
512 | 534 |
| |
513 | 535 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
564 | 564 |
| |
565 | 565 |
| |
566 | 566 |
| |
| 567 | + | |
567 | 568 |
| |
568 | 569 |
| |
569 | 570 |
| |
|
0 commit comments
Comments
(0)