Search Postgresql Archives

Re: VACUUM and transactions in different databases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Sorry, i was out

The first try was:

create database dummy1;
create table dummy ... and filled with 500 records

create database dummy2;
create table dummy ... and filled with 500 records


connecting to dummy1, opening a transaction and issued an update

begin;
update dummy set f1='achterbahn';


then opened a second console and connected to dummy2:

dummy2=# select count(*) from dummy;
 count
-------
  5000
(1 row)

dummy2=# SELECT relpages, reltuples FROM pg_class WHERE relname ='dummy';
 relpages | reltuples
----------+-----------
      160 |      5000
(1 row)

updated the table several times - to generate dead tuples:

dummy2=# SELECT relpages, reltuples FROM pg_class WHERE relname ='dummy';
 relpages | reltuples
----------+-----------
      326 |     30000
(1 row)

dummy2=# vacuum;
VACUUM
dummy2=# SELECT relpages, reltuples FROM pg_class WHERE relname ='dummy';
 relpages | reltuples
----------+-----------
      326 |     30000
(1 row)

dummy2=# select count(*) from dummy;
 count
-------
  5000
(1 row)

dummy2=# vacuum full;
--------------------------------
vacuum was in waiting state as long the transaction in dummy1 was opened. After committing the transaction the vacuum full was carried out.
-------------------------------
VACUUM

dummy2=# SELECT relpages, reltuples FROM pg_class WHERE relname ='dummy';
 relpages | reltuples
----------+-----------
      326 |     30000
(1 row)


running on pg 8.1.4 on Fedora 5

Thanks
Conni


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux