pgsql: Make tbm_add_tuples more efficient by caching the last acccessed

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Make tbm_add_tuples more efficient by caching the last acccessed
Date: 2015-01-16 16:50:29
Message-ID: E1YCA6P-0005mW-Dd@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Make tbm_add_tuples more efficient by caching the last acccessed page.

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(dot)8060309(at)sigaev(dot)ru

Author: Teodor Sigaev
Reviewed-By: David Rowley

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/f5ae3ba4828ece02bae2d16b4cbce847fbcea850

Modified Files
--------------
src/backend/nodes/tidbitmap.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-01-16 17:05:02 Re: pgsql: Another attempt at fixing Windows Norwegian locale.
Previous Message Tom Lane 2015-01-16 14:17:05 Re: pgsql: Another attempt at fixing Windows Norwegian locale.