pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: J@Planeti.Biz
To: josh@agliodbs.com
To: pgsql-performance@postgresql.org
Subject: Re: Multiple Order By Criteria
Date: Tue, 17 Jan 2006 17:29:04 -0500
Message-ID: <05d801c61bb5$6c8824d0$681e140a@fatchubby> (raw)
References: <05c301c61bb1$d88c6a00$681e140a@fatchubby>
	<200601171425.38772.josh@agliodbs.com>

I created the index, in order. Did a vacuum analyze on the table and my 
explain still says:

Limit  (cost=229610.78..229611.03 rows=100 width=717)
  ->  Sort  (cost=229610.78..230132.37 rows=208636 width=717)
        Sort Key: receipt, carrier_id, batchnum, encounternum, encounter_id
        ->  Seq Scan on detail_summary ds  (cost=0.00..22647.13 rows=208636 
width=717)
              Filter: (receipt >= '2004-03-22'::date)


So, for fun I did
set enable_seqscan to off

But that didn't help. For some reason, the sort wants to do a seq scan and 
not use my super new index.

Am I doing something wrong ?

----- Original Message ----- 
From: "Josh Berkus" <josh@agliodbs.com>
To: <pgsql-performance@postgresql.org>
Cc: <J@planeti.biz>
Sent: Tuesday, January 17, 2006 5:25 PM
Subject: Re: [PERFORM] Multiple Order By Criteria


> J,
>
>> I have an index built for each of these columns in my order by clause.
>> This query takes an unacceptable amount of time to execute. Here are the
>> results of the explain:
>
> You need a single index which has all five columns, in order.
>

> -- 
> --Josh
>
> Josh Berkus
> Aglio Database Solutions
> San Francisco
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
> 




view thread (12+ messages)  latest in thread

Message-ID: <05d801c61bb5$6c8824d0$681e140a@fatchubby>
Permalink:  ../05d801c61bb5$6c8824d0$681e140a@fatchubby/
Also on:    postgresql.org/message-id/05d801c61bb5$6c8824d0$681e140a@fatchubby

 · 

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: J@Planeti.Biz, josh@agliodbs.com
  Subject: Re: Multiple Order By Criteria
  In-Reply-To: <05d801c61bb5$6c8824d0$681e140a@fatchubby>

* 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