forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbd15b7d
committed
Improve performance of dumpSequenceData().
As one might guess, this function dumps the sequence data. It iscalled once per sequence, and each such call executes a query toretrieve the relevant data for a single sequence. This can causepg_dump to take significantly longer, especially when there aremany sequences.This commit improves the performance of this function by gatheringall the sequence data with a single query at the beginning ofpg_dump. This information is stored in a sorted array thatdumpSequenceData() can bsearch() for what it needs. This follows asimilar approach as previous commits that introduced sorted arraysfor role information, pg_class information, and sequence metadata.As with those commits, this patch will cause pg_dump to use morememory, but that isn't expected to be too egregious.Note that we use the brand new function pg_sequence_read_tuple() inthe query that gathers all sequence data, so we must continue touse the preexisting query-per-sequence approach for versions olderthan 18.Reviewed-by: Euler Taveira, Michael Paquier, Tom LaneDiscussion:https://postgr.es/m/20240503025140.GA1227404%40nathanxps131 parentc8b06bb commitbd15b7d
1 file changed
+63
-18
lines changedLines changed: 63 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
132 | 132 |
| |
133 | 133 |
| |
134 | 134 |
| |
| 135 | + | |
| 136 | + | |
135 | 137 |
| |
136 | 138 |
| |
137 | 139 |
| |
| |||
17330 | 17332 |
| |
17331 | 17333 |
| |
17332 | 17334 |
| |
| 17335 | + | |
| 17336 | + | |
| 17337 | + | |
17333 | 17338 |
| |
17334 | 17339 |
| |
17335 | 17340 |
| |
17336 |
| - | |
| 17341 | + | |
| 17342 | + | |
17337 | 17343 |
| |
17338 | 17344 |
| |
17339 | 17345 |
| |
17340 |
| - | |
| 17346 | + | |
| 17347 | + | |
17341 | 17348 |
| |
17342 | 17349 |
| |
| 17350 | + | |
| 17351 | + | |
| 17352 | + | |
| 17353 | + | |
| 17354 | + | |
| 17355 | + | |
| 17356 | + | |
| 17357 | + | |
| 17358 | + | |
17343 | 17359 |
| |
17344 | 17360 |
| |
17345 | 17361 |
| |
| |||
17356 | 17372 |
| |
17357 | 17373 |
| |
17358 | 17374 |
| |
| 17375 | + | |
| 17376 | + | |
17359 | 17377 |
| |
17360 | 17378 |
| |
17361 | 17379 |
| |
| |||
17622 | 17640 |
| |
17623 | 17641 |
| |
17624 | 17642 |
| |
17625 |
| - | |
17626 |
| - | |
| 17643 | + | |
17627 | 17644 |
| |
17628 | 17645 |
| |
17629 | 17646 |
| |
17630 |
| - | |
17631 |
| - | |
17632 |
| - | |
| 17647 | + | |
| 17648 | + | |
| 17649 | + | |
| 17650 | + | |
| 17651 | + | |
| 17652 | + | |
| 17653 | + | |
| 17654 | + | |
| 17655 | + | |
| 17656 | + | |
| 17657 | + | |
17633 | 17658 |
| |
17634 |
| - | |
| 17659 | + | |
| 17660 | + | |
| 17661 | + | |
17635 | 17662 |
| |
17636 |
| - | |
17637 |
| - | |
17638 |
| - | |
17639 |
| - | |
17640 |
| - | |
| 17663 | + | |
17641 | 17664 |
| |
17642 |
| - | |
17643 |
| - | |
| 17665 | + | |
| 17666 | + | |
| 17667 | + | |
| 17668 | + | |
| 17669 | + | |
| 17670 | + | |
| 17671 | + | |
| 17672 | + | |
| 17673 | + | |
| 17674 | + | |
| 17675 | + | |
| 17676 | + | |
| 17677 | + | |
| 17678 | + | |
| 17679 | + | |
| 17680 | + | |
| 17681 | + | |
| 17682 | + | |
| 17683 | + | |
| 17684 | + | |
| 17685 | + | |
| 17686 | + | |
| 17687 | + | |
| 17688 | + | |
| 17689 | + | |
| 17690 | + | |
17644 | 17691 |
| |
17645 | 17692 |
| |
17646 | 17693 |
| |
17647 | 17694 |
| |
17648 |
| - | |
| 17695 | + | |
17649 | 17696 |
| |
17650 | 17697 |
| |
17651 | 17698 |
| |
| |||
17659 | 17706 |
| |
17660 | 17707 |
| |
17661 | 17708 |
| |
17662 |
| - | |
17663 |
| - | |
17664 | 17709 |
| |
17665 | 17710 |
| |
17666 | 17711 |
| |
|
0 commit comments
Comments
(0)