Fwd: Index on table when using DESC clause - Mailing list pgsql-performance

From Yves Vindevogel
Subject Fwd: Index on table when using DESC clause
Date
Msg-id 6d31bed04ab35cbbe2df37af979d9882@implements.be
Whole thread Raw
Responses Re: Fwd: Index on table when using DESC clause
Re: Fwd: Index on table when using DESC clause
List pgsql-performance


Begin forwarded message:


<excerpt><bold><color><param>0000,0000,0000</param>From:
</color></bold>Yves Vindevogel <<yves.vindevogel@implements.be>

<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>pgsql-performance-owner@postgresql.org

<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 <yves.vindevogel@implements.be>
> Date: Mon 23 May 2005 19:23:16 CEST
> To: pgsql-performance-owner@postgresql.org
> 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: yves.vindevogel@implements.be  - 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: yves.vindevogel@implements.be  - 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: yves.vindevogel@implements.be  - 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: yves.vindevogel@implements.be  - 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.

Attachment

pgsql-performance by date:

Previous
From: Alex Stapleton
Date:
Subject: Re: Optimizing for writes. Data integrity not critical
Next
From: "Steinar H. Gunderson"
Date:
Subject: Re: Fwd: Index on table when using DESC clause