From: Andres Freund <andres@anarazel.de>
To: Robert Haas <rhaas@postgresql.org>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: Improve memory management for external sorts.
Date: Fri, 18 Mar 2016 11:25:05 -0700
Message-ID: <20160318182505.tfmduy5istafshhp@alap3.anarazel.de> (raw)
In-Reply-To: <E1ageG4-0001Sj-RW@gemulon.postgresql.org>
References: <E1ageG4-0001Sj-RW@gemulon.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
On 2016-03-17 20:11:00 +0000, Robert Haas wrote:
> Improve memory management for external sorts.
>
> Introduce a new memory context which stores tuple data, and reset it
> at the end of each merge pass; this helps avoid memory fragmentation
> and, consequently, overallocation. Also, for the final merge patch,
> eliminate memory context chunk header overhead entirely by allocating
> all of the memory used for buffering tuples during the merge in a
> single chunk. Since this modestly increases the number of tuples we
> can store, grow the memtuples array a bit so that we're less likely to
> run short of slots there.
>
> Peter Geoghegan. Review and testing of patches in this series by
> Jeff Janes, Greg Stark, Mithun Cy, and me.
Cross compiling for windows results in:
/home/andres/src/postgresql/src/backend/utils/sort/tuplesort.c: In function ‘beginmerge’:
/home/andres/src/postgresql/src/backend/utils/sort/tuplesort.c:2695:34: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘int64 {aka long long int}’ [-Wformat=]
elog(LOG, "tape %d initially used %ld KB of %ld KB batch "
^
/home/andres/src/postgresql/src/backend/utils/sort/tuplesort.c:2695:34: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 5 has type ‘int64 {aka long long int}’ [-Wformat=]
config.status: creating src/interfaces/ecpg/include/ecpg_config.h
/home/andres/src/postgresql/src/backend/utils/sort/tuplesort.c: In
function ‘beginmerge’:
/home/andres/src/postgresql/src/backend/utils/sort/tuplesort.c:2695:34:
warning: format ‘%ld’ expects argument of type ‘long int’, but argument
4 has type ‘int64 {aka long long int}’ [-Wformat=]
elog(LOG, "tape %d initially used %ld KB of %ld KB batch "
Which seems like a valid complain on a LLP64 platform (i.e. where long
is 32bit) like windows.
Andres
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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, rhaas@postgresql.org
Subject: Re: pgsql: Improve memory management for external sorts.
In-Reply-To: <20160318182505.tfmduy5istafshhp@alap3.anarazel.de>
References: <E1ageG4-0001Sj-RW@gemulon.postgresql.org> <20160318182505.tfmduy5istafshhp@alap3.anarazel.de>
* 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