Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id ACB179FA136 for ; Fri, 9 Feb 2007 19:20:39 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 77151-02 for ; Fri, 9 Feb 2007 19:20:36 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.232]) by postgresql.org (Postfix) with ESMTP id 8C6AB9FA110 for ; Fri, 9 Feb 2007 19:20:36 -0400 (AST) Received: by nz-out-0506.google.com with SMTP id i11so1004025nzh for ; Fri, 09 Feb 2007 15:20:35 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=N7eVgblas6jg7Tly/W8IwuzevwA/iGWtf5NSujazZPBn2ugYBP13GL/b28QgJ50FelZHUf5ciV21G8zrLG6mVufa34Su13tMILFhopD3ZYJ3fUtAvyErEjT05j5hvpWVqqEWNCrlA9q2VHt3MOe70qbCbgmAnXik48VC8+rfzV0= Received: by 10.35.78.9 with SMTP id f9mr26518704pyl.1171063235432; Fri, 09 Feb 2007 15:20:35 -0800 (PST) Received: from ?192.168.0.102? ( [66.168.24.69]) by mx.google.com with ESMTP id 38sm2432454nzf.2007.02.09.15.20.33; Fri, 09 Feb 2007 15:20:34 -0800 (PST) Message-ID: <45CD01BC.7020305@gmail.com> Date: Fri, 09 Feb 2007 17:20:28 -0600 From: Peter Koczan User-Agent: Thunderbird 1.5.0.9 (X11/20070103) MIME-Version: 1.0 To: Michael Monnerie CC: pgsql-admin@postgresql.org Subject: Re: Question on Fragmentations References: <82e1a9bd0702072149q366a4632hb852ffe41fd2c65c@mail.gmail.com> <45CBE593.4020607@gmail.com> <200702092251.21883@zmi.at> In-Reply-To: <200702092251.21883@zmi.at> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/138 X-Sequence-Number: 24603 Michael Monnerie wrote: > On Freitag, 9. Februar 2007 04:08 Peter Koczan wrote: > >> Case in point, I use xfs as the filesystem running under postgres, >> and after a few days the "major" database clusters showed ~90% >> fragmentation on their respective partitions (which is about a 10 to >> 1 ratio of file fragments to files). After running a defragmenter >> > > Does xfs have such stats, and defragmenter included? It could be a good > idea for me to use that, then. Currently I use reiserfs. > > mfg zmi > xfs comes with It does have built-in, xfs-approved utilities for stats and defragmenting built-in. xfs_db gives stats (for fragmentation use xfs_db -c frag -r /dev/XXX). This works even if the filesystem is mounted and active, but I believe that old stats are cached until said filesystem is remounted or until some stat collection process runs. xfs_fsr is the defragmenter (simply use xfs_fsr /dev/XXX). It's safe to run this on an active filesystem/database partition, because it throws away the fragmented data if files are changed. So, for full defragmentation, you'll either want to run it offline, unmounted, or during idle times. Peter