Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fSdCa-0007cF-E6 for pgsql-admin@arkaria.postgresql.org; Tue, 12 Jun 2018 06:54:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fSdCW-00013I-6A for pgsql-admin@arkaria.postgresql.org; Tue, 12 Jun 2018 06:54:44 +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.89) (envelope-from ) id 1fSdCV-000130-V0 for pgsql-admin@lists.postgresql.org; Tue, 12 Jun 2018 06:54:43 +0000 Received: from cat-porwal-prod-mail1.catalyst.net.nz ([202.78.240.226]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fSdCO-0002Xy-Fa for pgsql-admin@lists.postgresql.org; Tue, 12 Jun 2018 06:54:41 +0000 Authentication-Results: auth=pass smtp.auth=mark.kirkwood@catalyst.net.nz smtp.mailfrom=mark.kirkwood@catalyst.net.nz Received: from [IPv6:2406:e001:9b9:1:2c9b:1af8:209a:69b] (unknown [IPv6:2406:e001:9b9:1:2c9b:1af8:209a:69b]) (Authenticated sender: mark.kirkwood@catalyst.net.nz) by cat-porwal-prod-mail1.catalyst.net.nz (Postfix) with ESMTPSA id B5CFD8091E for ; Tue, 12 Jun 2018 18:54:24 +1200 (NZST) Subject: Re: PostgreSQL 'Corruption & Fragmentation' detection and resolution/fix To: pgsql-admin@lists.postgresql.org References: <1528723690634-0.post@n3.nabble.com> <477ADE32-3CCE-4A9A-A286-ADDAB0B4F74B@icloud.com> <1528783795029-0.post@n3.nabble.com> From: Mark Kirkwood Message-ID: Date: Tue, 12 Jun 2018 18:54:23 +1200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1528783795029-0.post@n3.nabble.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Re corruption, For heap (i.e table) the standard prescription is just to pg_dump sending output to /dev/null. This will bail if there are any corrupted pages. Also (as probably mentioned elsewhere), enable data checksums at initdb time and the above pg_dump will validate these too. With respect to indexes - the latest versions of the amcheck extension verify these. Re fragmentation, the usual problem with a Postgres db is not really classical 'fragmentation' but data bloat due to insufficient VACUUM. The storage model for Postgres uses 'copy on write' so presents a different problem path from pretty much every other DBMS. Cheers Mark On 12/06/18 18:09, pavan95 wrote: > Hi, > > Can we get any information regarding fragmentation/corruption in the > database level from the system table > > "Information_schema.columns" ? > > Actually my strong belief is other databases like SQL server, Oracle & > Mysql are providing some system views to detect corruption and fragmentation > from the database. So thinking the same with the postgres. > > As I was asked to prepare a script well in advance to predict the > forthcoming disasters > > Regards, > Pavan > > > > -- > Sent from: http://www.postgresql-archive.org/PostgreSQL-admin-f2076596.html >