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 1l2OVm-0008T3-0Q for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Jan 2021 01:11:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l2OVk-0007Vm-Nn for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Jan 2021 01:11:44 +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 1l2OVk-0007Ve-GQ for pgsql-hackers@lists.postgresql.org; Thu, 21 Jan 2021 01:11:44 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l2OVd-0002WQ-93 for pgsql-hackers@postgresql.org; Thu, 21 Jan 2021 01:11:43 +0000 Received: by mail-ed1-x530.google.com with SMTP id s11so533685edd.5 for ; Wed, 20 Jan 2021 17:11:36 -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=fL327egVF1qGnx7tnOaN5I/YLrk1NTyMo7+Q4zvLwlo=; b=ijmMZ1clqBLfX4Pit7Li448DZNvepfzd1/94LtuEeA7ZwzlLHvzUAYjra8f0j9/qyU AenypSQrEszN3gFXXWjXOSnjG1KkN8T23jBWlDvwYSTXHhZ8Ff6dDQ+zErcQSOhFO5k2 3RcXqbSeOrYNfj7vdfeh3yyulhpJeo066YXbZ4egvzhKkM044Ttz7Wx+9HXUDyCCvQRL 2lggZxiKs093/EaA2izVA5qfcGX/70/oP1u4xCMq0Nr8OimcovJvcB2wxFxIURu+q1ZS N795/FxXrvySJKEMRmuj1U4tXrSIg9dQ9V6Ugqs9nj645xCDXSFHZRI11MtG7st/35gA raGg== 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=fL327egVF1qGnx7tnOaN5I/YLrk1NTyMo7+Q4zvLwlo=; b=sMhwchUF63jLngveTMma8em7d+P7s1FVQX2yHxuqwTt03NOVzLA0Do0gFXtJRTm39+ kGkeERCnReHrLXvAecGVzXHWXnulVESaFs23ea6cC+BhO8XJb2hNVrawhmn18Hk3LKET 7iWqwT1QF2IHj0y8qM1RFMJQ5sWvT7hKHVsVYnfZ7yj6ZNgIueg7VPxtHMKiYShYMciX dsPLI1S2+Lu2ca1lXFTYvclPP4+E2owOJCLCnchTFscBvnUXYtQgakqefknhoebIALZ2 LnJ1DhENuYGoYn5JAg5fTrUu252SqJXAQAf0qx3+uP+ivZvFVyP9QmCVVqMtkGXWfY+H 82hg== X-Gm-Message-State: AOAM532N7Wg1fKv+cw1MwRo+L1kEgdFzBiDKLgz5jOf/K0X30KSOqmUp kwOVLiW4UE8aPy1sSp4ynWETI84/zT0TioeRyZmVDHM13WTCa80h32XW70FVwUb1DR5jCz8hkbg FnYS+NVfWlgIHt7huyjtSWaLnfu4lyrXUEKXrLZZkqnRbWTcgQO/XGfcXRDL0mMQiHD08U5+Qxs llfcwbj461hRimXO9q1SuKA+KPdhNfzjU5jHiNIfVrMbI67jgxPpUbgmzFsY7bZuL8J7y4WzarG dUieV+WMXzdr56G8GArbA/Y0WEP80TQJkBc+w== X-Google-Smtp-Source: ABdhPJxY+S10a0GAPnhdC2ucFppLTL+27Z1vFEQNlkRAFXbEx15za1qm7WADfask31SLPzLWtTE45w== X-Received: by 2002:aa7:c94a:: with SMTP id h10mr9170204edt.247.1611191495230; Wed, 20 Jan 2021 17:11:35 -0800 (PST) Received: from [10.137.0.20] (ip-86-49-253-127.net.upcbroadband.cz. [86.49.253.127]) by smtp.gmail.com with ESMTPSA id w17sm1522850ejk.124.2021.01.20.17.11.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Jan 2021 17:11:34 -0800 (PST) Subject: Re: POC: postgres_fdw insert batching To: Zhihong Yu Cc: Amit Langote , "tsunakawa.takay@fujitsu.com" , "Andrey V. Lepikhov" , Tomas Vondra , "pgsql-hackers@postgresql.org" References: <20200628151002.7x5laxwpgvkyiu3q@development> <16fcfd4c-2d5e-67f7-fa69-9b5d119bac52@enterprisedb.com> <9d94c863-ce7c-ea7f-6b84-834c98929e2f@enterprisedb.com> <7e70a11e-cf5d-2e5f-a802-274c5e0e236b@enterprisedb.com> <3ca9496f-0827-bf21-b709-593de63440a5@enterprisedb.com> From: Tomas Vondra Message-ID: <4fd4ce5f-d940-065d-6476-db84163fb14e@enterprisedb.com> Date: Thu, 21 Jan 2021 02:11:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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 1/21/21 2:02 AM, Zhihong Yu wrote: > Hi, Tomas: > In my opinion, my patch is a little better. > Suppose one of the conditions in the if block changes in between the > start of loop and the end of the loop: > >      * Determine if the FDW supports batch insert and determine the batch >      * size (a FDW may support batching, but it may be disabled for the >      * server/table). > > My patch would reflect that change. I guess this was the reason the if / > else block was placed there in the first place. > But can it change? All the loop does is extracting junk attributes from the plans, it does not modify anything related to the batching. Or maybe I just don't understand what you mean. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company