Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aG68p-00021P-Sn for pgsql-performance@arkaria.postgresql.org; Mon, 04 Jan 2016 14:29:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aG68o-0007ES-C1 for pgsql-performance@arkaria.postgresql.org; Mon, 04 Jan 2016 14:29:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aG679-0004Pl-2Z for pgsql-performance@postgresql.org; Mon, 04 Jan 2016 14:28:03 +0000 Received: from smtp-out-no.shaw.ca ([64.59.134.12]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aG674-0007eH-6y for pgsql-performance@postgresql.org; Mon, 04 Jan 2016 14:28:02 +0000 Received: from home.zioup.com ([70.72.160.156]) by shaw.ca with SMTP id G66zalq2ysChYG670aPWpx; Mon, 04 Jan 2016 07:27:55 -0700 X-Authority-Analysis: v=2.1 cv=N9CJbzJB c=1 sm=1 tr=0 a=1AzCEyHvRsrOnBOCSdCQag==:117 a=1AzCEyHvRsrOnBOCSdCQag==:17 a=N8iSzGwtAAAA:8 a=EcwkyOLhAAAA:8 a=IkcTkHD0fZMA:10 a=7aQ_Q-yQQ-AA:10 a=G3bG4QEN4I1YSY20ygYA:9 a=QEXdDO2ut3YA:10 Received: from [192.168.2.100] (epicurus.zioup.net [192.168.2.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by home.zioup.com (Postfix) with ESMTPSA id 84BD4A02A4 for ; Mon, 4 Jan 2016 07:27:52 -0700 (MST) Subject: Re: Proposal for unlogged tables To: pgsql-performance@postgresql.org References: <568A429C.2010507@allaroundtheworld.fr> From: Yves Dorfsman X-Enigmail-Draft-Status: N1110 Message-ID: <568A8168.1070900@zioup.com> Date: Mon, 4 Jan 2016 07:27:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <568A429C.2010507@allaroundtheworld.fr> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfByCUf/CY3omVPKNGheZ0UjE8A8DyDCUkgr9YmxmIZt+4uVWnM3Kxf7xKo4x3YLyOGOeI7NvzKyjdbEybm1ycStLJLlM4RMWtRkbqi8VmEjrh2CTc9Hy 8zQVU0NlueNTccItkLABdoFo+uUtsWsVQwrN27aaEi2FugrWmXBRGK2wYKo2eHHfEVR1UdszrUlWxA== X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org 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 -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance