Re: Proposal for unlogged tables

From: Yves Dorfsman <yves(at)zioup(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Proposal for unlogged tables
Date: 2016-01-04 14:27:52
Message-ID: 568A8168.1070900@zioup.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 2016-01-04 02:59, Mark Zealey wrote:
> shutdown all unlogged tables will be truncated. Obviously with 9.5 we can now
> alter tables to be logged/unlogged after insert but this will still write all
> the inserts into the WAL.

I haven't tried, but won't converting an unlogged table into a logged table
write all the inserts at once instead of once per insert?

Or are you wanting to do more bulk insert into that table later?

> I can understand the requirement to truncate tables
> with active IO at the point of unclean shutdown where you may get corrupted
> data; but I'm interested to find out how easy it would be to not perform the
> truncate for historical unlogged tables.

Are you trying to avoid running a CHECKPOINT? Are you afraid the activity on
the other tables will create too much I/O?

> If the last data modification
> statement was run more than eg 30 seconds or 1 minute before an unclean
> shutdown (or the data was otherwise flushed to disk and there was no IO since
> then) can we not assume that the data is not corrupted and hence not truncate
> the unlogged tables?

I have to admit that I have been surprised by this, it feels like unlogged
tables are never written properly unless you do an explicit CHECKSUM.

--
http://yves.zioup.com
gpg: 4096R/32B0F416

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mark Zealey 2016-01-04 14:38:40 Re: Proposal for unlogged tables
Previous Message Anton Melser 2016-01-04 13:30:30 Re: Plan differences