forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc103d07
committed
Add function for removing arbitrary nodes in binaryheap.
This commit introduces binaryheap_remove_node(), which can be usedto remove any node from a binary heap. The implementation isstraightforward. The target node is replaced with the last node inthe heap, and then we sift as needed to preserve the heap property.This new function is intended for use in a follow-up commit thatwill improve the performance of pg_restore.Reviewed-by: Tom LaneDiscussion:https://postgr.es/m/3612876.1689443232%40sss.pgh.pa.us1 parent83223f5 commitc103d07
2 files changed
+32
-0
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
215 | 215 |
| |
216 | 216 |
| |
217 | 217 |
| |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
218 | 247 |
| |
219 | 248 |
| |
220 | 249 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
| 62 | + | |
62 | 63 |
| |
63 | 64 |
| |
64 | 65 |
| |
| 66 | + | |
| 67 | + | |
65 | 68 |
| |
66 | 69 |
|
0 commit comments
Comments
(0)