pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Reduce unnecessary list construction in RelationBuildPartitionDe
Date: Mon, 19 Nov 2018 17:13:23 +0000
Message-ID: <E1gOn6x-0000F5-E4@gemulon.postgresql.org> (raw)

Reduce unnecessary list construction in RelationBuildPartitionDesc.

The 'partoids' list which was constructed by the previous version
of this code was necessarily identical to 'inhoids'.  There's no
point to duplicating the list, so avoid that.  Instead, construct
the array representation directly from the original 'inhoids' list.

Also, use an array rather than a list for 'boundspecs'.  We know
exactly how many items we need to store, so there's really no
reason to use a list.  Using an array instead reduces the number
of memory allocations we perform.

Patch by me, reviewed by Michael Paquier and Amit Langote, the
latter of whom also helped with rebasing.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7ee5f88e650619ee619f7e2854ac50ff59d0b0c7

Modified Files
--------------
src/backend/partitioning/partbounds.c | 66 +++++++++++++++--------------------
src/backend/utils/cache/partcache.c   | 40 ++++++++++++---------
src/include/partitioning/partbounds.h |  5 ++-
3 files changed, 53 insertions(+), 58 deletions(-)



Message-ID: <E1gOn6x-0000F5-E4@gemulon.postgresql.org>
Permalink:  ../E1gOn6x-0000F5-E4@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gOn6x-0000F5-E4@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: rhaas@postgresql.org
  Subject: Re: pgsql: Reduce unnecessary list construction in RelationBuildPartitionDe
  In-Reply-To: <E1gOn6x-0000F5-E4@gemulon.postgresql.org>
  References: <E1gOn6x-0000F5-E4@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