Sequential scan where Index scan expected.

From: Bryce Nesbitt <bryce1(at)obviously(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Sequential scan where Index scan expected.
Date: 2006-03-03 07:27:21
Message-ID: 4407EFD9.7050008@obviously.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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)

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bryce Nesbitt 2006-03-03 07:28:49 Sequential scan where Index scan expected (update)
Previous Message Michael Glaesemann 2006-03-03 05:25:47 Re: How to check date-interval constraints