Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 1AF769FB2CE for ; Wed, 4 Oct 2006 17:34:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 54040-07 for ; Wed, 4 Oct 2006 17:33:58 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id CA7B69FB203 for ; Wed, 4 Oct 2006 17:33:57 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k94KXsYn021284; Wed, 4 Oct 2006 16:33:54 -0400 (EDT) To: Tobias Brox cc: pgsql-performance@postgresql.org Subject: Re: Multi-key index not beeing used - bug? In-reply-to: <20061004181243.GB9871@oppetid.no> References: <20061004181243.GB9871@oppetid.no> Comments: In-reply-to Tobias Brox message dated "Wed, 04 Oct 2006 20:12:43 +0200" Date: Wed, 04 Oct 2006 16:33:54 -0400 Message-ID: <21283.1159994034@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.093 tagged_above=0 required=5 tests=AWL, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/113 X-Sequence-Number: 21242 Tobias Brox writes: > NBET=> explain select * from account_transaction where users_id=123456 order by created desc, id desc limit 10; > We have indices on the users_id field and the (users_id, created)-tuple. Neither of those indexes can provide the sort order the query is asking for. regards, tom lane