X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 82398D6E21 for ; Mon, 29 Aug 2005 16:56:16 -0300 (ADT) 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 80587-02 for ; Mon, 29 Aug 2005 19:56:14 +0000 (GMT) Received: from hub.org (hub.org [200.46.204.220]) by svr1.postgresql.org (Postfix) with ESMTP id E5623D7CC1 for ; Mon, 29 Aug 2005 16:56:13 -0300 (ADT) Received: from localhost (av.hub.org [200.46.204.144]) by hub.org (Postfix) with ESMTP id 5B29664B903 for ; Mon, 29 Aug 2005 16:56:16 -0300 (ADT) Received: from hub.org ([200.46.204.220]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 78445-06 for ; Mon, 29 Aug 2005 19:56:11 +0000 (GMT) Received: from ganymede.hub.org (blk-222-82-85.eastlink.ca [24.222.82.85]) by hub.org (Postfix) with ESMTP id AED2764B8FF for ; Mon, 29 Aug 2005 16:56:13 -0300 (ADT) Received: by ganymede.hub.org (Postfix, from userid 1000) id 5522B3687D; Mon, 29 Aug 2005 16:56:15 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 5414F35A0A for ; Mon, 29 Aug 2005 16:56:15 -0300 (ADT) Date: Mon, 29 Aug 2005 16:56:15 -0300 (ADT) From: "Marc G. Fournier" X-X-Sender: scrappy@ganymede.hub.org To: pgsql-performance@postgresql.org Subject: getting an index to work with partial indices ... Message-ID: <20050829165335.X1044@ganymede.hub.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.032 required=5 tests=[AWL=-0.018, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200508/498 X-Sequence-Number: 14245 Try as I might, I can't seem to get it to work ... table has >9million rows in it, I've created an index "using btree ( priority ) where priority < 0;", where the table distribution looks like: priority | count ----------+--------- -2 | 138435 -1 | 943250 1 | 3416 9 | 1134171 | 7276960 (5 rows) And it still won't use the index: # explain update table set priority = -3 where priority = -1; QUERY PLAN ------------------------------------------------------------------ Seq Scan on table (cost=0.00..400735.90 rows=993939 width=278) Filter: (priority = -1) (2 rows) But, ti will if I try 'priority = -2' ... what is teh threshhold for using the index? obviously 10% of the records is too high ... thanks ... ---- Marc G. Fournier Hub.Org Networking Services (http://www.hub.org) Email: scrappy@hub.org Yahoo!: yscrappy ICQ: 7615664