pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: James Coleman <jtc331@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Cc: Simon Riggs <simon@2ndquadrant.com>
Subject: Re: PROC_IN_ANALYZE stillborn 13 years ago
Date: Thu, 06 Aug 2020 18:02:26 -0400
Message-ID: <2648863.1596751346@sss.pgh.pa.us> (raw)
In-Reply-To: <20200806214541.4lyyzekds65hrlcq@alap3.anarazel.de>
References: <20200805021435.GA9523@alvherre.pgsql>
	<20200805235549.GA8118@alvherre.pgsql>
	<20200806010711.mzvu36zy25xer33t@alap3.anarazel.de>
	<CA+TgmoZn5oX4j3KXMkQx=RN+QBgc_y3+1LjBcy_afOmJb-f0-A@mail.gmail.com>
	<2637311.1596739058@sss.pgh.pa.us>
	<CA+Tgmob0veNwAikDiuWTHcTpQHdqAHFqqgf9ycg9dZyiWR30eg@mail.gmail.com>
	<2638833.1596741087@sss.pgh.pa.us>
	<CA+TgmoZ9hycF=fu0V+812fOvTsje5bCV6vMdDWphSANOiv-vqw@mail.gmail.com>
	<20200806214541.4lyyzekds65hrlcq@alap3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> In fact using conceptually like a new snapshot for each sample tuple
> actually seems like it'd be somewhat of an improvement over using a
> single snapshot.

Dunno, that feels like a fairly bad idea to me.  It seems like it would
overemphasize the behavior of whatever queries happened to be running
concurrently with the ANALYZE.  I do follow the argument that using a
single snapshot for the whole ANALYZE overemphasizes a single instant
in time, but I don't think that leads to the conclusion that we shouldn't
use a snapshot at all.

Another angle that would be worth considering, aside from the issue
of whether the sample used for pg_statistic becomes more or less
representative, is what impact all this would have on the tuple count
estimates that go to the stats collector and pg_class.reltuples.
Right now, we don't have a great story at all on how the stats collector's
count is affected by combining VACUUM/ANALYZE table-wide counts with
the incremental deltas reported by transactions happening concurrently
with VACUUM/ANALYZE.  Would changing this behavior make that better,
or worse, or about the same?

			regards, tom lane





view thread (18+ messages)  latest in thread

Message-ID: <2648863.1596751346@sss.pgh.pa.us>
Permalink:  ../2648863.1596751346@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2648863.1596751346@sss.pgh.pa.us

 · 

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: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, robertmhaas@gmail.com, alvherre@2ndquadrant.com, jtc331@gmail.com, pgsql-hackers@lists.postgresql.org, simon@2ndquadrant.com
  Subject: Re: PROC_IN_ANALYZE stillborn 13 years ago
  In-Reply-To: <2648863.1596751346@sss.pgh.pa.us>

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

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