Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gG2oG-00080k-1M for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Oct 2018 14:09:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gG2oE-0000j9-CD for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Oct 2018 14:09:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gG2oE-0000j2-1P for pgsql-hackers@lists.postgresql.org; Fri, 26 Oct 2018 14:09:54 +0000 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gG2oA-00031n-NN for pgsql-hackers@lists.postgresql.org; Fri, 26 Oct 2018 14:09:52 +0000 Received: by mail-qt1-x82e.google.com with SMTP id d14-v6so1335407qto.4 for ; Fri, 26 Oct 2018 07:09:50 -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=9oU+tYKm0lwXYBT0DJXmmX77Wjs9lp9ji1mlfFSZqkE=; b=Tbg7xunrjXVnVDQ3yoAvfhrtx8n4StPCiIAvS2/aNvHK3a1o5mDXNhk0t/mMaRSB6K ej3/U9Lid3P+aycb6FK100RiaPJuUJFR1Vi48EP/KrsM43El8qzotcOsVQOUFwH9gdOU f1UJ1pqcRbSth4ZAhGcBIb5aNzVYhj1tk393YfUJtFnKRP/p2oLW0GJkG2Mos4ckZ6zZ ENwPJxXHa8kepNHtNhfKtHSX4jNDi9qkw7eZ2G+YLIeDPSxIm2pyoaoYnRpJ9MUqnili RCTRohdy4FsjUzm3shmEqXckdxV5teALqjh25KBbQvZLArm0uvMftxovKkRWGGLKzHsU /BRQ== 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=9oU+tYKm0lwXYBT0DJXmmX77Wjs9lp9ji1mlfFSZqkE=; b=X4q5akZ+lkkoGzMG9Lto9BkiXor7Xf+zC+iSkqvBQBKDrqAt8gPSclEBnTXY0T4txK 3VmM4KQRQVs3SDtjzqLLCGpgSrZ/qecrvIYR/nEMlL9/5uQMR9ofpFXhfgctY2+l5Idu Bvx8yr3aRR4bdP7ddYhOV4nv5rLU/0FhczLlpyMvXt67UZHHaR+yg0gglLs3P6Rd05pC pOtIe2gR5RnzEUg5eIQck8sxgTh+Pt0hxdy37sRF41R3T9z56mF1HKZpzbahSwHqurKU n+J5RD6NlUNuUg/BkozuiXplwMduUyMWh5CdTf8KWtiHUi7vqKepI/EtQlfrAgCUA5yx xkSw== X-Gm-Message-State: AGRZ1gJ/BMqe74bAx4s1Q0ZSxQjKvoF9fBZpX+1zdwA3dgcWRUlCvDiw 6xvUx0vehZYXoJxprARLl6FLhA== X-Google-Smtp-Source: AJdET5cTP+LYCPO/1UZVG1IWCPSeakB/2CFtZxaiSMM0RqL3U+h/olRKc3V4jkRvacL9swe/YPqmPg== X-Received: by 2002:a0c:ef8e:: with SMTP id w14mr3254103qvr.237.1540562989640; Fri, 26 Oct 2018 07:09:49 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id c79-v6sm10492225qka.83.2018.10.26.07.09.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Oct 2018 07:09:48 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id A99356CD; Fri, 26 Oct 2018 11:09:27 -0300 (-03) Date: Fri, 26 Oct 2018 11:09:27 -0300 From: Alvaro Herrera To: Tom Lane Cc: Amit Langote , Bruno Wolff III , pgsql-general@lists.postgresql.org, pgsql-hackers@lists.postgresql.org Subject: Re: Should pg 11 use a lot more memory building an spgist index? Message-ID: <20181026140927.oh4gd367st47li6h@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <25595.1540547983@sss.pgh.pa.us> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Oct-26, Tom Lane wrote: > After a quick look around, I think that making systable_begin/endscan > do this is a nonstarter; there are just too many call sites that would > be affected. Now, you could imagine specifying that indexes on system > catalogs (in practice, only btree) have to clean up at endscan time > but other index types don't, so that only operations that might be > scanning user indexes need to have suitable wrapping contexts. Not sure > there's a lot of benefit to that, though. How about modifying SysScanDescData to have a memory context member, which is created by systable_beginscan and destroyed by endscan? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services