Re: Limiting setting of hint bits by read-only queries; vacuum_delay

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Greg Stark <stark(at)mit(dot)edu>
Cc: Kevin Grittner <kgrittn(at)ymail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Limiting setting of hint bits by read-only queries; vacuum_delay
Date: 2013-03-25 23:15:43
Message-ID: CAHyXU0xTtfMrj09E1rZdT3K7QDW7da6SUxXjfe8ZDxrjQDS+=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 25, 2013 at 5:57 PM, Greg Stark <stark(at)mit(dot)edu> wrote:
> On Mon, Mar 25, 2013 at 9:53 PM, Kevin Grittner <kgrittn(at)ymail(dot)com> wrote:
>> That would make it harder to construct a degenerate case
>
> I don't think it's hard at all. It's the same as the case Simon wants
> to solve except that the cost is incurred in a different way. Imagine
> a system where there's a huge data load to a table which is then
> read-only for an OLTP system. Until vacuum comes along -- and it may
> never since the table never sees deletes or updates -- every
> transaction needs to do a clog lookup for every tuple it sees. That
> means a significant cpu slowdown for every row lookup forever more. To
> save a one-time i/o cost.

That is simply not the case, unless every tuple was created by a
unique (or at least non-sequential) transaction xid. There is a 'last
transaction id' guard over clog lookup which is pretty effective. The
real cost is actually i/o from writing hint bits.

merlin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-03-25 23:18:31 Re: Limiting setting of hint bits by read-only queries; vacuum_delay
Previous Message Tom Lane 2013-03-25 23:07:42 Re: pg_upgrade segfaults when given an invalid PGSERVICE value