pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedStrange scenary.
2+ messages / 2 participants
[nested] [flat]
* Strange scenary.
@ 2004-07-03 21:18 Guido Barosio <gbarosio@sinectis.com.ar>
2004-07-08 16:46 ` Re: Strange scenary. Stephan Szabo <sszabo@megazone.bigpanda.com>
0 siblings, 1 reply; 2+ messages in thread
From: Guido Barosio @ 2004-07-03 21:18 UTC (permalink / raw)
To: pgsql-admin
Hi,
This is the problem. I create a database from cero. I create a empty table, name students. I ask for an EXPLAIN
on this new table, and the output of the query analyzer tells me that this table is filled with 1000 rows.
So...why is that?
This were the steps.
-bash-2.05b$ dropdb scopes
DROP DATABASE
-bash-2.05b$ createdb scopes
CREATE DATABASE
-bash-2.05b$ psql scopes
Welcome to psql, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
scopes=# create table students (id smallint, name text);
CREATE
scopes=# explain select * from students ;
NOTICE: QUERY PLAN:
Seq Scan on students (cost=0.00..20.00 rows=1000 width=34)
EXPLAIN
scopes=# select * from students ;
id | name
----+------
(0 rows)
scopes=# VACUUM students ;
VACUUM
scopes=# explain select * from students ;
NOTICE: QUERY PLAN:
Seq Scan on students (cost=0.00..0.00 rows=1 width=34)
EXPLAIN
scopes=#
Anyone can tell me why this is going on? I mean..as I see this is not true.
--
-------------------------------------------
Guido Barosio
Buenos Aires, Argentina
-------------------------------------------
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Strange scenary.
2004-07-03 21:18 Strange scenary. Guido Barosio <gbarosio@sinectis.com.ar>
@ 2004-07-08 16:46 ` Stephan Szabo <sszabo@megazone.bigpanda.com>
0 siblings, 0 replies; 2+ messages in thread
From: Stephan Szabo @ 2004-07-08 16:46 UTC (permalink / raw)
To: Guido Barosio <gbarosio@sinectis.com.ar>; +Cc: pgsql-admin
On Sat, 3 Jul 2004, Guido Barosio wrote:
> Hi,
>
> This is the problem. I create a database from cero. I create a empty table, name students. I ask for an EXPLAIN
> on this new table, and the output of the query analyzer tells me that this table is filled with 1000 rows.
>
> So...why is that?
That's the default value set for the estimated number of rows; that row
count is the estimated rows based on the statistics not the actual
number of rows returned (see EXPLAIN ANALYZE's second set of numbers
for each step for that information) and you haven't run analyze to give it
more accurate statistics.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-07-08 16:46 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-07-03 21:18 Strange scenary. Guido Barosio <gbarosio@sinectis.com.ar>
2004-07-08 16:46 ` Stephan Szabo <sszabo@megazone.bigpanda.com>
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