Re: Multiple Order By Criteria

Поиск
Список
Период
Сортировка
От J@Planeti.Biz
Тема Re: Multiple Order By Criteria
Дата
Msg-id 063d01c61bba$2d97fc00$681e140a@fatchubby
обсуждение исходный текст
Ответ на Multiple Order By Criteria  (J@Planeti.Biz)
Ответы Re: Multiple Order By Criteria  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-performance
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
>


В списке pgsql-performance по дате отправления:

Предыдущее
От: Fredrick O Jackson
Дата:
Сообщение: Re: Multiple Order By Criteria
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Suspending SELECTs