Re: Using index with order desc

From: Helge Bahmann <bahmann(at)math(dot)tu-freiberg(dot)de>
To: Dave Smith <dave(dot)smith(at)candata(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Using index with order desc
Date: 2002-07-17 12:36:16
Message-ID: Pine.LNX.4.44.0207171433070.19462-100000@lothlorien.stunet.tu-freiberg.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 16 Jul 2002 Dave Smith wrote:

> CREATE INDEX transfer_5 on transfer(company_id,module);
[snip]
> explain select * from transfer where company_id=1012 order by
> company_id,module desc;
[snip]
> NOTICE: QUERY PLAN:
>
> Sort (cost=462.74..462.74 rows=117 width=176)
> -> Index Scan using transfer_5 on transfer (cost=0.00..458.71
> rows=117 width=176)

yes, similiar problem once hit me as well... try:

explain select * from transfer where company_id=1012 order by
company_id desc, module desc;
^^^^

Regards
--
Helge Bahmann <bahmann(at)math(dot)tu-freiberg(dot)de> /| \__
The past: Smart users in front of dumb terminals /_|____\
_/\ | __)
$ ./configure \\ \|__/__|
checking whether build environment is sane... yes \\/___/ |
checking for AIX... no (we already did this) |

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Manfred Koizar 2002-07-17 12:37:14 Re: Using index with order desc
Previous Message Peter Gibbs 2002-07-17 12:33:03 Re: Using index with order desc