On 7/18/18, 12:00 PM, "Bossart, Nathan" <bossartn@amazon.com> wrote:
> On 7/17/18, 1:22 AM, "Michael Paquier" <michael@paquier.xyz> wrote:
>> The stuff of get_elevel_for_skipped_relation could be refactored into
>> something used as well by cluster_rel as the same logic is used in three
>> places (vacuum_rel, analyze_rel and cluster_rel with try_relation_open).
>
> This seems like a good idea if we intend to add SKIP LOCKED to CLUSTER
> eventually, and it would be nice to cut down on some of the duplicated
> ereport() calls. I'll look into it.
Here is a patch for refactoring the ereport() calls out of
vacuum_rel() and analyze_rel(). I've kept all four possible log
statements separated for ease of translation. I considered
simplifying these statements by replacing "vacuum" and "analyze" with
"processing." However, that seems like it could lead to ambiguity for
commands like "VACUUM (ANALYZE, SKIP_LOCKED) table1 (a);" since both
VACUUM and ANALYZE could be skipped independently. If we add
SKIP_LOCKED to CLUSTER in the future, we will need to add two more log
statements to this function.
Nathan