pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Subject: pgsql: Make tbm_add_tuples more efficient by caching the last acccessed
Date: Fri, 16 Jan 2015 16:50:29 +0000
Message-ID: <E1YCA6P-0005mW-Dd@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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.8060309@sigaev.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(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1YCA6P-0005mW-Dd@gemulon.postgresql.org>
Permalink:  ../E1YCA6P-0005mW-Dd@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1YCA6P-0005mW-Dd@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: Make tbm_add_tuples more efficient by caching the last acccessed
  In-Reply-To: <E1YCA6P-0005mW-Dd@gemulon.postgresql.org>
  References: <E1YCA6P-0005mW-Dd@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox