Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 3F62B632330 for ; Tue, 3 Mar 2009 17:27:42 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 95176-01 for ; Tue, 3 Mar 2009 17:27:34 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 60763632D6E for ; Tue, 3 Mar 2009 17:27:32 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n23LR5eM017009; Tue, 3 Mar 2009 16:27:05 -0500 (EST) To: Sebastjan Trepca cc: Robert Haas , pgsql-performance@postgresql.org Subject: Re: Problems with ordering (can't force query planner to use an index) In-reply-to: References: <603c8f070903030912t36c541ebr50b4576c7a9a5b65@mail.gmail.com> <603c8f070903030940n3fb1e9eay53666d06cf489469@mail.gmail.com> Comments: In-reply-to Sebastjan Trepca message dated "Tue, 03 Mar 2009 20:05:53 +0100" Date: Tue, 03 Mar 2009 16:27:05 -0500 Message-ID: <17008.1236115625@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/36 X-Sequence-Number: 32958 Sebastjan Trepca writes: > It thinks there are even less rows in the set: > -> Index Scan using core_accessor_fresh_idx on > core_accessor (cost=0.00..8955.44 rows=2440 width=92) (actual > time=0.056..53.107 rows=69312 loops=1) > Index Cond: ((slot_id = 472) AND (slot_type_id = > 119) AND (label = ''::text) AND (user_id = 0) AND (role = 0) AND > (publish_state >= 60)) Maybe you should get rid of this six-column index, if you'd rather the query didn't use it. It seems a tad overspecialized anyway. regards, tom lane