Re: query not using index for descending records?

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>, email lists <lists(at)darrenmackay(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: query not using index for descending records?
Date: 2004-01-29 18:27:57
Message-ID: 20040129101857.D26621@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, 29 Jan 2004, Tom Lane wrote:

> Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> 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 -<normal
> > 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.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Octavio Alvarez 2004-01-29 18:40:46 Re: LEFT JOIN on one and/or another column (thanks)
Previous Message Joe Conway 2004-01-29 17:52:46 Re: How to retrieve N lines of a text field.