Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDoNQ-0006PT-As for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2019 11:25:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iDoNN-0006do-DZ for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2019 11:25:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDoNN-0006dT-1u for pgsql-hackers@lists.postgresql.org; Fri, 27 Sep 2019 11:25:29 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iDoNJ-00058h-T0 for pgsql-hackers@postgresql.org; Fri, 27 Sep 2019 11:25:27 +0000 Received: by mail-wr1-x443.google.com with SMTP id v8so2326799wrt.2 for ; Fri, 27 Sep 2019 04:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=+uMEb+230G1J6hSE+C4ONfOsO7yYlTn+zKZWBGpKWp8=; b=2OXTLr0d32kFSpHOg1GgkBDcyJRLnevjRQh5MutdUChmHJp8GgjKryNMMaRs8C1UJ0 PkB406TWS6vgYRdpDnLh6Globu9FBYTYFpA2a6p4bYhgV2B1yDh6NwgpkOu2C5ftvLWQ 0wzEZDCi+Jr/9vzcL2IfiNtCOhlOhFbuDFNm+65UlwPlnmhYVyviJEDUHDPMCkI4Ur/a 4pw1Wvochk1AwtvvFn7wC5fgLtP6TRE3k3CDq31HyTZT0p0qxyHy8L2VVzHSxykFfANX SVClF2zzE46oGzRtvjgGwbNovGRYBITvKsi/I+I8btkpu/IuTfzHet6l0NgpamOTivxk gY0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=+uMEb+230G1J6hSE+C4ONfOsO7yYlTn+zKZWBGpKWp8=; b=X/jtkXXn+gk/rfGiY4SwKNkMQZi0sT+ehsbKyihczmaNRuTPQkr86UpSCNl3oIwA4G /D3tuKJdVaaq1Zf0crTA2xBM8+bsDp5LBu5ELibP8PrxkovZbEG9t6s5atmCi2xPfOOr b4Oem6xYEPAvfQv90vHBqx1t1+LagBh6hDYe0FD9XcNPlPvuSbioFjEp12/jGPVJM7Vw YcLtAxwPgEDsC6dxTsk5fq2TBdOcx29h0+WvjhMbebinDRrsNgQIKWakGgvHXhZY1q4L bCTQ+Ng+pbHLl5SFPVH0olpipn+xg8nx1VR8GXTC0x48ihLAtLktFWnUHO3G+K2PUbQM 7WUA== X-Gm-Message-State: APjAAAXVHSx3+NeBErv/SPbUG42KWvESxW9kHz8Zlv4Aboz/0S9ZL1Uk 0WeiHXjP7yEqgChYXp8J4KwODA== X-Google-Smtp-Source: APXvYqyo+tUdU4vFJh1d0/f9m5wBolEDDyYiErFJiWZ3n25Kp02znS2H79KqM7cVLGfvXXvvCCUslQ== X-Received: by 2002:adf:9083:: with SMTP id i3mr2530581wri.310.1569583524141; Fri, 27 Sep 2019 04:25:24 -0700 (PDT) Received: from localhost (static-84-42-175-93.net.upcbroadband.cz. [84.42.175.93]) by smtp.gmail.com with ESMTPSA id g11sm5926527wmh.45.2019.09.27.04.25.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2019 04:25:22 -0700 (PDT) Date: Fri, 27 Sep 2019 13:25:20 +0200 From: Tomas Vondra To: Amit Kapila Cc: Peter Eisentraut , PostgreSQL Hackers Subject: Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions Message-ID: <20190927112520.3kco6tqbhcvlk6cd@development> References: <688b0b7f-2f6c-d827-c27b-216a8e3ea700@2ndquadrant.com> <3530384f-f73a-186a-a728-8eeeb5533a10@2ndquadrant.com> <262cc9df-0d19-3fca-f899-0890bd2cd4be@2ndquadrant.com> <47e505c1-9a21-9edf-9a97-e13acce5aa21@2ndquadrant.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Sep 27, 2019 at 02:33:32PM +0530, Amit Kapila wrote: >On Tue, Jan 9, 2018 at 7:55 AM Peter Eisentraut > wrote: >> >> On 1/3/18 14:53, Tomas Vondra wrote: >> >> I don't see the need to tie this setting to maintenance_work_mem. >> >> maintenance_work_mem is often set to very large values, which could >> >> then have undesirable side effects on this use. >> > >> > Well, we need to pick some default value, and we can either use a fixed >> > value (not sure what would be a good default) or tie it to an existing >> > GUC. We only really have work_mem and maintenance_work_mem, and the >> > walsender process will never use more than one such buffer. Which seems >> > to be closer to maintenance_work_mem. >> > >> > Pretty much any default value can have undesirable side effects. >> >> Let's just make it an independent setting unless we know any better. We >> don't have a lot of settings that depend on other settings, and the ones >> we do have a very specific relationship. >> >> >> Moreover, the name logical_work_mem makes it sound like it's a logical >> >> version of work_mem. Maybe we could think of another name. >> > >> > I won't object to a better name, of course. Any proposals? >> >> logical_decoding_[work_]mem? >> > >Having a separate variable for this can give more flexibility, but >OTOH it will add one more knob which user might not have a good idea >to set. What are the problems we see if directly use work_mem for >this case? > IMHO it's similar to autovacuum_work_mem - we have an independent setting, but most people use it as -1 so we use maintenance_work_mem as a default value. I think it makes sense to do the same thing here. It does ad an extra knob anyway (I don't think we should just use maintenance_work_mem directly, the user should have an option to override it when needed). But most users will not notice. FWIW I don't think we should use work_mem, maintenace_work_mem seems somewhat more appropriate here (not related to queries, etc.). >If we can't use work_mem, then I think the name proposed by you >(logical_decoding_work_mem) sounds good to me. > Yes, that name seems better. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services