Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYjb6-00010o-Dr for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jan 2018 02:25:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eYjb5-0002xb-J0 for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jan 2018 02:25:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eYjb5-0002x5-44 for pgsql-hackers@lists.postgresql.org; Tue, 09 Jan 2018 02:25:03 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eYjb0-000500-FL for pgsql-hackers@postgresql.org; Tue, 09 Jan 2018 02:25:02 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 494E220719; Mon, 8 Jan 2018 21:24:56 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Mon, 08 Jan 2018 21:24:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=nOQZkK 0o2f6sh4jniNvAwmuUKF1HBkcoFr+ZMJXVcA0=; b=lpncuTR+PJuhN9zKrihWk8 +B2nuRA2alUKpIElwlDehE9rwOHA65qxCpnUwWlpLvlq8bcyMvBTEIKBZBgrGJht 2EnpfFcP83Dw2EyNMrFTw/8pwKFzzApMm1cmtXtpZ10T2qU6ia9uyMBQRJ88bWTF O/aHFz28PNae6vNb89dv4Ypru4PEGqCvrfaFZsbWvBKO+dRQerSkbqlfZm8mCzjz 3tSBbHieRXWZ9YsNy7ummpqH5suGK6PNaJC5wrBc5QYu8GFzCXzJ87ITKhkl+yyg A4Esob7HoWdb11CjgvOOadfdgPpppKudWPd/gJsVpKHXuoSycG5VVfMbx68WiLZQ == X-ME-Sender: Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id EE8DA24788; Mon, 8 Jan 2018 21:24:55 -0500 (EST) Subject: Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions To: Tomas Vondra , PostgreSQL Hackers References: <688b0b7f-2f6c-d827-c27b-216a8e3ea700@2ndquadrant.com> <3530384f-f73a-186a-a728-8eeeb5533a10@2ndquadrant.com> <262cc9df-0d19-3fca-f899-0890bd2cd4be@2ndquadrant.com> From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <47e505c1-9a21-9edf-9a97-e13acce5aa21@2ndquadrant.com> Date: Mon, 8 Jan 2018 21:24:55 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <262cc9df-0d19-3fca-f899-0890bd2cd4be@2ndquadrant.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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? >> I think we need a way to report on how much memory is actually used, >> so the setting can be tuned. Something analogous to log_temp_files >> perhaps. > > Yes, I agree. I'm just about to submit an updated version of the patch > series, that also introduces a few columns pg_stat_replication, tracking > this type of stats (amount of data spilled to disk or streamed, etc.). That seems OK. Perhaps we could bring forward the part of that patch that applies to this feature. That would also help testing *this* feature and determine what appropriate settings are. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services