pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jnasby@pervasive.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrus <eetasoft@online.ee>
Cc: pgsql-performance@postgresql.org
Subject: Re: Why date index is not used
Date: Thu, 8 Jun 2006 16:57:45 -0500
Message-ID: <20060608215745.GE45331@pervasive.com> (raw)
In-Reply-To: <196.1149794455@sss.pgh.pa.us>
References: <e69rq9$2a1b$1@news.hub.org>
	<196.1149794455@sss.pgh.pa.us>

On Thu, Jun 08, 2006 at 03:20:55PM -0400, Tom Lane wrote:
> "Andrus" <eetasoft@online.ee> writes:
> > Why Postgres 8.1 does not use makse_kuupaev_idx index in the following query 
> > ?
> 
> Because it doesn't help --- the system still has to do the sort.
> You'd need a two-column index on both of the ORDER BY columns to avoid
> sorting.

And even then you better have a pretty high correlation on the first
column, otherwise you'll still get a seqscan.
-- 
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: <20060608215745.GE45331@pervasive.com>
Permalink:  ../20060608215745.GE45331@pervasive.com/
Also on:    postgresql.org/message-id/20060608215745.GE45331@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, tgl@sss.pgh.pa.us, eetasoft@online.ee
  Subject: Re: Why date index is not used
  In-Reply-To: <20060608215745.GE45331@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