Re: I don't understand this explain output

From: Luiz Eduardo Cantanhede Neri <lecneri(at)gmail(dot)com>
To: Ron Arts <ron(dot)arts(at)neonova(dot)nl>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: I don't understand this explain output
Date: 2009-05-26 09:52:59
Message-ID: 252e1f290905260252w1cc96cap4e09be4b1b3e69f9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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(dot)arts(at)neonova(dot)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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Ognjen Blagojevic 2009-05-26 11:25:00 Re: Tool for modeling
Previous Message Ron Arts 2009-05-26 08:32:03 I don't understand this explain output