From: J@Planeti.Biz
To: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Multiple Order By Criteria
Date: Tue, 17 Jan 2006 18:03:04 -0500
Message-ID: <063d01c61bba$2d97fc00$681e140a@fatchubby> (raw)
References: <05c301c61bb1$d88c6a00$681e140a@fatchubby>
<200601171425.38772.josh@agliodbs.com>
<20060117143952.D47156@megazone.bigpanda.com>
I created the index like this:
CREATE INDEX rcbee_idx
ON detail_summary
USING btree
(receipt, carrier_id, batchnum, encounternum, encounter_id);
Is this correct ?
How do I make a reverse opclass ?
----- Original Message -----
From: "Stephan Szabo" <sszabo@megazone.bigpanda.com>
To: "Josh Berkus" <josh@agliodbs.com>
Cc: <pgsql-performance@postgresql.org>; <J@planeti.biz>
Sent: Tuesday, January 17, 2006 5:40 PM
Subject: Re: [PERFORM] Multiple Order By Criteria
>
> On Tue, 17 Jan 2006, Josh Berkus wrote:
>
>> 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.
>
> I think he'll also need a reverse opclass for the first column in the
> index or for the others since he's doing desc, asc, asc, asc, asc.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>
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, sszabo@megazone.bigpanda.com, josh@agliodbs.com
Subject: Re: Multiple Order By Criteria
In-Reply-To: <063d01c61bba$2d97fc00$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