Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YRWBQ-0006T9-16 for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Feb 2015 01:27:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YRWBO-0008JX-Ov for pgsql-hackers@arkaria.postgresql.org; Sat, 28 Feb 2015 01:27:06 +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 1YRWBM-0008JF-1x for pgsql-hackers@postgresql.org; Sat, 28 Feb 2015 01:27:04 +0000 Received: from mail-pd0-f173.google.com ([209.85.192.173]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YRWBE-0000Z6-Cx for pgsql-hackers@postgresql.org; Sat, 28 Feb 2015 01:27:01 +0000 Received: by pdbfl12 with SMTP id fl12so24964931pdb.2 for ; Fri, 27 Feb 2015 17:26:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-type:mime-version:content-transfer-encoding; bh=OpADMohdKQWIKjgtU5r427WoxvkKvxrvatP56Q9+/9c=; b=mOdyB/w1uOPeFNMmsLyrwOx79OdJzgDahdLhTJO97wGvXBiSFPZjBh3Ve94zwKCLb9 bu/2kUeLTJaNUaopVqrgbx6ze/QN4UQ8LPKt5vdq3/hAxqFJDZ2bu10R0i3mxzrCZXpi hXr8zvmbrTBO24B5mnoC6yts1aYXJdwedAGTgkpyCOC0LDgFVUW55U7NGffwVF+8c54z n+STmcyh7HpzU99CaPH9qYG7W6YVEyoZI1V23ElswubhyylyyxebytdKWccC4gGKr0X8 wTbYUWLA0El7NnMdapKuaH9/OTYqV8OdeQhOv66Lf+TdOi0jgdXCG4HH0RuYPM+r589j 1p6Q== X-Gm-Message-State: ALoCoQmq6DtOAC5y3Kn4VO0OuceF6r2UJG9sN6K/keZSfE4pUON+d7qpF/LYMux3izdzO+HtKLxW X-Received: by 10.70.23.5 with SMTP id i5mr28106541pdf.119.1425086813691; Fri, 27 Feb 2015 17:26:53 -0800 (PST) Received: from [192.168.0.108] (c-69-181-249-16.hsd1.ca.comcast.net. [69.181.249.16]) by mx.google.com with ESMTPSA id xh3sm5167600pab.25.2015.02.27.17.26.52 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Fri, 27 Feb 2015 17:26:52 -0800 (PST) Message-ID: <1425086819.12308.273.camel@jeff-desktop> Subject: Re: [COMMITTERS] pgsql: Invent a memory context reset/delete callback mechanism. From: Jeff Davis To: Tom Lane Cc: pgsql-committers@postgresql.org, pgsql-hackers@postgresql.org, Andres Freund , Tomas Vondra Date: Fri, 27 Feb 2015 17:26:59 -0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Fri, 2015-02-27 at 22:17 +0000, Tom Lane wrote: > In passing, per discussion, rearrange some boolean fields in struct > MemoryContextData so as to avoid wasted padding space. For safety, > this requires making allowInCritSection's existence unconditional; > but I think that's a better approach than what was there anyway. I notice that this uses the bytes in MemoryContextData that I was hoping to use for the memory accounting patch (for memory-bounded HashAgg). Leaving no space for even a 32-bit value (without AllocSetContext growing beyond the magical 192-byte number Andres mentioned) removes most of the options for memory accounting. The only things I can think of are: 1. Move a few less-frequently-accessed fields out to an auxiliary structure (Tomas proposed something similar); or 2. Walk the memory contexts, but use some kind of estimation/extrapolation so that it doesn't need to be done for every input tuple of HashAgg. Thoughts? Regards, Jeff Davis -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers