pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martijn van Oosterhout <kleptog@svana.org>
To: Mark Lewis <mark.lewis@mir3.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Craig A. James <cjames@modgraph-usa.com>
Cc: Markus Schaber <schabi@logix-tt.com>
Cc: pgsql-performance@postgresql.org
Cc: pgsql-hackers@postgresql.org
Subject: Re: qsort again (was Re: [PERFORM] Strange Create Index
Date: Thu, 16 Feb 2006 23:40:06 +0100
Message-ID: <20060216224006.GK26127@svana.org> (raw)
In-Reply-To: <1140128256.9076.254.camel@archimedes>
References: <20781.1140046109@sss.pgh.pa.us>
	<7.0.1.0.2.20060215194635.03b55da0@earthlink.net>
	<21615.1140052893@sss.pgh.pa.us>
	<7.0.1.0.2.20060215223710.03a7c618@earthlink.net>
	<20060216113522.GA3461@uio.no>
	<7.0.1.0.2.20060216071053.0385a1a8@earthlink.net>
	<43F481CD.2010509@logix-tt.com>
	<43F4A7D8.4050907@modgraph-usa.com>
	<29277.1140110108@sss.pgh.pa.us>
	<1140128256.9076.254.camel@archimedes>

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.

Attachments:

  signature.asc (application/pgp-signature, 188B) download

view thread (56+ messages)  latest in thread

Message-ID: <20060216224006.GK26127@svana.org>
Permalink:  ../20060216224006.GK26127@svana.org/
Also on:    postgresql.org/message-id/20060216224006.GK26127@svana.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: kleptog@svana.org, mark.lewis@mir3.com, tgl@sss.pgh.pa.us, cjames@modgraph-usa.com, schabi@logix-tt.com, pgsql-hackers@postgresql.org
  Subject: Re: qsort again (was Re: [PERFORM] Strange Create Index
  In-Reply-To: <20060216224006.GK26127@svana.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox