On Sun, Dec 8, 2019 at 7:12 PM Mark Dilger <hornschnorter@gmail.com> wrote:
> I think the words "IF AND ONLY IF AUTOVACUUM WOULD" should be
> replaced with a single word and added to the grammar where
> vacuum_option_elem lists VERBOSE, FREEZE and FULL. Perhaps
> "OPTIONALLY", or "AUTOVACUUMESQUE", though I'm really hoping
> somebody has a better suggestion.
vacuum_option_elem doesn't exist any more, since commit
6776142a07afb4c28961f27059d800196902f5f1.
I think OPTIONALLY would be a fine keyword:
VACUUM (OPTIONALLY) my_table;
ANALYZE (OPTIONALLY) my_table;
It wouldn't even need to be a parser keyword; see
disable_page_skipping for a comparable.
> In the given example, above, the user would likely set the vacuum
> and analyze scale factors to zero and the thresholds to something
> they've empirically determined to work well for their purposes.
> That might be a problem in practice, given that it also impacts
> autovacuum's choices. Would people prefer that those thresholds
> be passed as parameters to the command directly?
>
> VACUUM sometable OPTIONALLY (vacuum_threshold = 10, vacuum_scale = 0)
>
> and only default to autovacuum's settings when not specified?
I think that syntax is a non-starter. We should try to fit into the
existing mold for vacuum options. But I don't see a reason why we
couldn't allow:
VACUUM (OPTIONALLY, THRESHOLD 10, SCALE 0) my_table;
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company