pgsql: Avoid redundant checks in partition_bounds_copy().

From: Etsuro Fujita <efujita(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid redundant checks in partition_bounds_copy().
Date: 2020-02-21 11:03:49
Message-ID: E1j5661-0000nM-Ks@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid redundant checks in partition_bounds_copy().

Previously, partition_bounds_copy() checked whether the strategy for the
given partition bounds was hash or not, and then determined the number of
elements in the datums in the datums array for the partition bounds, on
each iteration of the loop for copying the datums array, but there is no
need to do that. Perform the checks only once before the loop iteration.

Author: Etsuro Fujita
Reported-by: Amit Langote and Julien Rouhaud
Discussion: https://postgr.es/m/CAPmGK14Rvxrm8DHWvCjdoks6nwZuHBPvMnWZ6rkEx2KhFeEoPQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/032f9ae012d87c730be0e261a6bae9323c2b2d6c

Modified Files
--------------
src/backend/partitioning/partbounds.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2020-02-21 17:48:27 pgsql: Fixup for nodeAgg.c refactor.
Previous Message Peter Eisentraut 2020-02-21 08:28:06 pgsql: Require stdint.h