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 1iCdGy-0000sA-71 for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Sep 2019 05:22:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iCdGw-00011j-Ni for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Sep 2019 05:21:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iCdGu-00010z-SG for pgsql-hackers@lists.postgresql.org; Tue, 24 Sep 2019 05:21:58 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iCdGm-0003mo-KK for pgsql-hackers@postgresql.org; Tue, 24 Sep 2019 05:21:56 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7584321FBF; Tue, 24 Sep 2019 01:21:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 24 Sep 2019 01:21:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=rqQSs9eCYRQmaq6Ojt8aCLQ1501 FnmLCm6hraawJA+A=; b=RRii3fleSHHdwUfRwCdeuh7nGRO3IjgaSJddvj/iGOk m2RbIvOVk0isN0V+OiP2oC2dN5xEKDz90sWrmsw3zuKmHN2ifyZh065IcfyClqkU afWuNveYx4/ufcsqKcBecmUPSklLhaWNnsn6oq+SW7x92mGP367O1k8EFBW0dtqE 8UOgnWwzWk3DLgeIDSzezlp3P3CbAD9INa5K4fIOvntxWo4WI4JGfwUq4czETXX4 zSXFTFoe0EF3KVb5CLShurC3Z0OSGlxQuLynpdMN3fwyLmGBxJXLpiYzYgKasRQz HI25thP/W3llJELAv4CkT9k71FOCATEUNZCgnnWFTyw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=rqQSs9 eCYRQmaq6Ojt8aCLQ1501FnmLCm6hraawJA+A=; b=TFRyr2M6BW07ZBhQ0NI34l FJ4bw0al+HzU2Gby8irgvK8IGMoQ1gYVUYyjUKa3B6uR5xKE0Jd1omRAfpiMTAA6 u3ti6ObgexRZcPPQwWnf9316+VurcwfdI+pMiswahnzvEU85PDD/HTI6oyfGzMGf Abu7KLJN+ngbQBj8e+PArKe3M8yBy+5iTiDOB04/5UfdKHWw3MP52lUNSpM/9jRW GPGUsCh0W9ewwBdICPS3iKCZLLCctNxMYVzw5gdSNEeJgOpI6LxkJQfH03xQKSl3 uDlv98/v73LQ/r7i29KCAILS1UjFi8jVjas7xSstGntsWSNAIjMRHeXZCbRuiOYg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdelgdelkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecukfhppeduuddurddutddvrddukedtrddukeehnecurfgrrhgr mhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiinecuvehluh hsthgvrhfuihiivgeptd X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 0420E80059; Tue, 24 Sep 2019 01:21:42 -0400 (EDT) Date: Tue, 24 Sep 2019 14:21:40 +0900 From: Michael Paquier To: Tomas Vondra Cc: Melanie Plageman , Jeff Davis , Pg Hackers Subject: Re: Memory Accounting Message-ID: <20190924052140.GA1982@paquier.xyz> References: <027a129b8525601c6a680d27ce3a7172dab61aab.camel@j-davis.com> <20190724215228.tlyj74ie4l2jn7ji@development> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KsGdsel6WgEHnImy" Content-Disposition: inline In-Reply-To: <20190724215228.tlyj74ie4l2jn7ji@development> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --KsGdsel6WgEHnImy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Jul 24, 2019 at 11:52:28PM +0200, Tomas Vondra wrote: > I think Heikki was asking about places with a lot of sub-contexts, which a > completely different issue. It used to be the case that some aggregates > created a separate context for each group - like array_agg. That would > make Jeff's approach to accounting rather inefficient, because checking > how much memory is used would be very expensive (having to loop over a > large number of contexts). The patch has been marked as ready for committer for a week or so, but it seems to me that this comment has not been addressed, no? Are we sure that we want this method if it proves to be inefficient when there are many sub-contexts and shouldn't we at least test such scenarios with a worst-case, customly-made, function? -- Michael --KsGdsel6WgEHnImy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl2Jp+QACgkQnvQgOdby QH1fAw//fMOv91WHwUUv73SzvNf0+wjh17yVeFoW/+xp0q5NyIA9+9tASfcztZ6A yXHwq7oBl/J1qbZxDYx1xObqgWLNCsRDuXy/JiI+g3TwyiwVKL5vG+mvxRpLKmU6 1+VchGvene7sSkj+Ch5ab6N/Wn/EQoL2VuQRm8WBlou7zIem0Cc3N/IRt/JOoOb4 nlcZfI9DgoH0Z0CcDfngy/N/ELvb74LS0Y0TBbfMMUWBcGCVX8Hr/juNciwbCTrF YtIFh4q6ys8E5EV02IqJZ+jEJQG1ABemD2WpI9REcaYAsp0niqnzlWUgoTEf8Pyg UjuqHQ8rQs8BoQJWhejA9OFHMTOgyL1B+S5+X1wxO+ufma/PkRTUBKpaWUhRUDQb LtHxT78Ok92PwdcLPAmpScL5rYUnmXi+B/XhfLF4hOdpHvXbpLGYxdsm2rslv0Bp qOQeBepl0+SK+jiER+01YAAsuZb0gDrML+gDTbB8mRJ2L9q+cPKhevjklyzZA/By lCn3S+3+w7H5Z4FKaBErTSMj04sXU7M59BiIud5ws7br0FyjHUk51zDc6Wyqtp0R Xlzim8kJZmJbYEoOO7AFI6XOXR35rYEBvtxF2tA74pvb0/lSFggrprD9/50htwkc f7Pnm0+WDxEnlVmfXegCHyAa3mdF28eIlaSVcQADtzY3sgeC7Jg= =MOtt -----END PGP SIGNATURE----- --KsGdsel6WgEHnImy--