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 1nTjSB-00038z-FV for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Mar 2022 12:05:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nTjSA-0004kJ-AF for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Mar 2022 12:05:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nTjS9-0004kA-Mq for pgsql-hackers@lists.postgresql.org; Mon, 14 Mar 2022 12:05:34 +0000 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nTjS5-0000uE-I8 for pgsql-hackers@postgresql.org; Mon, 14 Mar 2022 12:05:33 +0000 Received: by mail-ej1-x62a.google.com with SMTP id qx21so33303286ejb.13 for ; Mon, 14 Mar 2022 05:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=DS5xToOMKj1gD9GId0HoYlSMaA2JFq9bFssEWi19JF0=; b=S7OMWUVIMgl1hlXjh5OG+Z7XcUzDk+1tIctuES530H1WVa/uI7wElVl+UXEN/Qlahf zfHRS42QP8l78MZq1RBE8tORMbVmZmles9c6pYciZvbOu5e6LhEkvAtjPxW9bxKNWQc7 Aarz4LorDn8GZrtlOepYUyUIEGqasswsgMK6Qeanz3SKWMqWi5lvW7RCGMeaGqu9TkGX fIksPzALmocfeXSiOFDXIRo8LuJAoNwgfnp1aTeXUF4Uabuv6E4lSVdJRCOt9qhfs+rm I/gS2DJWZp8NzPasuym4DdmjJsJ/4Ou4PaRSH8EPg9r1hMMqU2ZhN/eHNjzWB/q3u4aM Xqig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=DS5xToOMKj1gD9GId0HoYlSMaA2JFq9bFssEWi19JF0=; b=EN8dzYDHlKa2SGgCCdzb1exgGTnd1ZI8A8pEtj2cly5BCevg8kmfpBE92wbjVIWaYe FB4cETwYMc7ZU9B1UdmCTQ5VDSdC4Pk4xs44evtdQyOHuxJYOI0CGs3lVt4EQBKaVuLN eph3z/ii4+3L/WjvLPc6wS/P5I7s+QR8ovcSqDCl/EFiIvSbln92sLSxWe2VnvIYIBf2 pwBmehN7ps/gDu8AtsB1CK5MtyKNPzpWpA2YeMLO2NnkQj6Bq3U5tdSTFI95NVfDWoZX frdZ5N7AMHejJf9mKM6eUD5Lt240566Svi/xibm/UbS9aAx/4EekJZQfDL82e/FFzGYA KRZQ== X-Gm-Message-State: AOAM531piTZc1UYdNXmd05qLOf0lUrHt045eFBXGlgPxhsHHNImhilG9 UppxZboEpuVwh1dpmO8wAxIaeORPTvj7RbNv4K66zc2m3aRTkgueofTBpsXMAYQoJjOdtT7WDAQ ICquliDCKfufROitAh9F6FTpQqtALpbN0dtad+GW7bH33dBKracIiIOOJVldEzC0BhXVTsDHjd8 1G4m1YTfx2UVgHQGZNUd/VZVdDT833+lrPvVXd X-Google-Smtp-Source: ABdhPJx4rwSlppliPyAMM61ZfUp/dHlPmZQaLuS/H8loSOnuV/n7idHzY8kYofQP9a7U0XSfAUsT+A== X-Received: by 2002:a17:906:4783:b0:6d0:9b6e:b5a5 with SMTP id cw3-20020a170906478300b006d09b6eb5a5mr19327835ejc.526.1647259527198; Mon, 14 Mar 2022 05:05:27 -0700 (PDT) Received: from [10.137.0.18] (ip-86-49-251-241.net.upcbroadband.cz. [86.49.251.241]) by smtp.gmail.com with ESMTPSA id lk10-20020a170906cb0a00b006da92317793sm6666696ejb.131.2022.03.14.05.05.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Mar 2022 05:05:26 -0700 (PDT) Message-ID: <0f61e2ba-c604-e682-8265-5a609aa890ba@enterprisedb.com> Date: Mon, 14 Mar 2022 13:05:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: Column Filtering in Logical Replication Content-Language: en-US To: Amit Kapila Cc: "houzj.fnst@fujitsu.com" , Peter Eisentraut , Alvaro Herrera , Justin Pryzby , Rahila Syed , Peter Smith , pgsql-hackers , "shiy.fnst@fujitsu.com" References: <202201120041.p24wvsfcsope@alvherre.pgsql> <78b8d385-57cb-9a3f-cfe5-9f300f15eced@enterprisedb.com> <822a8e40-287c-59ff-0ea9-35eb759f4fe6@enterprisedb.com> <2b8471f9-3849-c91f-ef82-9181d4bca0a7@enterprisedb.com> <16e83ce3-8415-b732-37b2-c3329a2c13a1@enterprisedb.com> From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 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: Archived-At: Precedence: bulk On 3/14/22 10:53, Amit Kapila wrote: > On Mon, Mar 14, 2022 at 2:37 AM Tomas Vondra > wrote: >> >> On 3/12/22 05:30, Amit Kapila wrote: >>>> ... >>> >>> Okay, please find attached. I have done basic testing of this, if we >>> agree with this approach then this will require some more testing. >>> >> >> Thanks, the proposed changes seem like a clear improvement, so I've >> added them, with some minor tweaks (mostly to comments). >> > > One minor point: Did you intentionally remove > list_free(rel_publications) before resetting the list from the second > patch? The memory for rel_publications is allocated in > TopTransactionContext, so a large transaction touching many relations > will only free this at end of the transaction which may not be a big > deal as we don't do this every time. We free this list a few lines > down in successful case so this appears slightly odd to me but I am > fine if you think it doesn't matter. The removal was not intentional, but I don't think it's an issue exactly because it's a tiny mount of memory and we'll release it at the end of the transaction. Which should not take long. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company