Cache the most recent region lookup.
authorRobert Haas <rhaas@postgresql.org>
Fri, 13 Jun 2014 16:24:21 +0000 (16:24 +0000)
committerRobert Haas <rhaas@postgresql.org>
Fri, 13 Jun 2014 16:24:21 +0000 (16:24 +0000)
commit327878af93bacd5b73432865776784d1363dbae0
tree7f8ee9b86af3d053ccf1b6b497c94d883932abc4
parent0fbb28dbcf6d5c4361dc84b800f9cc14657548a3
Cache the most recent region lookup.

The general value of this is debatable, because access could be pretty
random across a large number of regions.  But the sort code, for example,
likes to ask about chunks of memory that were just recently allocated
or are about to be freed, so this will help there, too.  And it helps
a lot if someone (say) builds a linked list and then frees the elements
in order.
src/backend/utils/mmgr/aregion.c