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 69DE2D1C4B8 for ; Fri, 15 Aug 2003 11:10:11 +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 34525-05 for ; Fri, 15 Aug 2003 08:10:03 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 63873D1C918 for ; Fri, 15 Aug 2003 08:10:00 -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 h7FB9x5H012304; Fri, 15 Aug 2003 07:09:59 -0400 (EDT) To: Joe Conway Cc: Bertrand Petit , pgsql-hackers@postgresql.org Subject: Re: 7.4 beta 1 getting out of swap In-reply-to: <3F3C497C.1050200@joeconway.com> 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> Comments: In-reply-to Joe Conway message dated "Thu, 14 Aug 2003 19:46:20 -0700" Date: Fri, 15 Aug 2003 07:09:58 -0400 Message-ID: <12303.1060945798@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/800 X-Sequence-Number: 42457 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. > Do you want me to take a shot at this since I created the mess? Actually I led you down the garden path on that, IIRC --- I was the one who insisted these lookups needed to be cached. I'll work on fixing it. regards, tom lane