• Tom Lane's avatar
    Change hash indexes to store only the hash code rather than the whole indexed · 4adc2f72
    Tom Lane authored
    value.  This means that hash index lookups are always lossy and have to be
    rechecked when the heap is visited; however, the gain in index compactness
    outweighs this when the indexed values are wide.  Also, we only need to
    perform datatype comparisons when the hash codes match exactly, rather than
    for every entry in the hash bucket; so it could also win for datatypes that
    have expensive comparison functions.  A small additional win is gained by
    keeping hash index pages sorted by hash code and using binary search to reduce
    the number of index tuples we have to look at.
    
    Xiao Meng
    
    This commit also incorporates Zdenek Kotala's patch to isolate hash metapages
    and hash bitmaps a bit better from the page header datastructures.
    4adc2f72
hash.c 18.5 KB