From: Colton A Smith <smith@cs.utk.edu>
To: pgsql-performance@postgresql.org
Subject: poor performance involving a small table
Date: Thu, 26 May 2005 10:57:53 -0400 (EDT)
Message-ID: <Pine.GSO.4.62.0505261052180.25866@hydra3> (raw)
Hi:
I have a table called sensors:
Table "public.sensor"
Column | Type | Modifiers
-----------------+--------------------------+-------------------------------------------------
sensor_id | integer | not null default
nextval('sensor_id_seq'::text)
sensor_model_id | integer | not null
serial_number | character varying(50) | not null
purchase_date | timestamp with time zone | not null
variable_id | integer | not null
datalink_id | integer | not null
commentary | text |
Indexes:
"sensor_pkey" PRIMARY KEY, btree (sensor_id)
Foreign-key constraints:
"datalink_id_exists" FOREIGN KEY (datalink_id) REFERENCES
datalink(datalink_id) ON DELETE RESTRICT
"sensor_model_id_exists" FOREIGN KEY (sensor_model_id) REFERENCES
sensor_model(sensor_model_id) ON DELETE RESTRICT
"variable_id_exists" FOREIGN KEY (variable_id) REFERENCES
variable(variable_id) ON DELETE RESTRICT
Currently, it has only 19 rows. But when I try to delete a row, it takes
forever. I tried restarting the server. I tried a full vacuum to no
avail. I tried the following:
explain analyze delete from sensor where sensor_id = 12;
QUERY PLAN
------------------------------------------------------------------------------------------------
Seq Scan on sensor (cost=0.00..1.25 rows=1 width=6) (actual
time=0.055..0.068 rows=1 loops=1)
Filter: (sensor_id = 12)
Total runtime: 801641.333 ms
(3 rows)
Can anybody help me out? Thanks so much!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: smith@cs.utk.edu
Subject: Re: poor performance involving a small table
In-Reply-To: <Pine.GSO.4.62.0505261052180.25866@hydra3>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox