X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C87093A5286 for ; Mon, 22 Nov 2004 15:02:36 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 53159-03 for ; Mon, 22 Nov 2004 15:01:44 +0000 (GMT) Received: from mail.logi-track.com (www.logi-track.com [213.239.193.212]) by svr1.postgresql.org (Postfix) with ESMTP id 6D4493A5294 for ; Mon, 22 Nov 2004 15:01:47 +0000 (GMT) Received: from kingfisher.intern.logi-track.com (J2c74.j.pppool.de [85.74.44.116]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logi-track.com (Postfix) with ESMTP id 74C1D3053B; Mon, 22 Nov 2004 16:01:47 +0100 (CET) Received: from kingfisher.intern.logi-track.com (localhost [127.0.0.1]) by kingfisher.intern.logi-track.com (Postfix) with SMTP id A0A2916DDF6; Mon, 22 Nov 2004 16:01:16 +0100 (CET) Date: Mon, 22 Nov 2004 16:01:15 +0100 From: Markus Schaber To: =?ISO-8859-15?Q?Pierre-Fr=E9d=E9ric?= Caillaud Cc: "PostgreSQL Performance List" Subject: Re: Index usage for sorted query Message-ID: <20041122160115.30cced7b@kingfisher.intern.logi-track.com> In-Reply-To: References: <20041120151710.695f4de5@kingfisher.intern.logi-track.com> Organization: logi-track ag, =?ISO-8859-15?Q?z=FCrich?= X-Mailer: Sylpheed-Claws 0.9.12b (GTK+ 1.2.10; i386-pc-linux-gnu) X-Face: Nx5T&>Nj$VrVPv}sC3IL&)TqHHOKCz/|)R$i"*r@w0{*I6w; UNU_hdl1J4NI_m{IMztq=>cmM}1gCLbAF+9\#CGkG8}Y{x%SuQ>1#t:; Z(|\qdd[i]HStki~#w1$TPF}:0w-7"S\Ev|_a$K wrote: > > WHERE cd=3D'ca' ORDER BY l_postcode; >=20 > Write : >=20 > > WHERE cd=3D'ca' ORDER BY cd, l_postcode; >=20 > You have a multicolumn index, so you should specify a multicolumn sort =20 > 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 --=20 markus schaber | dipl. informatiker logi-track ag | rennweg 14-16 | ch 8001 z=FCrich phone +41-43-888 62 52 | fax +41-43-888 62 53 mailto:schabios@logi-track.com | www.logi-track.com