X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 322A7D1B4AC for ; Thu, 29 Jan 2004 18:28:33 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 52401-04 for ; Thu, 29 Jan 2004 14:28:02 -0400 (AST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 5B4CBD1B897 for ; Thu, 29 Jan 2004 14:28:01 -0400 (AST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 97D8E35794; Thu, 29 Jan 2004 10:27:57 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 95FDF3578D; Thu, 29 Jan 2004 10:27:57 -0800 (PST) Date: Thu, 29 Jan 2004 10:27:57 -0800 (PST) From: Stephan Szabo To: Tom Lane Cc: Bruno Wolff III , Achilleus Mantzios , email lists , pgsql-sql@postgresql.org Subject: Re: query not using index for descending records? In-Reply-To: <24411.1075397054@sss.pgh.pa.us> Message-ID: <20040129101857.D26621@megazone.bigpanda.com> References: <20040129131847.GE17068@wolff.to> <20040129140655.GA14885@wolff.to> <20040129075643.D23153@megazone.bigpanda.com> <24411.1075397054@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/271 X-Sequence-Number: 16664 On Thu, 29 Jan 2004, Tom Lane wrote: > Stephan Szabo writes: > > I'd thought that I'd previously sent a message containing a set of > > definitions for the reverse opclasses (not meant for inclusion to the > > system because I was making SQL functions that basically did - > comparison function> to use as the function of the operator class, but > > possibly worth playing with) but now that I actually search again, I don't > > see it. > > I don't recall having seen such a thing go by... > > I fear that using SQL functions as comparators would only be useful for > proof-of-concept, not as an industrial-strength implementation. The > index code needs comparator functions not to leak memory, and I doubt > that that could be guaranteed with a SQL function. You'd probably have > speed issues too. Yeah, that's what I figured. I thought it might be useful for people to play with though since at least for the integer/float types writing C versions of the comparitors is easy. I was thinking for real it'd be nice to be able to use the normal comparitor but invert the return value as necessary rather than providing two functions, but I didn't look at what that would take.