Difference between revisions of "Vacuum"

From UVOO Tech Wiki
Jump to navigation Jump to search
(Created page with "# Postgres Vacuum ``` $ docker run --rm -d --name postgres postgres:10.1 6732b0b9c6245fe9f19dd58e9737e5102089814e4aa96b66217af28a1596f786 $ docker exec -it postgres bash ro...")
(No difference)

Revision as of 20:45, 19 April 2022

Postgres Vacuum

$ docker run --rm -d --name postgres postgres:10.1
6732b0b9c6245fe9f19dd58e9737e5102089814e4aa96b66217af28a1596f786

$ docker exec -it postgres bash

root@6732b0b9c624:/# psql -Upostgres
psql (10.1)
Type "help" for help.

postgres=# CREATE TABLE floor (
postgres(# name text,
postgres(# type text
postgres(# );
CREATE TABLE

postgres=# vacuum floor;
VACUUM

postgres=# SELECT relname, last_vacuum, last_autovacuum FROM pg_stat_user_tables;
 relname |          last_vacuum          | last_autovacuum 
---------+-------------------------------+-----------------
 floor   | 2019-04-24 17:52:26.044697+00 | 
(1 row)