• Andres Freund's avatar
    Make tbm_add_tuples more efficient by caching the last acccessed page. · f5ae3ba4
    Andres Freund authored
    When adding a large number of tuples to a TID bitmap using
    tbm_add_tuples() sometimes a lot of time was spent looking up a page's
    entry in the bitmap's internal hashtable.
    
    Improve efficiency by caching the last accessed page, while iterating
    over the passed in tuples, hoping consecutive tuples will often be on
    the same page.  In many cases that's a good bet, and in the rest the
    added overhead isn't big.
    
    Discussion: 54479A85.8060309@sigaev.ru
    
    Author: Teodor Sigaev
    Reviewed-By: David Rowley
    f5ae3ba4
tidbitmap.c 28.4 KB