Explain returns extremely high cost

From: "Andrii Vasyliev" <andrii(dot)vasyliev(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Explain returns extremely high cost
Date: 2006-08-15 07:14:49
Message-ID: dc7e00e30608150014m7a5716dck1ff51c7c9871a04d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

I have a database just recreated from scratch with SQL script.
(My PostgreSQL version is 8.1.3).
All of the tables are pretty empty, but that's what I've got with explain:

EXPLAIN SELECT * FROM account;
QUERY PLAN
------------------------------------------------------------------------
Seq Scan on account (cost=100000000.00..100000001.05 rows=5 width=41)

This is what I have in the table:

SELECT * FROM account;
obj_id | login | password | client_id | service_id | type_id | state_id
---------+---------+-------------+-----------+------------+---------+----------
1000513 | root | _system____ | 1000471 | 1000486 | 1000113 | 1000209
1000548 | root | _system____ | 1000472 | 1000536 | 1000113 | 1000209
1000550 | root | _system____ | 1000475 | 1000534 | 1000113 | 1000209
1000552 | sol | _sol | 1000472 | 1000536 | 1000113 | 1000209
1000554 | seregik | _seregik | 1000475 | 1000534 | 1000113 | 1000209
(5 rows)
Time: 1.346 ms

For other tables I have more or less the same high costs.

I've done VACUUM ANALYZE. This is what I have in pg_class table:

SELECT relpages,reltuples FROM pg_class WHERE relname='account';
relpages | reltuples
----------+-----------
1 | 5

Why the costs are so high? Is it a bug?
Thanks in advance for any suggestions!
Regards, Andrii

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kari Lavikka 2006-08-15 09:08:40 Excluding a table from pg_dump
Previous Message marcelo Cortez 2006-08-14 23:20:47 Re: wal files on temporary tables