Re: unlogged tables

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Matheus de Oliveira <matioli(dot)matheus(at)gmail(dot)com>, dgabriel <gabriel(dot)dodan(at)gmail(dot)com>, pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: unlogged tables
Date: 2015-04-13 21:13:12
Message-ID: 20150413211312.GS4369@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Jim Nasby wrote:

> Yeah, this is not something that would be very easy to accomplish, because a
> buffer can get evicted and written to disk at any point. It wouldn't be too
> hard to read every unlogged table during recovery and see if there are any
> pages that were written after the last checkpoint, but that obviously won't
> be very fast.

If you consider only tables, then yeah perhaps this is easy to
accomplish (not really convinced myself). But if you consider indexes,
things are not so easy anymore.

In the thread from 2011 (which this started as a reply to) the OP was
doing frequent UPDATEs to keep track of counts of something. I think
that would be better served by using INSERTs of deltas and periodic
accumulation of grouped values, as suggested in
http://www.postgresql.org/message-id/20150305211601.GW3291@alvh.no-ip.org
This has actually been suggested many times over the years.

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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jim Nasby 2015-04-13 22:38:25 Re: unlogged tables
Previous Message Jim Nasby 2015-04-13 20:58:43 Re: unlogged tables