X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 843F19DCDD3 for ; Fri, 3 Mar 2006 03:27:31 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83892-07 for ; Fri, 3 Mar 2006 03:27:31 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from outbound.internet-mail-service.net (outbound6.internet-mail-service.net [216.240.47.197]) by postgresql.org (Postfix) with ESMTP id 1B7E99DCD94 for ; Fri, 3 Mar 2006 03:27:28 -0400 (AST) Received: from idiom.com (idiom.com [216.240.32.1]) by outbound.internet-mail-service.net (Postfix) with ESMTP id 5A5E9241487 for ; Thu, 2 Mar 2006 23:27:29 -0800 (PST) Received: from [192.168.1.109] (adsl-69-107-112-198.dsl.pltn13.pacbell.net [69.107.112.198]) by idiom.com (8.12.11/8.12.11) with ESMTP id k237RSYA062593 for ; Thu, 2 Mar 2006 23:27:29 -0800 (PST) (envelope-from bryce1@obviously.com) Message-ID: <4407EFD9.7050008@obviously.com> Date: Thu, 02 Mar 2006 23:27:21 -0800 From: Bryce Nesbitt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050921 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Sequential scan where Index scan expected. References: <244004377.20060302124132@isb.com.pl> <2873.1141312882@sss.pgh.pa.us> In-Reply-To: <2873.1141312882@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.15 required=5 tests=[AWL=0.150] X-Spam-Score: 0.15 X-Spam-Level: X-Archive-Number: 200603/58 X-Sequence-Number: 24404 I'm getting sequential scans (and poor performance), on scans using my primary keys. Can anyone help figure out why? demo=# \d xx_thing Table "public.xx_thing" Column | Type | Modifiers -------------------------+-----------------------------+----------- thing_id | bigint | not null thing_model | character varying(128) | thing_color | character varying(128) | thing_year | integer | Indexes: "xx_thing_pkey" primary key, btree (thing_id) demo=# analyze verbose xx_thing_event; INFO: analyzing "public.xx_thing_event" INFO: "xx_thing_event": 3374 pages, 3000 rows sampled, 197478 estimated total rows demo=# explain update xx_thing_event set thing_color='foo' where thing_event_id=10000; QUERY PLAN --------------------------------------------------------------------- Seq Scan on xx_thing_event (cost=0.00..5842.48 rows=1 width=110) Filter: (thing_event_id = 10000) (2 rows)