Vacuum

From UVOO Tech Wiki
Revision as of 20:45, 19 April 2022 by Busk (talk | contribs) (Created page with "# Postgres Vacuum ``` $ docker run --rm -d --name postgres postgres:10.1 6732b0b9c6245fe9f19dd58e9737e5102089814e4aa96b66217af28a1596f786 $ docker exec -it postgres bash ro...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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)