Skip site navigation (1) Skip section navigation (2)

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

From: David Lang <dlang(at)invendra(dot)net>
To: Mark Lewis <mark(dot)lewis(at)mir3(dot)com>
Cc: Greg Stark <gsstark(at)mit(dot)edu>,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-17 05:33:16
Message-ID: Pine.LNX.4.62.0602162131211.20790@qnivq.ynat.uz (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-performance
On Thu, 16 Feb 2006, Mark Lewis wrote:

> On Thu, 2006-02-16 at 17:51 -0500, Greg Stark wrote:
>>>> Data types which could probably provide a useful function for f would be
>>>> int2, int4, oid, and possibly int8 and text (at least for SQL_ASCII).
>>
>> How exactly do you imagine doing this for text?
>>
>> I could see doing it for char(n)/varchar(n) where n<=4 in SQL_ASCII though.
>
>
> In SQL_ASCII, just take the first 4 characters (or 8, if using a 64-bit
> sortKey as elsewhere suggested).  The sorting key doesn't need to be a
> one-to-one mapping.

that would violate your second contraint ( f(a)==f(b) iff (a==b) )

if you could drop that constraint (the cost of which would be extra 'real' 
compares within a bucket) then a helper function per datatype could work 
as you are talking.

David Lang

In response to

Responses

pgsql-performance by date

Next:From: RonDate: 2006-02-17 06:20:58
Subject: Re: qsort again (was Re: [PERFORM] Strange Create
Previous:From: Steinar H. GundersonDate: 2006-02-17 02:02:19
Subject: Re: [HACKERS] qsort again (was Re: Strange Create Index

pgsql-hackers by date

Next:From: Satoshi NagayasuDate: 2006-02-17 06:17:57
Subject: Re: In Japan with Josh Berkus
Previous:From: Steinar H. GundersonDate: 2006-02-17 02:02:19
Subject: Re: [HACKERS] qsort again (was Re: Strange Create Index

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group