On Thu, 2025-03-06 at 11:15 -0500, Robert Haas wrote:
> To be honest, I am a bit surprised that we decided to enable this by
> default. It's not obvious to me that statistics should be regarded as
> part of the database in the same way that table definitions or table
> data are. That said, I'm not overwhelmingly opposed to that choice.
> However, even if it's the right choice in theory, we should maybe
> rethink if it's going to be too slow or use too much memory.
I don't have a strong opinion about whether stats will be opt-out or
opt-in for v18, but if they are opt-in, we would need to adjust the
available options a bit.
At minimum, we would need to at least add the option "--with-
statistics", because right now the only way to explicitly request stats
is to say "--statistics-only".
To generalize this concept: for each of {schema, data, stats} users
might want "yes", "no", or "only".
If we use this options scheme, it would be easy to change the default
for stats independently of the other options, if necessary, without
surprising consequences.
Patch attached. This patch does NOT change the default; stats are still
opt-out. But it makes it easier for users to start specifying what they
want or not explicitly, or to rely on the defaults if they prefer.
Note that the patch would mean we go from 2 options in v17:
--{schema|data}-only
to 9 options in v18:
--{with|no}-{schema|data|stats} and
--{schema|data|stats}-only
I suggest we adjust the options now with something resembling the
attached patch and decide on changing the default sometime during beta.
Regards,
Jeff Davis