pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <kgrittn@postgresql.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Improve performance in freeing memory contexts
Date: Tue, 08 Dec 2015 23:36:25 +0000
Message-ID: <E1a6Ro1-0003VL-Eh@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Improve performance in freeing memory contexts

The single linked list of memory contexts could result in O(N^2)
performance to free a set of contexts if they were not freed in
reverse order of creation.  In many cases the reverse order was
used, but there were some significant exceptions that caused real-
world performance problems.  Rather than requiring all callers to
care about the order in which contexts were freed, and hunting down
and changing all existing cases where the wrong order was used, we
add one pointer per memory context so that the implementation
details are not so visible.

Jan Wieck

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/25c539233044c235e97fd7c9dc600fb5f08fe065

Modified Files
--------------
src/backend/utils/mmgr/mcxt.c |   26 ++++++++++++++------------
src/include/nodes/memnodes.h  |    1 +
2 files changed, 15 insertions(+), 12 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: <E1a6Ro1-0003VL-Eh@gemulon.postgresql.org>
Permalink:  ../E1a6Ro1-0003VL-Eh@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1a6Ro1-0003VL-Eh@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: kgrittn@postgresql.org
  Subject: Re: pgsql: Improve performance in freeing memory contexts
  In-Reply-To: <E1a6Ro1-0003VL-Eh@gemulon.postgresql.org>
  References: <E1a6Ro1-0003VL-Eh@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