Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Yiq5I-0004KC-1c for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Apr 2015 20:08:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Yiq5H-0004Di-FW for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Apr 2015 20:08:23 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YijIn-0001wo-4R for pgsql-bugs@postgresql.org; Thu, 16 Apr 2015 12:53:53 +0000 Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YijIf-0003Oc-6p for pgsql-bugs@postgresql.org; Thu, 16 Apr 2015 12:53:50 +0000 Received: by wgso17 with SMTP id o17so79806496wgs.1 for ; Thu, 16 Apr 2015 05:53:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:organization:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=jH/lPDWkiYTFO95B1Xkd+frFL5KbAci0zdTSUhTBjwA=; b=T2jbAyZxcIqgB/z2Lpyzzoke5xL6FCxcMwwHE4WzN+FLvu1IymNL045/+Sb06EN7O3 RnGXZRrwJDyo8t0ofLDSLMjYROME4zv5OIbpCGCoWoJTrT/Fv2+SbRZr2YgMUfr0Vqk1 a0CeC06kWjH9aTacv6FRtsVRcTOxItaNmdr194mcyIyU5nPQMxAAP0mFKubVS4zBm+E+ zqLZwtdJkMzYeP/BlNfad1r2uVi2dFFNoNK9IF4Iosvp6nzdTo1228XuFJJn1ENchR2Z u2hqDRHHql3CIpnTQmtSM4fbyrGOET4b7+bl3A52EcGSeDETgsClfbviHsJduPzvrGJe hQSA== X-Received: by 10.194.47.165 with SMTP id e5mr58790176wjn.128.1429188823066; Thu, 16 Apr 2015 05:53:43 -0700 (PDT) Received: from [192.168.1.7] ([92.247.26.34]) by mx.google.com with ESMTPSA id df1sm25960379wib.12.2015.04.16.05.53.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Apr 2015 05:53:42 -0700 (PDT) Message-ID: <552FB0D4.1060401@gmail.com> Date: Thu, 16 Apr 2015 15:53:40 +0300 From: Peter Slavov Organization: sumup User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Icedove/36.0 MIME-Version: 1.0 To: Andres Freund CC: pgsql-bugs@postgresql.org Subject: Re: BUG #12910: Memory leak with logical decoding References: <20150327094757.2488.58808@wrigleys.postgresql.org> <20150331144048.GL4878@alap3.anarazel.de> <55227D87.9080007@gmail.com> <20150406135026.GJ17586@awork2.anarazel.de> <5526969F.4050704@gmail.com> <20150409173455.GE9764@awork2.anarazel.de> In-Reply-To: <20150409173455.GE9764@awork2.anarazel.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Hi, Can you tell me, at which point after testing this can me included in some branch and after in some officials PostgreSQL version ? Regards, Peter Slavov На 9.04.2015 в 20:34, Andres Freund написа: > Hi, > > On 2015-04-09 18:11:27 +0300, Peter Slavov wrote: >> I prepared a test case, that can reproduce the problem. > Yup. I can reproduce it... I did not (yet) have the time to run the test > to completion, but i believe the attached patch should fix the problem > (and also improve performance a bit...). > > Using the SQL interface for such large transactions isn't going to be > fun as all of the data, due to the nature of the set returning function > implementation in postgres, will be additionally written into a > tuplestore. The streaming interface doesn't have that behaviour. > > Additionally it's probably not a good idea to stream such a large > resultset via SELECT using psql - IIRC it'll try to store all that data > in memory :). Try something like > \copy (select * from pg_logical_slot_peek_changes('testing', null, 1)) TO /tmp/f > or such. > > Greetings, > > Andres Freund -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs