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 1h48Vn-0004iV-7w for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Mar 2019 18:21:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h48Vk-0007XL-9B for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Mar 2019 18:21:52 +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 1h48Vj-0007XE-Ra for pgsql-hackers@lists.postgresql.org; Wed, 13 Mar 2019 18:21:52 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h48Vg-0007i3-Se for pgsql-hackers@lists.postgresql.org; Wed, 13 Mar 2019 18:21:50 +0000 Received: by mail-qt1-x842.google.com with SMTP id v10so3045993qtp.8 for ; Wed, 13 Mar 2019 11:21:48 -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=DyEbPlYHFe/hVNEvsffRx5Vu7AJVq4FwL3WAxGCkZS8=; b=EiOwfTG+IjY+w7WE9SGbjEizjoTa1TlMq3PZzleu6sneOd1fcJ4d+U5swiNHB/Alti 8Ky8qkMJwkdX/WeYgeuQcLhgUdQQRlPY4hCewIwH3XDU4z3xWoqufBQ+oUg3N0Ierrrg c39UAPD0mh13GVnJr9RREd1krcVLP456LQVQ2nUDR1hEpxpKfUZd5KKZa9xVup97v595 18wtl7EaHyMsGJ2FOEV9oZoZoR9icS+4PcnyopQc7+mIGHY9jDwOaEXeQqYd0rZKK9w2 TpxL+NZ8N9sM/WmJsozTOpjlkh74VKj7rwRKE6XpdJXHXpsgcg4d5zycNnOgaUClY2Pj rylQ== 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=DyEbPlYHFe/hVNEvsffRx5Vu7AJVq4FwL3WAxGCkZS8=; b=EPeG12cp7MsK4BcVWrwG7kci6SMflrtnORxNyvlY2+gPk4TGUbauVhuSkq7M2vd8o3 5BCGghWDM0XaC9A2MBjGhc/sSMcy0wQONjTDzRniOY5Fx6eWo/QTFB15fBNUcb9QlyoH niYaneLd/WOwhVlIugDq/+ICSdLEPfU2MBKDoA/5j0ovioktg9aIoX2wbexmU3vusfQz 5jPkMe3kA10j7Lw9XOnTocN5+IZrBBfWygCOAgDvvq1rJSIN9wwQHW4fZ1Oaev0Wwk/c Wa1HlwY2TahYEymOfP4ZxB5riG+1Bj7raXqnfAPDYNbMxDhFuGsuqUAPHFJx0Ldq8hSi ODsA== X-Gm-Message-State: APjAAAVgRoIwyPHnm4mDjHY7qXuCBvDBeM2+ypo7IMiVoH+eR8O3mUtr 6jTcdtMpA3hJ1HRQuaSs0Ubnqw== X-Google-Smtp-Source: APXvYqzO/ATy0Vd1MpXtXvh8Oggtnc3ToSOed71FoUiXhag0kQeUiREWDnHXynzzPvh24HLVf82iHg== X-Received: by 2002:aed:23cf:: with SMTP id k15mr36289142qtc.180.1552501307989; Wed, 13 Mar 2019 11:21:47 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id h27sm4058985qkk.92.2019.03.13.11.21.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Mar 2019 11:21:47 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 204A7121CAE; Wed, 13 Mar 2019 15:21:45 -0300 (-03) Date: Wed, 13 Mar 2019 15:21:45 -0300 From: Alvaro Herrera To: Robert Haas Cc: PostgreSQL Hackers Subject: Re: hyrax vs. RelationBuildPartitionDesc Message-ID: <20190313182145.GA488@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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-Mar-13, Robert Haas wrote: > On Wed, Mar 13, 2019 at 1:38 PM Alvaro Herrera wrote: > > A bit, yes, but not overly so, and it's less fragile that not having > > such a protection. Anything that allocates in CacheMemoryContext needs > > to be very careful anyway. > > True, but I think it's more fragile than either of the options I proposed. You do? Unless I misunderstood, your options are: 1. (the patch you attached) create a temporary memory context that is used for everything, then at the end copy the good stuff to CacheMemCxt (or a sub-context thereof). This still needs to copy. 2. create a temp memory context, do everything there, do retail freeing of everything we don't want, reparenting the context to CacheMemCxt. Hope we didn't forget to pfree anything. How is any of those superior to what I propose? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services