postgresql/src/backend/commands
Kevin Grittner 5fc893760f Ensure ANALYZE phase is not skipped because of canceled truncate.
Patch b19e4250b4 attempted to
preserve existing behavior regarding statistics generation in the
case that a truncation attempt was canceled due to lock conflicts.
It failed to do this accurately in two regards: (1) autovacuum had
previously generated statistics if the truncate attempt failed to
initially get the lock rather than having started the attempt, and
(2) the VACUUM ANALYZE command had always generated statistics.

Both of these changes were unintended, and are reverted by this
patch.  On review, there seems to be consensus that the previous
failure to generate statistics when the truncate was terminated
was more an unfortunate consequence of how that effort was
previously terminated than a feature we want to keep; so this
patch generates statistics even when an autovacuum truncation
attempt terminates early.  Another unintended change which is kept
on the basis that it is an improvement is that when a VACUUM
command is truncating, it will the new heuristic for avoiding
blocking other processes, rather than keeping an
AccessExclusiveLock on the table for however long the truncation
takes.

Per multiple reports, with some renaming per patch by Jeff Janes.

Backpatch to 9.0, where problem was created.
2013-04-29 13:05:26 -05:00
..
aggregatecmds.c Code beautification for object-access hook machinery. 2013-03-06 20:53:25 -05:00
alter.c Allow extracting machine-readable object identity 2013-03-20 18:19:19 -03:00
analyze.c Arrange to cache FdwRoutine structs in foreign tables' relcache entries. 2013-03-06 23:48:09 -05:00
async.c Fix bogus when-to-deregister-from-listener-array logic. 2013-02-13 12:48:05 -05:00
cluster.c Create a distinction between a populated matview and a scannable one. 2013-04-09 13:02:49 -05:00
collationcmds.c Refactor ALTER some-obj RENAME implementation 2013-01-21 12:06:41 -03:00
comment.c Add a materialized view relations. 2013-03-03 18:23:31 -06:00
constraint.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
conversioncmds.c Refactor ALTER some-obj RENAME implementation 2013-01-21 12:06:41 -03:00
copy.c Support writable foreign tables. 2013-03-10 14:16:02 -04:00
createas.c Incidental cleanup of matviews code. 2013-04-27 17:48:57 -04:00
dbcommands.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
define.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
discard.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
dropcmds.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
event_trigger.c Remove quotes around SQL statement in error message 2013-04-11 12:00:09 -03:00
explain.c Clean up the mess around EXPLAIN and materialized views. 2013-04-12 19:25:31 -04:00
extension.c Editorialize a bit on new ProcessUtility() API. 2013-04-28 00:18:45 -04:00
foreigncmds.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
functioncmds.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
indexcmds.c Avoid deadlock between concurrent CREATE INDEX CONCURRENTLY commands. 2013-04-25 16:58:05 -04:00
lockcmds.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
Makefile Add a materialized view relations. 2013-03-03 18:23:31 -06:00
matview.c Incidental cleanup of matviews code. 2013-04-27 17:48:57 -04:00
opclasscmds.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
operatorcmds.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
portalcmds.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
prepare.c Clean up the mess around EXPLAIN and materialized views. 2013-04-12 19:25:31 -04:00
proclang.c Code beautification for object-access hook machinery. 2013-03-06 20:53:25 -05:00
schemacmds.c Editorialize a bit on new ProcessUtility() API. 2013-04-28 00:18:45 -04:00
seclabel.c Add a materialized view relations. 2013-03-03 18:23:31 -06:00
sequence.c Clean up the mess around EXPLAIN and materialized views. 2013-04-12 19:25:31 -04:00
tablecmds.c Clean up the mess around EXPLAIN and materialized views. 2013-04-12 19:25:31 -04:00
tablespace.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
trigger.c Editorialize a bit on new ProcessUtility() API. 2013-04-28 00:18:45 -04:00
tsearchcmds.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
typecmds.c Clean up the mess around EXPLAIN and materialized views. 2013-04-12 19:25:31 -04:00
user.c Extend object-access hook machinery to support post-alter events. 2013-03-17 22:57:26 -04:00
vacuum.c Add a materialized view relations. 2013-03-03 18:23:31 -06:00
vacuumlazy.c Ensure ANALYZE phase is not skipped because of canceled truncate. 2013-04-29 13:05:26 -05:00
variable.c Update copyrights for 2013 2013-01-01 17:15:01 -05:00
view.c Clean up the mess around EXPLAIN and materialized views. 2013-04-12 19:25:31 -04:00