Fwd: Index on table when using DESC clause

От: Yves Vindevogel
Тема: Fwd: Index on table when using DESC clause
Дата: ,
Msg-id: 6d31bed04ab35cbbe2df37af979d9882@implements.be
(см: обсуждение, исходный текст)
Ответы: Re: Fwd: Index on table when using DESC clause  ("Steinar H. Gunderson")
Re: Fwd: Index on table when using DESC clause  (Andrew Lazarus)
Список: pgsql-performance

Скрыть дерево обсуждения

Fwd: Index on table when using DESC clause  (Yves Vindevogel, )
 Re: Fwd: Index on table when using DESC clause  ("Steinar H. Gunderson", )
  Re: Fwd: Index on table when using DESC clause  (Yves Vindevogel, )
   Re: Fwd: Index on table when using DESC clause  (Oleg Bartunov, )
 Re: Fwd: Index on table when using DESC clause  (Andrew Lazarus, )
 Re: Fwd: Index on table when using DESC clause  (Yves Vindevogel, )



Begin forwarded message:


<excerpt><bold><color><param>0000,0000,0000</param>From:
</color></bold>Yves Vindevogel <<>

<bold><color><param>0000,0000,0000</param>Date: </color></bold>Mon 23
May 2005 19:23:16 CEST

<bold><color><param>0000,0000,0000</param>To:
</color></bold>

<bold><color><param>0000,0000,0000</param>Subject: </color>Index on
table when using DESC clause

</bold>

Hi,


I have a table with multiple fields.  Two of them are documentname and
pages

I have indexes on documentname and on pages, and one extra on
documentname + pages


However, when I query my db using for instance   order by pages,
documentname, it is very fast.

If I use   order by pages desc, documentname, it is not fast at all,
like it is not using the index properly at all.


How can I avoid this ?


Met vriendelijke groeten,

Bien à vous,

Kind regards,


<bold>Yves Vindevogel</bold>

<bold>Implements</bold>

<smaller>

</smaller></excerpt>

Begin forwarded message:

> From: Yves Vindevogel <>
> Date: Mon 23 May 2005 19:23:16 CEST
> To: 
> Subject: Index on table when using DESC clause
>
> Hi,
>
> I have a table with multiple fields.  Two of them are documentname and
> pages
> I have indexes on documentname and on pages, and one extra on
> documentname + pages
>
> However, when I query my db using for instance   order by pages,
> documentname, it is very fast.
> If I use   order by pages desc, documentname, it is not fast at all,
> like it is not using the index properly at all.
>
> How can I avoid this ?
>
> Met vriendelijke groeten,
> Bien à vous,
> Kind regards,
>
> Yves Vindevogel
> Implements
>
<excerpt><smaller>


Mail:   - Mobile: +32 (478) 80 82 91


Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76


Web: http://www.implements.be

<italic><x-tad-smaller>

First they ignore you.  Then they laugh at you.  Then they fight you.
Then you win.

Mahatma Ghandi.

</x-tad-smaller></italic></smaller></excerpt>Met vriendelijke groeten,

Bien à vous,

Kind regards,


<bold>Yves Vindevogel</bold>

<bold>Implements</bold>

<smaller>

</smaller>>
>
> Mail:   - Mobile: +32 (478) 80 82 91
>
> Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76
>
> Web: http://www.implements.be
>
> First they ignore you.  Then they laugh at you.  Then they fight you.
> Then you win.
> Mahatma Ghandi.
Met vriendelijke groeten,
Bien à vous,
Kind regards,

Yves Vindevogel
Implements

<smaller>


Mail:   - Mobile: +32 (478) 80 82 91


Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76


Web: http://www.implements.be

<italic><x-tad-smaller>

First they ignore you.  Then they laugh at you.  Then they fight you.
Then you win.

Mahatma Ghandi.</x-tad-smaller></italic></smaller>



Mail:   - Mobile: +32 (478) 80 82 91

Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76

Web: http://www.implements.be

First they ignore you.  Then they laugh at you.  Then they fight you.
Then you win.
Mahatma Ghandi.

Вложения

В списке pgsql-performance по дате сообщения:

От: "Anjan Dave"
Дата:
Сообщение: Re: seqential vs random io
От: mark durrant
Дата:
Сообщение: Select performance vs. mssql