From: Markus Schaber <schabios@logi-track.com>
To: Pierre-Frédéric Caillaud <lists@boutiquenumerique.com>
Cc: PostgreSQL Performance List <pgsql-performance@postgresql.org>
Subject: Re: Index usage for sorted query
Date: Mon, 22 Nov 2004 16:01:15 +0100
Message-ID: <20041122160115.30cced7b@kingfisher.intern.logi-track.com> (raw)
In-Reply-To: <opshrtzhakcq72hf@musicbox>
References: <20041120151710.695f4de5@kingfisher.intern.logi-track.com>
<opshrtzhakcq72hf@musicbox>
Hi, Pierre-Frédéric,
On Sat, 20 Nov 2004 17:12:43 +0100
Pierre-Frédéric Caillaud <lists@boutiquenumerique.com> wrote:
> > WHERE cd='ca' ORDER BY l_postcode;
>
> Write :
>
> > WHERE cd='ca' ORDER BY cd, l_postcode;
>
> You have a multicolumn index, so you should specify a multicolumn sort
> exactly the same as your index, and the planner will get it.
Thanks, that seems to help.
Seems weird to order by a column that is all the same value, but well,
why not :-)
Thanks a lot,
Markus
--
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios@logi-track.com | www.logi-track.com
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: schabios@logi-track.com, lists@boutiquenumerique.com
Subject: Re: Index usage for sorted query
In-Reply-To: <20041122160115.30cced7b@kingfisher.intern.logi-track.com>
* 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