pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: theo@flame.co.za
Cc: pgsql-performance@postgresql.org
Subject: Re: Indexes with descending date columns
Date: Thu, 23 Mar 2006 23:59:13 -0500
Message-ID: <27697.1143176353@sss.pgh.pa.us> (raw)
In-Reply-To: <1143174749.2820.2.camel@josh>
References: <200603170625.k2H6PJ926955@pillette.com>
	<1143112188.2810.27.camel@theo-laptop.int.coza.net.za>
	<20060323141622.GC4881@surnet.cl>
	<1143174749.2820.2.camel@josh>

Theo Kramer <theo@flame.co.za> writes:
> If so, I would appreciate any pointers on where to start on this -
> already fumbling my way through Interfacing Extensions To Indexes in the
> manual...

Search the PG list archives for discussions of reverse-sort opclasses.
It's really pretty trivial, once you've created a negated btree
comparison function for the datatype.

This is the sort of thing that we are almost but not quite ready to put
into the standard distribution.  The issues that are bugging me have to
do with whether NULLs sort low or high --- right now, if you make a
reverse-sort opclass, it will effectively sort NULLs low instead of
high, and that has some unpleasant consequences because the rest of the
system isn't prepared for variance on the point (in particular I'm
afraid this could break mergejoins).  I'd like to see us make "NULLs
low" vs "NULLs high" be a defined property of opclasses, and deal with
the fallout from that, and then we could put reverse-sort opclasses for
all the standard datatypes into the regular distribution.

			regards, tom lane



view thread (11+ messages)  latest in thread

Message-ID: <27697.1143176353@sss.pgh.pa.us>
Permalink:  ../27697.1143176353@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/27697.1143176353@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, theo@flame.co.za
  Subject: Re: Indexes with descending date columns
  In-Reply-To: <27697.1143176353@sss.pgh.pa.us>

* 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