Re: Limiting setting of hint bits by read-only queries; vacuum_delay - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: Limiting setting of hint bits by read-only queries; vacuum_delay
Date
Msg-id CAHyXU0xTtfMrj09E1rZdT3K7QDW7da6SUxXjfe8ZDxrjQDS+=A@mail.gmail.com
Whole thread Raw
In response to Re: Limiting setting of hint bits by read-only queries; vacuum_delay  (Greg Stark <stark@mit.edu>)
List pgsql-hackers
On Mon, Mar 25, 2013 at 5:57 PM, Greg Stark <stark@mit.edu> wrote:
> On Mon, Mar 25, 2013 at 9:53 PM, Kevin Grittner <kgrittn@ymail.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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_upgrade segfaults when given an invalid PGSERVICE value
Next
From: Tom Lane
Date:
Subject: Re: Limiting setting of hint bits by read-only queries; vacuum_delay