public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jeff Davis <[email protected]>
To: Corey Huinker <[email protected]>
To: jian he <[email protected]>
Cc: Matthias van de Meent <[email protected]>
Cc: Bruce Momjian <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Nathan Bossart <[email protected]>
Cc: Magnus Hagander <[email protected]>
Cc: Stephen Frost <[email protected]>
Cc: Ashutosh Bapat <[email protected]>
Cc: Peter Smith <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: [email protected]
Subject: Re: Statistics Import and Export
Date: Fri, 25 Oct 2024 15:18:48 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <CADkLM=eErgzn7ECDpwFcptJKOk9SxZEk5Pot4d94eVTZsvj3gw@mail.gmail.com>
References: <[email protected]>
	<[email protected]>
	<CADkLM=dA0tOc_fGDoiRsF41XFFH2_S3D5kibcbw9H948KdsS-A@mail.gmail.com>
	<CADkLM=eE2BD-40uGMOpJs19inYJ2PSY+21srXT0K49NseBe30w@mail.gmail.com>
	<20240417165053.GA3253364@nathanxps13>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAEze2WiX_YWEhe4iLSLHEkSJimE0=wU1cGhmPikurZGOTrh1tg@mail.gmail.com>
	<[email protected]>
	<CAEze2WjM8QDZUJa7G4_Om2B76nFMw5RYz+1D+J=VMpr6aN3BJQ@mail.gmail.com>
	<CADkLM=dHYkDa-raQrahd5-PkO_=aw1RuffUxVAfEnEyX5ZOB5A@mail.gmail.com>
	<CADkLM=cQgghMJOS8EcAVBwRO4s1dUVtxGZv5gLPfZkQ1nL1gzA@mail.gmail.com>
	<[email protected]>
	<CADkLM=dse9b6VYkgt8MMe3htt=tD1bZOdk3KvH=3Gt17LqSVXA@mail.gmail.com>
	<[email protected]>
	<CADkLM=dNQzmdsWfXVVDBqv7gHsa-7dk3v13AqrAzBoJWTMrWEA@mail.gmail.com>
	<CADkLM=ccvjLJeGnWzbH8N=2aBNpnL5HnwC4Ny2LqFVJyGH5ZKw@mail.gmail.com>
	<[email protected]>
	<CADkLM=c9gnYMkQCyh1+R56VrCkVWbu8-SCpmHepkbAJHMcVuuA@mail.gmail.com>
	<CADkLM=f_SNcxfPC-XbwcHgCdS6FPSNo-=UZq08AWFYoBCDcxOg@mail.gmail.com>
	<[email protected]>
	<CADkLM=evyx0L96XxrLSUDVS+iXgHszLbWMrGwVbBnNVO1ejfJA@mail.gmail.com>
	<CADkLM=cJMEYrP8o4dbAqm_mW=ks63sXi1VXy94ybev0BNLm7_g@mail.gmail.com>
	<[email protected]>
	<CADkLM=chb8YT+OD40aDDj1MGz52FMw6-SW3atgEpsw6Rp-3mhg@mail.gmail.com>
	<[email protected]>
	<CADkLM=e0jM7m0GFV44nNtvL22CtnFUu+pekppCVE=DOBe58RTQ@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<CADkLM=eu72o_=s2ARNe8yB-16AUm+_iU0tq_ALeeUUxCCqJkOQ@mail.gmail.com>
	<[email protected]>
	<CACJufxHrJb3L66kzYWeFvN_7RNROaHKUo_JuXK6B64c+TkWOhA@mail.gmail.com>
	<CADkLM=edhVxHr5OGZHnUeoMkjFYNpE==puOKbB1E_7j1=QsbBw@mail.gmail.com>
	<CACJufxGmdV-9c7M_fs-2mGBMj1XiVqdOkW0NvibmpBJqedo1uQ@mail.gmail.com>
	<CADkLM=eErgzn7ECDpwFcptJKOk9SxZEk5Pot4d94eVTZsvj3gw@mail.gmail.com>

On Tue, 2024-09-17 at 05:02 -0400, Corey Huinker wrote:
> 
> I've taken most of Jeff's work, reincorporated it into roughly the
> same patch structure as before, and am posting it now.

I have committed the import side of this patch series; that is, the
function calls that can load stats into an existing cluster without the
need to ANALYZE.

The pg_restore_*_stats() functions are designed such that pg_dump can
emit the calls. Some design choices of the functions worth noting:

  (a) a variadic signature of name/value pairs rather than ordinary SQL
arguments, which makes it easier for future versions to interpret what
has been output from a previous version; and
  (b) many kinds of errors are demoted to WARNINGs, to allow some
statistics to be set for an attribute even if other statistics are
malformed (also a future-proofing design); and
  (c) we are considering whether to use an in-place heap update for the
relation stats, so that a large restore doesn't bloat pg_class -- I'd
like feedback on this idea

The pg_set_*_stats() functions are designed for interactive use, such
as tweaking statistics for planner testing, experimentation, or
reproducing a plan outside of a production system. The aforementioned
design choices don't make a lot of sense in this context, so that's why
the pg_set_*_stats() functions are separate from the
pg_restore_*_stats() functions. But there's a lot of overlap, so it may
be worth discussing again whether we should only have one set of
functions.

Regards,
	Jeff Davis







view thread (42+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Statistics Import and Export
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox