vacuum-phases">
+
VACUUM Phases
|
initializing
- The command is preparing to begin scanning the heap. This phase is
- expected to be very brief.
-
-
- |
- seq scanning heap
-
- The command is currently scanning the table using a sequential scan.
+ VACUUM is preparing to begin scanning the heap. This
+ phase is expected to be very brief.
|
- index scanning heap
+ scanning heap
- CLUSTER is currently scanning the table using an index scan.
+ VACUUM is currently scanning the heap. It will prune and
+ defragment each page if required, and possibly perform freezing
+ activity. The heap_blks_scanned column can be used
+ to monitor the progress of the scan.
|
- sorting tuples
+ vacuuming indexes
- CLUSTER is currently sorting tuples.
+ VACUUM is currently vacuuming the indexes. If a table has
+ any indexes, this will happen at least once per vacuum, after the heap
+ has been completely scanned. It may happen multiple times per vacuum
+ if (or, in the case of autovacuum,
+ if set) is insufficient to store
+ the number of dead tuples found.
|
- writing new heap
+ vacuuming heap
- CLUSTER is currently writing the new heap.
+ VACUUM is currently vacuuming the heap. Vacuuming the heap
+ is distinct from scanning the heap, and occurs after each instance of
+ vacuuming indexes. If heap_blks_scanned is less than
+ heap_blks_total, the system will return to scanning
+ the heap after this phase is completed; otherwise, it will begin
+ cleaning up indexes after this phase is completed.
|
- swapping relation files
+ cleaning up indexes
- The command is currently swapping newly-built files into place.
+ VACUUM is currently cleaning up indexes. This occurs after
+ the heap has been completely scanned and all vacuuming of the indexes
+ and the heap has been completed.
|
- rebuilding index
+ truncating heap
- The command is currently rebuilding an index.
+ VACUUM is currently truncating the heap so as to return
+ empty pages at the end of the relation to the operating system. This
+ occurs after cleaning up indexes.
|
performing final cleanup
- The command is performing final cleanup. When this phase is
- completed, CLUSTER
- or VACUUM FULL will end.
+ VACUUM is performing final cleanup. During this phase,
+ VACUUM will vacuum the free space map, update statistics
+ in pg_class, and report statistics to the cumulative
+ statistics system. When this phase is completed, VACUUM will end.
-
-
COPY Progress Reporting
-
-
-
-
- Whenever COPY is running, the
- pg_stat_progress_copy view will contain one row
- for each backend that is currently running a COPY command.
- The table below describes the information that will be reported and provides
- information about how to interpret it.
-
-
-
-
pg_stat_progress_copy View
-
-
- |
- Column Type
-
- Description
-
-
-
-
-
- |
- pid integer
-
- Process ID of backend.
-
-
-
- |
- datid oid
-
- OID of the database to which this backend is connected.
-
-
-
- |
- datname name
-
- Name of the database to which this backend is connected.
-
-
-
- |
- relid oid
-
- OID of the table on which the COPY command is
- executed. It is set to 0 if copying from a
- SELECT query.
-
-
-
- |
- command text
-
- The command that is running: COPY FROM, or
- COPY TO.
-
-
-
- |
- type text
-
- The io type that the data is read from or written to:
- FILE, PROGRAM,
- PIPE (for COPY FROM STDIN and
- COPY TO STDOUT), or CALLBACK
- (used for example during the initial table synchronization in
- logical replication).
-
-
-
- |
- bytes_processed bigint
-
- Number of bytes already processed by COPY command.
-
-
-
- |
- bytes_total bigint
-
- Size of source file for COPY FROM command in bytes.
- It is set to 0 if not available.
-
-
-
- |
- tuples_processed bigint
-
- Number of tuples already processed by COPY command.
-
-
-
- |
- tuples_excluded bigint
-
- Number of tuples not processed because they were excluded by the
- WHERE clause of the COPY command.
-
-
-
-
-
-
-