From: Alvaro Herrera <alvherre@commandprompt.com>
To: Emil Rachovsky <zsevgymko@yahoo.com>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-general@postgresql.org
Subject: Re: [SQL] Question on indexes
Date: Mon, 19 Dec 2005 13:31:33 -0300
Message-ID: <20051219163133.GC9980@surnet.cl> (raw)
In-Reply-To: <20051219155158.45162.qmail@web54312.mail.yahoo.com>
References: <20051219155158.45162.qmail@web54312.mail.yahoo.com>
Emil Rachovsky wrote:
>
> Hi,
> Can anyone show me a simple way of creating an index
> in PostGre like that:
> create index indName on someTable(someIntColumn DESC)
> ?
Not using that particular syntax, but you can do that if you create the
appropiate operator classes. Note that if you want to use btree index
on a single column, you don't need to have a descending index, because
btree indexes can be scanned in either direction. The opclass trick is
only needed if you want to have a multicolumn index. (I guess in the
other access methods it doesn't make much sense to think of descending
indexes.)
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
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-general@postgresql.org
Cc: alvherre@commandprompt.com, zsevgymko@yahoo.com, pgsql-sql@postgresql.org
Subject: Re: [SQL] Question on indexes
In-Reply-To: <20051219163133.GC9980@surnet.cl>
* 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