Personaly I have no ideia what's happenning but I got a suggestion that may be a long shot, but try to vacuum de table or database.
From what I know from pg is every update / delete just happens logic, meaning that it flag the row updated as old and add a new one to file. Since you told that this table is updated every minute I thought it might have something to do with it.
On Tue, May 26, 2009 at 5:32 AM, Ron Arts
<ron.arts@neonova.nl> wrote:
Hi,
I am looking at a very simple query (select * from queue),
which takes forever to finish. I don't understand the output that
explain tells me:
m=# explain select * from queue;
QUERY PLAN
------------------------------------------------------------
Seq Scan on queue (cost=0.00..635477.00 rows=1 width=402)
(1 row)
The cost seems to be very high. It's a small table (only 23 rows)
and has not seen many modifications since the table was initially
filled. OTOH many individual records are updated every minute.
If I look at anopther table in the same database:
m=# explain select * from contact;
QUERY PLAN
-------------------------------------------------------------
Seq Scan on contact (cost=0.00..183.14 rows=614 width=411)
(1 row)
and this query finishes very quickly (614 rows).
Why would a simple query be so very costly?
Thanks,
Ron Arts
--
NeoNova BV
innovatieve internetoplossingen
http://www.neonova.nl Science Park 140 1098 XG Amsterdam
info: 020-5611300 servicedesk: 020-5611302 fax: 020-5611301
KvK Amsterdam 34151241
Op dit bericht is de volgende disclaimer van toepassing:
http://www.neonova.nl/maildisclaimer
--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice