pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: sch8el@posteo.de
To: pgsql-general@postgresql.org
Subject: Are all unlogged tables in any case truncated after a server-crash?
Date: Thu, 11 Nov 2021 18:39:49 +0000
Message-ID: <c9f8b3a5-eb45-d3f6-9fd6-2e1d032eea12@posteo.de> (raw)

Hi everyone,

every few weeks I use Postgres ability, to import huge data sets very 
fast by means of "unlogged tables". The bulk load (consisting of plenty 
"copy"- & DML-Stmts) and the spatial index creation afterwards, takes 
about 5 hours on a proper serverĀ  (pg12.7 & PostGIS-Extension). After 
that all unlogged tables remain completely unchanged (no 
DML-/DDL-Statements). Hence all of my huge unlogged, "static" tables get 
never "unclean" and should not be truncated after a server crash.

BTW, if I set all unlogged tables to logged after bulk load, it takes 
additional 1.5 hours, mainly because of re-indexing, I suppose. I assume 
that a restart of the database after a server crash takes another 1.5 
hours (reading from WAL) until the database is up and running.

Therefore I am seeking a strategy, to not tagging those tables as 
"unclean" and not truncating all unlogged tables on server restart.


Cheers and regards.






view thread (7+ messages)  latest in thread

Message-ID: <c9f8b3a5-eb45-d3f6-9fd6-2e1d032eea12@posteo.de>
Permalink:  ../c9f8b3a5-eb45-d3f6-9fd6-2e1d032eea12@posteo.de/
Also on:    postgresql.org/message-id/c9f8b3a5-eb45-d3f6-9fd6-2e1d032eea12@posteo.de

 · 

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: sch8el@posteo.de
  Subject: Re: Are all unlogged tables in any case truncated after a server-crash?
  In-Reply-To: <c9f8b3a5-eb45-d3f6-9fd6-2e1d032eea12@posteo.de>
  References: <c9f8b3a5-eb45-d3f6-9fd6-2e1d032eea12@posteo.de>

* 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