Re: [HACKERS] qsort again (was Re: Strange Create Index - Mailing list pgsql-performance

From Martijn van Oosterhout
Subject Re: [HACKERS] qsort again (was Re: Strange Create Index
Date
Msg-id 20060216224006.GK26127@svana.org
Whole thread Raw
In response to Re: [HACKERS] qsort again (was Re: Strange Create Index  (Mark Lewis <mark.lewis@mir3.com>)
List pgsql-performance
On Thu, Feb 16, 2006 at 02:17:36PM -0800, Mark Lewis wrote:
> It seems that instead of maintaining a different sorting code path for
> each data type, you could get away with one generic path and one
> (hopefully faster) path if you allowed data types to optionally support
> a 'sortKey' interface by providing a function f which maps inputs to 32-
> bit int outputs, such that the following two properties hold:
>
> f(a)>=f(b) iff a>=b
> if a==b then f(a)==f(b)

Note this is a property of the collation, not the type. For example
strings can be sorted in many ways and the sortKey must reflect that.
So in postgres terms it's a property of the btree operator class.

It's something I'd like to do if I get A Round Tuit. :)

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

pgsql-performance by date:

Previous
From: Markus Schaber
Date:
Subject: Re: [HACKERS] qsort again (was Re: Strange Create Index
Next
From: Greg Stark
Date:
Subject: Re: [HACKERS] qsort again (was Re: Strange Create Index