pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Vitaliy Garnashevich <vgarnashevich@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general@postgresql.org
Subject: Re: EXPLAIN BUFFERS: dirtied
Date: Mon, 29 Jan 2018 21:35:50 +0100
Message-ID: <d4f0d432-3dae-9ded-d502-5139175369b5@2ndquadrant.com> (raw)
In-Reply-To: <cf69d9d5-18f1-288b-c70c-186b3cde64dd@gmail.com>
References: <21a14f5f-b39c-3aa8-da2c-2112ee328b93@gmail.com>
	<6040.1517251115@sss.pgh.pa.us>
	<cf69d9d5-18f1-288b-c70c-186b3cde64dd@gmail.com>



On 01/29/2018 08:21 PM, Vitaliy Garnashevich wrote:
> I've read this article: https://wiki.postgresql.org/wiki/Hint_Bits
> 
> It says:
> 
>> A plain SELECT, count(*), or VACUUM on the entire table will check
>> every tuple for visibility and set its hint bits. 
> 
> Suppose, a new page was created using many INSERTs, and then was written
> to disk during a checkpoint. There were no SELECTs or VACUUM on the page
> or table yet. Will the following SELECT of one tuple from the page
> update hint bits for ALL tuples on the page? Is that correct?
> 

Possibly, if there are no old transactions running.

> When a page is initially created and then is being written to disk
> during a checkpoint, does checkpoint writer update the hint bits before
> writing the page, or the following SELECT/VACUUM will have to do that
> (possibly loading/updating/writing the page again)?
> 

Checkpoint only deals with 8kB chunks of data. Hint bits are not set on
a page, but on individual items (rows), so it's not up to the checkpoint
process to tweak that - that's up to queries accessing the data.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (5+ messages)  latest in thread

Message-ID: <d4f0d432-3dae-9ded-d502-5139175369b5@2ndquadrant.com>
Permalink:  ../d4f0d432-3dae-9ded-d502-5139175369b5@2ndquadrant.com/
Also on:    postgresql.org/message-id/d4f0d432-3dae-9ded-d502-5139175369b5@2ndquadrant.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, vgarnashevich@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: EXPLAIN BUFFERS: dirtied
  In-Reply-To: <d4f0d432-3dae-9ded-d502-5139175369b5@2ndquadrant.com>
  References: <21a14f5f-b39c-3aa8-da2c-2112ee328b93@gmail.com> <6040.1517251115@sss.pgh.pa.us> <cf69d9d5-18f1-288b-c70c-186b3cde64dd@gmail.com> <d4f0d432-3dae-9ded-d502-5139175369b5@2ndquadrant.com>

* 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