Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WZpCB-0004EL-Mb for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Apr 2014 22:17:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WZpCB-0007bh-2c for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Apr 2014 22:17:43 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WZpC9-0007bS-Um for pgsql-hackers@postgresql.org; Mon, 14 Apr 2014 22:17:42 +0000 Received: from 99-153-64-76.uvs.austtx.sbcglobal.net ([99.153.64.76] helo=noel.decibel.org) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WZpC3-0000zu-Rd for pgsql-hackers@postgresql.org; Mon, 14 Apr 2014 22:17:37 +0000 Received: from decina.local (rrcs-67-79-71-90.sw.biz.rr.com [67.79.71.90]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by noel.decibel.org (Postfix) with ESMTPSA id CA8C26D45D; Mon, 14 Apr 2014 22:17:28 +0000 (UTC) Message-ID: <534C5E6E.1080604@nasby.net> Date: Mon, 14 Apr 2014 17:17:18 -0500 From: Jim Nasby User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Andres Freund , Joe Conway CC: "Hackers (PostgreSQL)" Subject: Re: Excessive WAL generation and related performance issue References: <534C540F.4030905@joeconway.com> <20140414215059.GA4161@awork2.anarazel.de> In-Reply-To: <20140414215059.GA4161@awork2.anarazel.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.5 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 4/14/14, 4:50 PM, Andres Freund wrote: > Hi, > > On 2014-04-14 14:33:03 -0700, Joe Conway wrote: >> checkpoint_segments = 96 >> checkpoint_timeout = 10min > >> I realize there are many things that can be done to improve my >> specific scenario, e.g. drop indexes before loading, change various >> configs, etc. My purpose for this post is to ask if it is really >> expected to get over 20 times as much WAL as heap data? > > I'd bet a large percentage of this will be full page images of the > index. The values you index are essentially distributed over the whole > index, so you'll modifiy the same indx values repeatedly. But often > enough it won't be in the same checkpoint and thus will create full page > images. My thought exactly... ISTM that we should be able to push all the index inserts to the end of the transaction. That should greatly reduce the amount of full page writes. That would also open the door for doing all the index inserts in parallel. -- Jim C. Nasby, Data Architect jim@nasby.net 512.569.9461 (cell) http://jim.nasby.net -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers