pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Question on indexes
3+ messages / 3 participants
[nested] [flat]

* Question on indexes
@ 2005-12-19 15:51  Emil Rachovsky <zsevgymko@yahoo.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Emil Rachovsky @ 2005-12-19 15:51 UTC (permalink / raw)
  To: pgsql-sql; +Cc: pgsql-general@postgresql.org


Hi,
Can anyone show me a simple way of creating an index
in PostGre like that:
create index indName on someTable(someIntColumn DESC)
?

Thanks In Advance,
Emil 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Question on indexes
@ 2005-12-19 16:29  vishal saberwal <vishalsaberwal@gmail.com>
  parent: Emil Rachovsky <zsevgymko@yahoo.com>
  1 sibling, 0 replies; 3+ messages in thread

From: vishal saberwal @ 2005-12-19 16:29 UTC (permalink / raw)
  To: Emil Rachovsky <zsevgymko@yahoo.com>; +Cc: pgsql-sql; pgsql-general@postgresql.org

CREATE INDEX code_idx ON films(code) TABLESPACE indexspace;

http://www.postgresql.org/docs/8.1/interactive/sql-createindex.html

vish

On 12/19/05, Emil Rachovsky <zsevgymko@yahoo.com> wrote:
>
>
> Hi,
> Can anyone show me a simple way of creating an index
> in PostGre like that:
> create index indName on someTable(someIntColumn DESC)
> ?
>
> Thanks In Advance,
> Emil
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [SQL] Question on indexes
@ 2005-12-19 16:31  Alvaro Herrera <alvherre@commandprompt.com>
  parent: Emil Rachovsky <zsevgymko@yahoo.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Alvaro Herrera @ 2005-12-19 16:31 UTC (permalink / raw)
  To: Emil Rachovsky <zsevgymko@yahoo.com>; +Cc: pgsql-sql; pgsql-general@postgresql.org

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.



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2005-12-19 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-12-19 15:51 Question on indexes Emil Rachovsky <zsevgymko@yahoo.com>
2005-12-19 16:29 ` vishal saberwal <vishalsaberwal@gmail.com>
2005-12-19 16:31 ` Alvaro Herrera <alvherre@commandprompt.com>

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