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


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: andrew(at)supernews(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Removing SORTFUNC_LT/REVLT
Date: 2006-01-01 11:01:42
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Sun, Jan 01, 2006 at 07:48:56AM -0000, Andrew - Supernews wrote:
> Doesn't this result in incorrect output in multi-column sorts?
> i.e. if 'Foo' = 'foo', but for sorting purposes you always sort them
> with 'Foo' first, then a multicolumn sort of the following data:
> ('Foo',1)
> ('foo',2)
> ('Foo',3)
> would produce the wrong output, no?

Yeah, I was thinking about that but I'm not sure how big a problem it

We could make this work by having the sorting routines (and by
extension the lookups for indexes) by doing two passes: one with the
comparison routines and use the actual sorting routines only on
tie-breaks. A kind of big mark against the idea. Although this is
exactly the kind of work required for string sorting in many locales...

Whatever we do, the result of ORDER BY has to match index order. Does
this mean scankeys need to have two functions, in case of tie-breaking
multi-column keys. I dunno but it needs thinking about.

Have a nice day,
Martijn van Oosterhout   <kleptog(at)svana(dot)org>
> 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

pgsql-hackers by date

Next:From: Martijn van OosterhoutDate: 2006-01-01 11:12:24
Subject: Re: Removing SORTFUNC_LT/REVLT
Previous:From: Qingqing ZhouDate: 2006-01-01 07:52:48
Subject: Re: EINTR error in SunOS

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