diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-01-26 15:20:22 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-01-26 15:20:30 -0500 |
commit | cc988fbb0bf60a83b628b5615e6bade5ae9ae6f4 (patch) | |
tree | 406d462838cc8bb05376801802de58d8bef4d631 /contrib/postgres_fdw/postgres_fdw.h | |
parent | 879d71393de001880e031255e41ca322c6027713 (diff) | |
download | postgresql-cc988fbb0bf60a83b628b5615e6bade5ae9ae6f4.tar.gz postgresql-cc988fbb0bf60a83b628b5615e6bade5ae9ae6f4.zip |
Improve ResourceOwners' behavior for large numbers of owned objects.
The original coding was quite fast so long as objects were always
released in reverse order of addition; otherwise, it degenerated into
O(N^2) behavior due to searching for the array element to delete.
Improve matters by switching to hashed storage when the number of
objects of a given type exceeds 64. (The cutover point is open to
discussion, of course, but some simple performance testing suggests
that hashing has enough overhead to be a loser below there.)
Also, refactor resowner.c so that we don't need N copies of the array
management code. Since all the resource IDs the code currently needs
to deal with are either pointers or integers, it seems sufficient to
create a one-size-fits-all infrastructure in which everything is
converted to a Datum for storage.
Aleksander Alekseev, reviewed by Stas Kelvich, further fixes by me
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.h')
0 files changed, 0 insertions, 0 deletions