pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Alexander Pyhalov <a.pyhalov@postgrespro.ru>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: postgres_fdw batching vs. (re)creating the tuple slots
Date: Wed, 16 Jun 2021 23:55:17 +0200
Message-ID: <0079c3ee-4645-2cab-50a1-50d0d7152b66@enterprisedb.com> (raw)
In-Reply-To: <f5c7b426-b112-8a72-0271-2eb21f3123ac@enterprisedb.com>
References: <ebbbcc7d-4286-8c28-0272-61b4753af761@enterprisedb.com>
	<20210530205831.vib4p7mt23cymhpc@alap3.anarazel.de>
	<2399204.1622409059@sss.pgh.pa.us>
	<20210530212616.5k5nxnbunwnwet2a@alap3.anarazel.de>
	<2433405.1622416631@sss.pgh.pa.us>
	<a3233163-829d-94a0-7ca0-87bdfde92c90@enterprisedb.com>
	<4e7ebff8-59ac-c90c-3ecd-8d9dfdfc75ad@enterprisedb.com>
	<6dc1c07b-87e6-63e6-10b3-cca4698361fb@enterprisedb.com>
	<CALj2ACWC8ecAZz5hOVh7vf+82s3_t8HKoMjQFbuncT+a4jn+vQ@mail.gmail.com>
	<ec1c620f-b9ff-26ac-6848-6e39f0a72f6e@enterprisedb.com>
	<cdff37d6-c57c-e40c-4635-4bcaeccd0d7d@enterprisedb.com>
	<7a8cf8d56b3d18e5c0bccd6cd42d04ac@postgrespro.ru>
	<f5c7b426-b112-8a72-0271-2eb21f3123ac@enterprisedb.com>

On 6/16/21 4:23 PM, Tomas Vondra wrote:
> On 6/16/21 2:36 PM, Alexander Pyhalov wrote:
>>
>> Hi.
>> It seems this commit
>>
>> commit b676ac443b6a83558d4701b2dd9491c0b37e17c4
>> Author: Tomas Vondra <tomas.vondra@postgresql.org>
>> Date:   Fri Jun 11 20:19:48 2021 +0200
>>
>>      Optimize creation of slots for FDW bulk inserts
>>
>> has broken batch insert for partitions with unique indexes.
>>
> 
> Thanks for the report and reproducer!
> 
> Turns out this is a mind-bogglingly silly bug I made in b676ac443b :-( 
> The data is copied into the slots only in the branch that initializes 
> them, so the subsequent batches just insert the same data over and over.
> 
> The attached patch fixes that, and adds a regression test (a bit smaller 
> version of your reproducer). I'll get this committed shortly.
> 

Pushed, after a bit more cleanup and testing.


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company





view thread (15+ messages)

Message-ID: <0079c3ee-4645-2cab-50a1-50d0d7152b66@enterprisedb.com>
Permalink:  ../0079c3ee-4645-2cab-50a1-50d0d7152b66@enterprisedb.com/
Also on:    postgresql.org/message-id/0079c3ee-4645-2cab-50a1-50d0d7152b66@enterprisedb.com

 · 

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-hackers@postgresql.org
  Cc: tomas.vondra@enterprisedb.com, a.pyhalov@postgrespro.ru, bharath.rupireddyforpostgres@gmail.com, tgl@sss.pgh.pa.us, andres@anarazel.de
  Subject: Re: postgres_fdw batching vs. (re)creating the tuple slots
  In-Reply-To: <0079c3ee-4645-2cab-50a1-50d0d7152b66@enterprisedb.com>
  References: <ebbbcc7d-4286-8c28-0272-61b4753af761@enterprisedb.com> <20210530205831.vib4p7mt23cymhpc@alap3.anarazel.de> <2399204.1622409059@sss.pgh.pa.us> <20210530212616.5k5nxnbunwnwet2a@alap3.anarazel.de> <2433405.1622416631@sss.pgh.pa.us> <a3233163-829d-94a0-7ca0-87bdfde92c90@enterprisedb.com> <4e7ebff8-59ac-c90c-3ecd-8d9dfdfc75ad@enterprisedb.com> <6dc1c07b-87e6-63e6-10b3-cca4698361fb@enterprisedb.com> <CALj2ACWC8ecAZz5hOVh7vf+82s3_t8HKoMjQFbuncT+a4jn+vQ@mail.gmail.com> <ec1c620f-b9ff-26ac-6848-6e39f0a72f6e@enterprisedb.com> <cdff37d6-c57c-e40c-4635-4bcaeccd0d7d@enterprisedb.com> <7a8cf8d56b3d18e5c0bccd6cd42d04ac@postgrespro.ru> <f5c7b426-b112-8a72-0271-2eb21f3123ac@enterprisedb.com> <0079c3ee-4645-2cab-50a1-50d0d7152b66@enterprisedb.com>

* 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