Re: EXPLAIN output explanation requested

From: Ron Arts <ron(dot)arts(at)neonova(dot)nl>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: EXPLAIN output explanation requested
Date: 2008-06-03 17:51:05
Message-ID: 48458489.9080908@neonova.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

A. Kretschmer schreef:
> am Tue, dem 03.06.2008, um 12:35:34 +0200 mailte A. Kretschmer folgendes:
>> I guess, you have much insert/delete or update - operations on this
>> table and no recent vacuum.
>>
>> Try to run a 'vacuum full;' and re-run your query. And, run a 'explain
>> analyse <your query>' to see the estimated costs and the real costs.
>
> Btw, run 'select relpages, reltuples from pg_class where relname='phone';
> before and after the 'vacuum full' and show us the result.
>
>
> Andreas

I did a vacuum without success, but `vacuum full` did the trick:

tium=# select relpages, reltuples from pg_class where relname='phone';
relpages | reltuples
----------+-----------
85876 | 658
(1 row)
tium=# vacuum full;
VACUUM
tium=# select relpages, reltuples from pg_class where relname='phone';
relpages | reltuples
----------+-----------
17 | 248
(1 row)

tium=# explain analyze select codec1, phonetype from phone;
QUERY PLAN
-----------------------------------------------------------------------------------------------------
Seq Scan on phone (cost=0.00..76.77 rows=977 width=11) (actual time=0.007..0.751 rows=248 loops=1)
Total runtime: 0.957 ms
(2 rows)

tium=#

What do those values relpages and reltuples mean?

Thanks,
Ron

--
NeoNova BV, The Netherlands
Professional internet and VoIP solutions

http://www.neonova.nl Kruislaan 419 1098 VA Amsterdam
info: 020-5628292 servicedesk: 020-5628292 fax: 020-5628291
KvK Amsterdam 34151241

The following disclaimer applies to this email:
http://www.neonova.nl/maildisclaimer

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message A. Kretschmer 2008-06-03 18:24:58 Re: EXPLAIN output explanation requested
Previous Message Ron Arts 2008-06-03 11:10:10 Re: EXPLAIN output explanation requested