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

Re: Indexes with descending date columns

From: Theo Kramer <theo(at)flame(dot)co(dot)za>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Indexes with descending date columns
Date: 2006-03-24 04:32:29
Message-ID: 1143174749.2820.2.camel@josh (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
On Thu, 2006-03-23 at 16:16, Alvaro Herrera wrote:
> Theo Kramer wrote:
> > All good input - thanks, however, before I start messing with my stuff
> > which I know will be complex - some questions to any of the developers
> > on the list.
> > 
> > i  Is it feasible to extend index creation to support descending 
> >    columns? ... this is supported on other commercial and non
> >    commercial databases, but I do not know if this is a SQL standard.
> This can be done.  You need to create an operator class which specifies
> the reverse sort order (i.e. reverse the operators), and then use it in
> the new index.

Hmmm, would that then result in the following syntax  being valid?

  create index my_idx on my_table (c1, c2 desc, c3, c4 desc) ;

where my_table is defined as

  create table my_table (
    c1 text,
    c2 timestamp,
    c3 integer,
    c4 integer

If so, I would appreciate any pointers on where to start on this -
already fumbling my way through Interfacing Extensions To Indexes in the


In response to


pgsql-performance by date

Next:From: Tom LaneDate: 2006-03-24 04:59:13
Subject: Re: Indexes with descending date columns
Previous:From: Christopher BrowneDate: 2006-03-24 02:22:34
Subject: Re: Scaling up PostgreSQL in Multiple CPU / Dual Core

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