No problem, only curiosity - Mailing list pgsql-admin

From Loles
Subject No problem, only curiosity
Date
Msg-id CA+FWGK6U4RfPZqE=1RMTwU8ezqhJp8NBGuf_pErLF-RbtJ_FNA@mail.gmail.com
Whole thread Raw
Responses Re: No problem, only curiosity  (Erik Wienhold <ewie@ewie.name>)
List pgsql-admin
Hello community!

Does anyone know why I am getting a result less than 2 million rows in this example?

postgres=# create table test_n_tup_live (id serial);
CREATE TABLE

postgres=# insert into test_n_tup_live select generate_series(1,1000000);
INSERT 0 1000000

postgres=# analyze test_n_tup_live ;
ANALYZE

postgres=# select n_live_tup, n_dead_tup from pg_stat_user_tables where relname = 'test_n_tup_live';

 n_live_tup | n_dead_tup
------------+------------
    1000000 |          0
(1 fila)

postgres=# update test_n_tup_live set id = id + 1;
UPDATE 1000000

postgres=# insert into test_n_tup_live select generate_series(1,1000000);
INSERT 0 1000000

postgres=# select n_live_tup, n_dead_tup from pg_stat_user_tables where relname = 'test_n_tup_live';
 n_live_tup | n_dead_tup
------------+------------
    2000000 |    1000000
(1 fila)

postgres=# vacuum test_n_tup_live;
VACUUM

postgres=# select n_live_tup, n_dead_tup from pg_stat_user_tables where relname = 'test_n_tup_live';

 n_live_tup | n_dead_tup
------------+------------
    1999925 |          0
(1 fila)

Thanks!

pgsql-admin by date:

Previous
From: Scott Ribe
Date:
Subject: Re: Postgres on L2ARC
Next
From: Erik Wienhold
Date:
Subject: Re: No problem, only curiosity