Re: qsort again (was Re: [PERFORM] Strange Create Index

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Mark Lewis <mark(dot)lewis(at)mir3(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Craig A(dot) James" <cjames(at)modgraph-usa(dot)com>, Markus Schaber <schabi(at)logix-tt(dot)com>, pgsql-performance(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: qsort again (was Re: [PERFORM] Strange Create Index
Date: 2006-02-16 22:40:06
Message-ID: 20060216224006.GK26127@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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(at)svana(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2006-02-16 22:51:02 Re: qsort again (was Re: [PERFORM] Strange Create Index
Previous Message Markus Schaber 2006-02-16 22:33:48 Re: qsort again (was Re: [PERFORM] Strange Create Index

Browse pgsql-performance by date

  From Date Subject
Next Message Greg Stark 2006-02-16 22:51:02 Re: qsort again (was Re: [PERFORM] Strange Create Index
Previous Message Markus Schaber 2006-02-16 22:33:48 Re: qsort again (was Re: [PERFORM] Strange Create Index