pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Theo Kramer <theo@flame.co.za>
Cc: pgsql-performance@postgresql.org
Subject: Re: Indexes with descending date columns
Date: Fri, 24 Mar 2006 04:21:38 -0600
Message-ID: <20060324102138.GR90527@pervasive.com> (raw)
In-Reply-To: <1143112188.2810.27.camel@theo-laptop.int.coza.net.za>
References: <200603170625.k2H6PJ926955@pillette.com>
	<1143112188.2810.27.camel@theo-laptop.int.coza.net.za>

On Thu, Mar 23, 2006 at 01:09:49PM +0200, Theo Kramer wrote:
> ii If no to i, is it feasible to extend PostgreSQL to allow traversing
>    an index in column descending and column ascending order - assuming
>    an order by on more than one column with column order not 
>    in the same direction and indexes existing? ... if that makes sense.

Yes.

stats=# explain select * from email_contrib order by project_id desc, id desc, date desc limit 10;
                                                       QUERY PLAN                                                       
------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=0.00..31.76 rows=10 width=24)
   ->  Index Scan Backward using email_contrib_pkey on email_contrib  (cost=0.00..427716532.18 rows=134656656 width=24)
(2 rows)

-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



view thread (11+ messages)  latest in thread

Message-ID: <20060324102138.GR90527@pervasive.com>
Permalink:  ../20060324102138.GR90527@pervasive.com/
Also on:    postgresql.org/message-id/20060324102138.GR90527@pervasive.com

 · 

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: jnasby@pervasive.com, theo@flame.co.za
  Subject: Re: Indexes with descending date columns
  In-Reply-To: <20060324102138.GR90527@pervasive.com>

* 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