Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YnN3K-0006q3-74 for pgsql-performance@arkaria.postgresql.org; Wed, 29 Apr 2015 08:09:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YnN3J-0006o4-H4 for pgsql-performance@arkaria.postgresql.org; Wed, 29 Apr 2015 08:09:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YnN3H-0006lj-RX for pgsql-performance@postgresql.org; Wed, 29 Apr 2015 08:09:03 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1YnN3F-0007ST-5s for pgsql-performance@postgresql.org; Wed, 29 Apr 2015 08:09:02 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id A408F860002; Wed, 29 Apr 2015 10:08:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (p5DDC4C76.dip0.t-ipconnect.de [93.220.76.118]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id EE5F6860001; Wed, 29 Apr 2015 10:08:54 +0200 (CEST) Received: by anarazel.de (Postfix, from userid 1000) id 7416610098D; Wed, 29 Apr 2015 10:08:54 +0200 (CEST) Date: Wed, 29 Apr 2015 10:08:54 +0200 From: Andres Freund To: Jan Gunnar Dyrset Cc: "pgsql-performance@postgresql.org" Subject: Re: PostgreSQL disk fragmentation causes performance problems on Windows Message-ID: <20150429080854.GD14535@awork2.anarazel.de> References: <20150429080639.GC14535@awork2.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150429080639.GC14535@awork2.anarazel.de> X-Pg-Spam-Score: -4.2 (----) 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 2015-04-29 10:06:39 +0200, Andres Freund wrote: > Hi, > > On 2015-04-23 19:47:06 +0000, Jan Gunnar Dyrset wrote: > > I am using PostgreSQL to log data in my application. A number of rows > > are added periodically, but there are no updates or deletes. There are > > several applications that log to different databases. > > > > This causes terrible disk fragmentation which again causes performance > > degradation when retrieving data from the databases. The table files > > are getting more than 50000 fragments over time (max table size about > > 1 GB). > > > > The problem seems to be that PostgreSQL grows the database with only > > the room it need for the new data each time it is added. Because > > several applications are adding data to different databases, the > > additions are never contiguous. > > Which OS and filesystem is this done on? Because many halfway modern > systems, like e.g ext4 and xfs, implement this in the background as > 'delayed allocation'. Oh, it's in the subject. Stupid me, sorry for that. I'd consider testing how much better this behaves under a different operating system, as a shorter term relief. Greetings, Andres Freund -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance