Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aG8i0-0001BE-MM for pgsql-performance@arkaria.postgresql.org; Mon, 04 Jan 2016 17:14:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aG8hz-0001fz-KK for pgsql-performance@arkaria.postgresql.org; Mon, 04 Jan 2016 17:14:15 +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 1aG8gL-0008Ez-Rr for pgsql-performance@postgresql.org; Mon, 04 Jan 2016 17:12:33 +0000 Received: from 16.mo4.mail-out.ovh.net ([188.165.55.104]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aG8gI-0002pZ-S9 for pgsql-performance@postgresql.org; Mon, 04 Jan 2016 17:12:33 +0000 Received: from mail623.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo4.mail-out.ovh.net (Postfix) with SMTP id DA542102C0D9 for ; Mon, 4 Jan 2016 18:12:24 +0100 (CET) Received: from localhost (HELO queueout) (127.0.0.1) by localhost with SMTP; 4 Jan 2016 19:12:24 +0200 Received: from unknown (HELO ?192.168.1.253?) (mark@allaroundtheworld.fr@88.246.62.12) by ns0.ovh.net with SMTP; 4 Jan 2016 19:12:23 +0200 Subject: Re: Proposal for unlogged tables To: Andres Freund References: <568A429C.2010507@allaroundtheworld.fr> <568A8168.1070900@zioup.com> <568A83F0.7050904@allaroundtheworld.fr> <20160104161234.GE28025@awork2.anarazel.de> Cc: pgsql-performance@postgresql.org From: Mark Zealey Message-ID: <568AA7F6.5050107@allaroundtheworld.fr> Date: Mon, 4 Jan 2016 19:12:22 +0200 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: <20160104161234.GE28025@awork2.anarazel.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Ovh-Tracer-Id: 12103142523921906737 X-Ovh-Remote: 88.246.62.12 () X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekiedrieejucetufdoteggodftvfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekiedrieejgdelkecutefuodetggdotffvucfrrhhofhhilhgvmecuqfggjfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm 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 04/01/16 18:12, Andres Freund wrote: > Pages containing data of unlogged tables aren't ever flushed to disk > unless > a) a shutdown checkpoint is performed > b) a buffer containing data from an unlogged table is used for something > else > c) the database being copied is the the source of a CREATE DATABASE .. TEMPLATE > > Hence, if there's an unclean shutdown, there's absolutely no guarantee > about the on-disk state of unlogged tables. Even if they haven't been > modified in ages - there could have been many many dirty pages in shared > buffers when crashing. > > > Always flushing dirty pages of unlogged tables at checkpoint would > greatly increase the overhead for memory resident, write heavy workloads > that use unlogged tables. If there was a command to flush a specific unlogged table to disk it would work around all these issues no? Perhaps if you marked the table as read only at the same time it would flush it to disk and ensure no more data could be written to it eg (ALTER TABLE ... SET READ ONLY on an unlogged table would flush + not truncate after crash). In our case this would be great as we want to use these as permanent tables for speed; but after an initial data dump we don't change the data again so we could just do this at the end of the import process. Mark -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance