Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ki12C-0001O9-IL for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Nov 2020 20:05:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ki12B-0000fO-94 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Nov 2020 20:04:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ki12A-0000fH-TP for pgsql-hackers@lists.postgresql.org; Wed, 25 Nov 2020 20:04:59 +0000 Received: from mail-ej1-x641.google.com ([2a00:1450:4864:20::641]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ki127-0007qs-VN for pgsql-hackers@postgresql.org; Wed, 25 Nov 2020 20:04:57 +0000 Received: by mail-ej1-x641.google.com with SMTP id lv15so4712500ejb.12 for ; Wed, 25 Nov 2020 12:04:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=wpTTfFmG0QczVaQibas+MVw4YSQWvIG+aGilbdswogI=; b=XhWr0XQTsUkGpSCafcqwYIqz5uos989qlUO2xOA42DoZetENASAv9CUrkTFXelefXa q4eWgf6ksbOwVHVEWP9TIixBbQaQEQQaI/KEaQwNiqRXd5lhBh1px6E4hZSp6GQLMjrD WeLMr05GPfBe4y7VK+ZQj5Q7B4Z0eZLH7TXVy7+ttljxaj0n2UeBUmrqETUSUPuEMLro v8vyK03FsbfaCwYp2ybEcZ/iHMHPzlaQy+IEc/2q+hX59UgZyI2UCm1QRT2rr/OuS6Rk F1ZUB9mQB+08CNij65Z0M5NAp6Ly4U57rTszg03xmhy7asl1QAl1wBchZHnhm2wyL1hJ mPZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wpTTfFmG0QczVaQibas+MVw4YSQWvIG+aGilbdswogI=; b=S4RUeai4yiBYIj3CaMY0C6pUP4hNySs/hjjf479f1GELI7vvTw9m4m7rChnr0U8otS K3V7qsJ5azOHPpVpIkfNms2wPvTuUuxNUQTGIXEndo/bHp4k3OhTwI0MdJ6ovWPWmdch gjqpzT6PBixMsafDY49ySYR8SMGgeQ+CG75hBLq7An76+2QrETAJFoSQliuUQ3cGPpTM B6rtrz4yGgAlZYd2lcrQ1qeqv5Pa+xj3lwqOD+w9pJV6iNZa6rLz9zPHLniuVhocHAqj QP2XipXOLAlCtrU8hBOWIXEF7BQJBCWAq4slpVEr2KwRGN9cnXis9pem5SlVQ7ph5xxJ iKPw== X-Gm-Message-State: AOAM533gYe1JNqFRI9cpKX8TrACAyRPuDm+Gkn+HfZdbyKdU7Y9AHzxp GimlgdxQPumMQaKblZa9+Vt5E3Wp5fJD8IBn+Rvy2gAOMNQ4Vagc4RW41h8o48s/AEfKJczhnAC IRNizKASigscTDPOxXpoEZB0MpzURB2n+XMccnR2B6aXeMAVm3B8bsX6GL3kcq6Tq715xC/CoA6 WY6bM6gJCipscjzqQ7ID/NGKm9eHngOPtuzdk8 X-Google-Smtp-Source: ABdhPJyNPR8+fu7wpbnhrtbluy6ARO2dBe9YIxzsK5+Jl4t2BSQZ53SSoTWBhRz1wLliqTUNf3mbtw== X-Received: by 2002:a17:906:27c2:: with SMTP id k2mr4560456ejc.211.1606334694408; Wed, 25 Nov 2020 12:04:54 -0800 (PST) Received: from [10.137.0.4] (ip-86-49-245-76.net.upcbroadband.cz. [86.49.245.76]) by smtp.gmail.com with ESMTPSA id oh19sm1810701ejb.104.2020.11.25.12.04.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 25 Nov 2020 12:04:53 -0800 (PST) Subject: Re: POC: postgres_fdw insert batching To: "tsunakawa.takay@fujitsu.com" , 'Craig Ringer' Cc: Tomas Vondra , "Andrey V. Lepikhov" , "pgsql-hackers@postgresql.org" , Andres Freund References: <20200628151002.7x5laxwpgvkyiu3q@development> <0300d7df-854b-6f72-1e93-dfbf98f3fc8a@postgrespro.ru> <20200712001101.x65f3hvsanvamtgj@development> From: Tomas Vondra Message-ID: <6358b1e4-7f0a-6e0a-84bf-3cf890fe1073@enterprisedb.com> Date: Wed, 25 Nov 2020 21:04:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/25/20 7:31 AM, tsunakawa.takay@fujitsu.com wrote: > From: Craig Ringer >> I suggest that when developing this, you keep in mind the ongoing >> work on the libpq pipelining/batching enhancements, and also the >> way many interfaces to foreign data sources support asynchronous, >> concurrent operations. > > Yes, thank you, I bear it in mind. I understand it's a feature for > batching multiple kinds of SQL statements like DBC's batch updates. > I haven't followed the libpq pipelining thread very closely. It does seem related, but I'm not sure if it's a good match for this patch, or how far is it from being committable ... > >> I'd argue it's pretty much vital for decent performance when >> talking to a cloud database from an on-prem server for example, or >> any other time that round-trip-time reduction is important. > > Yeah, I'm thinking of the data migration and integration as the > prominent use case. > Well, good that we all agree this is a useful feature to have (in general). The question is whether postgres_fdw should be doing batching on it's onw (per this thread) or rely on some other feature (libpq pipelining). I haven't followed the other thread, so I don't have an opinion on that. Note however we're doing two things here, actually - we're implementing custom batching for postgres_fdw, but we're also extending the FDW API to allow other implementations do the same thing. And most of them won't be able to rely on the connection library providing that, I believe. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company