• Tom Lane's avatar
    When creating a large hash index, pre-sort the index entries by estimated · 787eba73
    Tom Lane authored
    bucket number, so as to ensure locality of access to the index during the
    insertion step.  Without this, building an index significantly larger than
    available RAM takes a very long time because of thrashing.  On the other
    hand, sorting is just useless overhead when the index does fit in RAM.
    We choose to sort when the initial index size exceeds effective_cache_size.
    
    This is a revised version of work by Tom Raney and Shreya Bhargava.
    787eba73
hashsort.c 2.91 KB