- Notifications
You must be signed in to change notification settings - Fork5
Commit0d8117a
committed
Fix O(N^2) behavior in pg_dump for large numbers of owned sequences.
The loop that matched owned sequences to their owning tables required timeproportional to number of owned sequences times number of tables; althoughthis work was only expended in selective-dump situations, which is probablywhy the issue wasn't recognized long since. Refactor slightly so that wecan perform this work after the index array for findTableByOid has beenset up, reducing the time to O(M log N).Per gripe from Mike Roest. Since this is a longstanding performance bug,backpatch to all supported versions.1 parentc252a17 commit0d8117a
3 files changed
+27
-18
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
114 | 114 |
| |
115 | 115 |
| |
116 | 116 |
| |
| 117 | + | |
| 118 | + | |
| 119 | + | |
117 | 120 |
| |
118 | 121 |
| |
119 | 122 |
| |
|
Lines changed: 23 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4307 | 4307 |
| |
4308 | 4308 |
| |
4309 | 4309 |
| |
| 4310 | + | |
| 4311 | + | |
| 4312 | + | |
| 4313 | + | |
| 4314 | + | |
| 4315 | + | |
| 4316 | + | |
| 4317 | + | |
| 4318 | + | |
| 4319 | + | |
| 4320 | + | |
| 4321 | + | |
| 4322 | + | |
| 4323 | + | |
| 4324 | + | |
| 4325 | + | |
| 4326 | + | |
4310 | 4327 |
| |
4311 | 4328 |
| |
4312 | 4329 |
| |
4313 | 4330 |
| |
4314 |
| - | |
| 4331 | + | |
4315 | 4332 |
| |
4316 | 4333 |
| |
4317 |
| - | |
| 4334 | + | |
4318 | 4335 |
| |
4319 | 4336 |
| |
4320 | 4337 |
| |
4321 | 4338 |
| |
4322 | 4339 |
| |
4323 |
| - | |
4324 |
| - | |
4325 |
| - | |
| 4340 | + | |
| 4341 | + | |
4326 | 4342 |
| |
4327 |
| - | |
4328 |
| - | |
4329 |
| - | |
4330 |
| - | |
4331 |
| - | |
4332 |
| - | |
4333 |
| - | |
4334 |
| - | |
4335 |
| - | |
| 4343 | + | |
| 4344 | + | |
4336 | 4345 |
| |
4337 | 4346 |
| |
4338 |
| - | |
4339 |
| - | |
4340 |
| - | |
4341 |
| - | |
4342 | 4347 |
| |
4343 | 4348 |
| |
4344 | 4349 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
538 | 538 |
| |
539 | 539 |
| |
540 | 540 |
| |
| 541 | + | |
541 | 542 |
| |
542 | 543 |
| |
543 | 544 |
| |
|
0 commit comments
Comments
(0)