X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 13DC1D1B89E for ; Sun, 17 Aug 2003 22:25:22 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 45071-08 for ; Sun, 17 Aug 2003 19:25:13 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 988F3D1B539 for ; Sun, 17 Aug 2003 19:25:10 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h7HMP85H002519; Sun, 17 Aug 2003 18:25:09 -0400 (EDT) To: Joe Conway , Bertrand Petit Cc: pgsql-hackers@postgresql.org Subject: Re: 7.4 beta 1 getting out of swap In-reply-to: <12303.1060945798@sss.pgh.pa.us> References: <20030814122130.A3583@memo.frmug.org> <15589.1060861546@sss.pgh.pa.us> <20030814165311.A4431@memo.frmug.org> <1578.1060874322@sss.pgh.pa.us> <20030814200947.A4769@memo.frmug.org> <7037.1060889820@sss.pgh.pa.us> <20030814215410.A5336@memo.frmug.org> <7271.1060891412@sss.pgh.pa.us> <20030815001730.A5628@memo.frmug.org> <8826.1060906670@sss.pgh.pa.us> <3F3C497C.1050200@joeconway.com> <12303.1060945798@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 15 Aug 2003 07:09:58 -0400" Date: Sun, 17 Aug 2003 18:25:08 -0400 Message-ID: <2518.1061159108@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/887 X-Sequence-Number: 42544 > Joe Conway writes: >> Tom Lane wrote: > 3. Set up a long-lived cache internal to the array functions that can > translate element type OID to the needed lookup data, and won't leak > memory across repeated calls. This is not the fastest or most general > solution, but it seems the most localized and safest fix. >> It seems to me that #3 is the least risky, and even if it isn't the best >> possible performance, this is the initial implementation of indexes on >> arrays, so it isn't like we're taking away something. Maybe solution #2 >> is better held as a performance enhancement for 7.5. > I'm leaning that way too. It occurs to me also that the same cache > could be used to eliminate repeated lookups in sorting setup --- which > would not be much of a win percentagewise, compared to the sort itself, > but still it seems worth doing. I've committed fixes for this, and verified that inserts/updates on an indexed array column don't leak memory anymore. regards, tom lane