Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlEzM-0006Pj-Ny for pgsql-general@arkaria.postgresql.org; Thu, 11 Nov 2021 18:39:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mlEzL-0004m8-Nm for pgsql-general@arkaria.postgresql.org; Thu, 11 Nov 2021 18:39:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlEzL-0004ly-8a for pgsql-general@lists.postgresql.org; Thu, 11 Nov 2021 18:39:55 +0000 Received: from mout02.posteo.de ([185.67.36.66]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlEzI-0004UY-Q7 for pgsql-general@postgresql.org; Thu, 11 Nov 2021 18:39:54 +0000 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 4AA01240101 for ; Thu, 11 Nov 2021 19:39:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1636655991; bh=WU+SPKqwntAeEUZnNXY/7vGBGPouOyFu9+ehEnFvGkc=; h=Date:To:From:Subject:From; b=DPiBV0IowbEEQaqBYY/n6N7u4Wr481jew3jmZqr1JCGd5a2C7BSlwiNAuhb9M/Jds GYbomFcg6YxqQ3OBxxeb/p7fH/xYXhepqdPFTBbp+V9OU0drgOBhmQVTtO+7ujx3oB w0e4TWItz2vEAJg7U/Gu3fCm327twrcELAWAbNWBNp+1lwZbRIydasWYNblwu/vMJq lzG+Yo8WOi0vPfB+QqdDNvjbmimKIH57gpna3ByF2bsm3/Vuip/OhopUro7X+WtgpT TIOPOc4fIVk6y7qk4ACoqffT4YuJ02V4J83ugdrp4j/VWEe2vxEkT697stU58mjlVh M7UBl5IaqpsMg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Hqr9f0yS5z6tnY for ; Thu, 11 Nov 2021 19:39:50 +0100 (CET) Message-ID: Date: Thu, 11 Nov 2021 18:39:49 +0000 MIME-Version: 1.0 Content-Language: de-DE To: pgsql-general@postgresql.org From: sch8el@posteo.de Subject: Are all unlogged tables in any case truncated after a server-crash? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.