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 1i3jJQ-00068h-BK for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Aug 2019 15:59:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i3jJN-0002Fl-5k for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Aug 2019 15:59:41 +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 1i3jJM-0002Ca-Ok for pgsql-hackers@lists.postgresql.org; Fri, 30 Aug 2019 15:59:40 +0000 Received: from cyclops.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1i3jJI-0001b5-AT for pgsql-hackers@postgresql.org; Fri, 30 Aug 2019 15:59:39 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 5A50C21C40F9; Fri, 30 Aug 2019 18:59:33 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.27.200] (gw.postgrespro.ru [93.174.131.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 1965821C40C8; Fri, 30 Aug 2019 18:59:33 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1567180773; bh=5WeuSxczaAjEBNRDk+6m/OSvw0aaRFAgKPNRr9OQDRA=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=Vxf0/Hd4WDEIsXgb1R1zP1R7Wdqka/f9AKwOQ6Mtxfd+v+A8Jg4THezwpTUiAeCwm 7ckTSpSKa+h126DDg0ftxwfcmJnNTDkLAIaDHIBi8yfdwBol4ZVaFNlnaeRPpixMwX yVynL1mIDXC5vdL4WwKr6NExyQVAHVU2Ae/qEHdQ= Subject: Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions To: Tomas Vondra , Alexey Kondratov Cc: Peter Eisentraut , Erik Rijkers , Masahiko Sawada , PostgreSQL Hackers References: <8940f374-6651-26d0-cefe-6c719454b6fe@2ndquadrant.com> <40c38758-04b5-74f4-c963-cf300f9e5dff@postgrespro.ru> <126e3a30-a7f5-ede4-2bd0-b217749c8b33@postgrespro.ru> <8eda5118-2dd0-79a1-4fe9-eec7e334de17@postgrespro.ru> <20190828190646.s3bjs22urff32k56@development> <20190829184824.kmrbchrk2ged6vjw@development> From: Konstantin Knizhnik Message-ID: <322e40c4-8ca7-6c34-2544-28a6d95989c2@postgrespro.ru> Date: Fri, 30 Aug 2019 18:59:32 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190829184824.kmrbchrk2ged6vjw@development> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > > FWIW my understanding is that the speedup comes mostly from > elimination of > the serialization to a file. That however requires savepoints to handle > aborts of subtransactions - I'm pretty sure I'd be trivial to create a > workload where this will be much slower (with many aborts of large > subtransactions). > > I think that instead of defining savepoints it is simpler and more efficient to use BeginInternalSubTransaction + ReleaseCurrentSubTransaction/RollbackAndReleaseCurrentSubTransaction as it is done in PL/pgSQL (pl_exec.c). Not sure if it can pr -- Konstantin Knizhnik Postgres Professional: http://www.postgrespro.com The Russian Postgres Company