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 1iDZWi-0007Bj-L2 for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Sep 2019 19:34:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iDZWh-00051M-5D for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Sep 2019 19:34:07 +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 1iDZWg-000515-QV for pgsql-hackers@lists.postgresql.org; Thu, 26 Sep 2019 19:34:06 +0000 Received: from mail-io1-xd42.google.com ([2607:f8b0:4864:20::d42]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iDZWe-0004xz-DK for pgsql-hackers@postgresql.org; Thu, 26 Sep 2019 19:34:05 +0000 Received: by mail-io1-xd42.google.com with SMTP id b136so9680659iof.3 for ; Thu, 26 Sep 2019 12:34:04 -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:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=BZMJNKMowb77w+mqOp5dEIbh2kna5RV3/6AY33kskHc=; b=AvSXrh0SrzuLeUqQ6LIGjhvMWQCWnGpTHnjep0oeI/uFEhp0Nh8Igz4M8nYL7eP+vh C4/K9aImcoBx8RPu98Sgbw/UYDCDmf6UYt1dkg108RkxEu1A0xl8n2cDBtTwLueyXkKy 6qkhhNYjHKeS2FZm6c2JRjjCJNKCA2VQVVKh7G84837+YApFeUJoENgsK5ZEvY9OgJIn HjDO6kOqqhsigDdTmr5a8W2Icqv95gtMtXwXb+7dMQNq4tOQKo9XV6xxpvGZEiHp8/gZ Y7NnFN6jUtargmFpFhoXfmY/8tSRLiGsdhCEPgrM+WeSX0nDSLDnrHatlOneEqCJdWi/ fk2w== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=BZMJNKMowb77w+mqOp5dEIbh2kna5RV3/6AY33kskHc=; b=DQwKWxfXJU+8j/sJ0gD+zqkrpTR80GIG1+HPllNOvwlpu7+T0JrB0ysva1WsLD+qq/ 5GZ2CB3QQRKNJ1JKjqwZ62jzGyyoY80h94C3TpKTBKvrGHXWKrnhWO5O+Qt94j8a4kR7 9i7kg7R68WQ6d6AN+FZ8gQk2vILsz6PcOtsXLTHWw/apaf+qJlV+9gSYrIhICmOf8wpC rH3TkSeuSvKhfeyz0JKD668EX9X8Fq9VRaUPQQ+W4j28RrPffsax7uen9cw7vtDaIKYa c7H3lDM79BKgFl8qhFLvFiTPsQlgF/t1jn7wg3sijmzfpHsV7pRf1zOS7A8/znVLMH87 qwKA== X-Gm-Message-State: APjAAAWqqzZWeKJqxmIPqYX+AXXYHHuq3ODfVAU6RZtfHsjzzVvCNn4f tFfUsTvlQrwT7myehaWj4Jb8uA== X-Google-Smtp-Source: APXvYqwdT1j4f1NfhRW3qljU/7lh5y/ynMgrNv13u3GWwJPbx2WeWV0NRyhNZgYzc380ldSsQns5Dg== X-Received: by 2002:a6b:3a43:: with SMTP id h64mr4878234ioa.89.1569526443465; Thu, 26 Sep 2019 12:34:03 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([199.229.249.165]) by smtp.gmail.com with ESMTPSA id g87sm139563ild.79.2019.09.26.12.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Sep 2019 12:34:02 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 5377A120349; Thu, 26 Sep 2019 16:33:59 -0300 (-03) Date: Thu, 26 Sep 2019 16:33:59 -0300 From: Alvaro Herrera To: Tomas Vondra Cc: Amit Kapila , PostgreSQL Hackers Subject: Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions Message-ID: <20190926193359.GA16585@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190926175845.pau2qocmlffd37qg@development> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Sep-26, Tomas Vondra wrote: > Hi, > > Attached is an updated patch series, rebased on current master. It does > fix one memory accounting bug in ReorderBufferToastReplace (the code was > not properly updating the amount of memory). Cool. Can we aim to get 0001 pushed during this commitfest, or is that a lost cause? The large new comment in reorderbuffer.c says that a transaction might get spilled *or streamed*, but surely that second thing is not correct, since before the subsequent patches it's not possible to stream transactions that have not yet finished? How certain are you about the approach to measure memory used by a reorderbuffer transaction ... does it not cause a measurable performance drop? I wonder if it would make more sense to use a separate contexts per transaction and use context-level accounting (per the patch Jeff Davis posted elsewhere for hash joins ... though I see now that that only works fot aset.c, not other memcxt implementations), or something like that. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services