forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitcc988fb
committed
Improve ResourceOwners' behavior for large numbers of owned objects.
The original coding was quite fast so long as objects were alwaysreleased in reverse order of addition; otherwise, it degenerated intoO(N^2) behavior due to searching for the array element to delete.Improve matters by switching to hashed storage when the number ofobjects of a given type exceeds 64. (The cutover point is open todiscussion, of course, but some simple performance testing suggeststhat hashing has enough overhead to be a loser below there.)Also, refactor resowner.c so that we don't need N copies of the arraymanagement code. Since all the resource IDs the code currently needsto deal with are either pointers or integers, it seems sufficient tocreate a one-size-fits-all infrastructure in which everything isconverted to a Datum for storage.Aleksander Alekseev, reviewed by Stas Kelvich, further fixes by me1 parent879d713 commitcc988fb
File tree
2 files changed
+446
-512
lines changed- src/backend
- access/hash
- utils/resowner
2 files changed
+446
-512
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
297 | 297 |
| |
298 | 298 |
| |
299 | 299 |
| |
| 300 | + | |
| 301 | + | |
| 302 | + | |
300 | 303 |
| |
301 | 304 |
| |
302 | 305 |
| |
|
0 commit comments
Comments
(0)