Re: pgsql: Support partition pruning at execution time

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Support partition pruning at execution time
Date: 2018-04-08 03:34:22
Message-ID: 876052idlu.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

>>>>> "David" == David Rowley <david(dot)rowley(at)2ndquadrant(dot)com> writes:

>> Setting autovacuum_naptime to 10 seconds makes it occur in 10 second
>> intervals...

David> Ok, I thought it might have been some concurrent vacuum on the
David> table but the only tables I see being vacuumed are system
David> tables.

It's not vacuum that tends to be the problem, but analyze (on any
table). Lazy-vacuum's snapshots are mostly ignored for computing global
xmin horizons by other vacuums, but analyze's snapshots are not.

David> I tried performing a manual vacuum of each of these and could
David> not get it to trigger, but then I did:

David> select * from pg_class;

David> from another session and then the script starts spitting out
David> some errors.

Obviously, because the select holds a snapshot and therefore also holds
back OldestXmin.

You can't ever assume that data you just inserted will become
all-visible just because you just vacuumed the table, unless you know
that there is NO concurrent activity that might have a snapshot (and no
other possible reason why OldestXmin might be older than your insert).

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2018-04-08 03:42:23 Re: pgsql: Support partition pruning at execution time
Previous Message David Rowley 2018-04-08 03:25:32 Re: pgsql: Support partition pruning at execution time

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2018-04-08 03:37:06 Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS
Previous Message Craig Ringer 2018-04-08 03:27:45 Re: PostgreSQL's handling of fsync() errors is unsafe and risks data loss at least on XFS