Change hash index creation so that rather than always establishing exactly
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 15 Mar 2008 20:46:31 +0000 (20:46 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 15 Mar 2008 20:46:31 +0000 (20:46 +0000)
commita4d2e19e4eedeabb0187e3e9b3f9c6e12f10a455
tree1363764fa137ad1669317300bddd98655a39ff44
parentaad05c328511b2de5dd29e9ac56f079bb496a83c
Change hash index creation so that rather than always establishing exactly
two buckets at the start, we create a number of buckets appropriate for the
estimated size of the table.  This avoids a lot of expensive bucket-split
actions during initial index build on an already-populated table.

This is one of the two core ideas of Tom Raney and Shreya Bhargava's patch
to reduce hash index build time.  I'm committing it separately to make it
easier for people to test the effects of this separately from the effects
of their other core idea (pre-sorting the index entries by bucket number).
src/backend/access/hash/README
src/backend/access/hash/hash.c
src/backend/access/hash/hashpage.c
src/backend/optimizer/util/plancat.c
src/include/access/hash.h
src/include/optimizer/plancat.h