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 DDBF89DCD94 for ; Fri, 3 Mar 2006 03:28:58 -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 83872-09 for ; Fri, 3 Mar 2006 03:28:58 -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 E9FE39DCD79 for ; Fri, 3 Mar 2006 03:28:55 -0400 (AST) Received: from idiom.com (idiom.com [216.240.32.1]) by outbound.internet-mail-service.net (Postfix) with ESMTP id C09FF2408AC for ; Thu, 2 Mar 2006 23:28:56 -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 k237SuHP063876 for ; Thu, 2 Mar 2006 23:28:56 -0800 (PST) (envelope-from bryce1@obviously.com) Message-ID: <4407F031.6050706@obviously.com> Date: Thu, 02 Mar 2006 23:28:49 -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 (update) 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=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.148 required=5 tests=[AWL=0.148] X-Spam-Score: 0.148 X-Spam-Level: X-Archive-Number: 200603/59 X-Sequence-Number: 24405 I'm getting sequential scans (and poor performance), on scans using my primary keys. This is an older postgres. 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) demo=# select * from version(); version ---------------------------------------------------------------------------------------------------------- PostgreSQL 7.4.1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-20) (1 row)