aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/vacuum.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-10-05 10:47:47 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-10-05 10:47:47 -0400
commit4d85c2900b113e331925baf308cc7fc75ac4530b (patch)
treed3ee80e47eaa3acca4c2cb40c54788505252788f /src/backend/commands/vacuum.c
parent4b2ba1fe0222b7820a2f4cd52b133baeb91c5a93 (diff)
downloadpostgresql-4d85c2900b113e331925baf308cc7fc75ac4530b.tar.gz
postgresql-4d85c2900b113e331925baf308cc7fc75ac4530b.zip
Improve comments in vacuum_rel() and analyze_rel().
Remove obsolete references to get_rel_oids(). Avoid listing specific relkinds in the comments, since we seem unable to keep such things in sync with the code, and it's not all that helpful anyhow. Noted by Michael Paquier, though I rewrote the comments a bit more. Discussion: https://postgr.es/m/CAB7nPqTWiN9zwKTaOrsnKiGDChqRt7C1+CiiDk4N4OMn92rs6A@mail.gmail.com
Diffstat (limited to 'src/backend/commands/vacuum.c')
-rw-r--r--src/backend/commands/vacuum.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index f439b55ea5e..cbd6e9b1616 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -1309,6 +1309,9 @@ vac_truncate_clog(TransactionId frozenXID,
* do not use it once we've successfully opened the rel, since it might
* be stale.
*
+ * Returns true if it's okay to proceed with a requested ANALYZE
+ * operation on this table.
+ *
* Doing one heap at a time incurs extra overhead, since we need to
* check that the heap exists again just before we vacuum it. The
* reason that we do this is so that vacuuming can be spread across
@@ -1444,9 +1447,7 @@ vacuum_rel(Oid relid, RangeVar *relation, int options, VacuumParams *params)
}
/*
- * Check that it's a vacuumable relation; we used to do this in
- * get_rel_oids() but seems safer to check after we've locked the
- * relation.
+ * Check that it's of a vacuumable relkind.
*/
if (onerel->rd_rel->relkind != RELKIND_RELATION &&
onerel->rd_rel->relkind != RELKIND_MATVIEW &&
@@ -1478,17 +1479,16 @@ vacuum_rel(Oid relid, RangeVar *relation, int options, VacuumParams *params)
}
/*
- * Ignore partitioned tables as there is no work to be done. Since we
- * release the lock here, it's possible that any partitions added from
- * this point on will not get processed, but that seems harmless.
+ * Silently ignore partitioned tables as there is no work to be done. The
+ * useful work is on their child partitions, which have been queued up for
+ * us separately.
*/
if (onerel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
{
relation_close(onerel, lmode);
PopActiveSnapshot();
CommitTransactionCommand();
-
- /* It's OK for other commands to look at this table */
+ /* It's OK to proceed with ANALYZE on this table */
return true;
}