pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
To: pgsql-admin@lists.postgresql.org
Subject: Re: PostgreSQL 'Corruption & Fragmentation' detection and resolution/fix
Date: Tue, 12 Jun 2018 18:54:23 +1200
Message-ID: <ff2ac1f6-105f-09e3-09d8-b5c5aeb70f1a@catalyst.net.nz> (raw)
In-Reply-To: <1528783795029-0.post@n3.nabble.com>
References: <1528723690634-0.post@n3.nabble.com>
	<477ADE32-3CCE-4A9A-A286-ADDAB0B4F74B@icloud.com>
	<CACh9nsZ9EmeEZv3u1s+iDQ6stv5+ARi=pWvz0hXaOMW4izFrPQ@mail.gmail.com>
	<A7B2C6A7-22A0-40DC-8C2C-963C8AFDEA87@icloud.com>
	<CACh9nsYgS6-5YO8bp7uex9WUTu2XwFNHGbP=aR5DkQoO4NPwHA@mail.gmail.com>
	<B7E2FA3A-5D81-4EBD-977E-1958520298AE@icloud.com>
	<CACh9nsYOacwJ6D_sVenarjpVNNXgDdhSP-bFpdXVmoms5fkLOw@mail.gmail.com>
	<1528783795029-0.post@n3.nabble.com>

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
>





view thread (19+ messages)  latest in thread

Message-ID: <ff2ac1f6-105f-09e3-09d8-b5c5aeb70f1a@catalyst.net.nz>
Permalink:  ../ff2ac1f6-105f-09e3-09d8-b5c5aeb70f1a@catalyst.net.nz/
Also on:    postgresql.org/message-id/ff2ac1f6-105f-09e3-09d8-b5c5aeb70f1a@catalyst.net.nz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mark.kirkwood@catalyst.net.nz
  Subject: Re: PostgreSQL 'Corruption & Fragmentation' detection and resolution/fix
  In-Reply-To: <ff2ac1f6-105f-09e3-09d8-b5c5aeb70f1a@catalyst.net.nz>
  References: <1528723690634-0.post@n3.nabble.com> <477ADE32-3CCE-4A9A-A286-ADDAB0B4F74B@icloud.com> <CACh9nsZ9EmeEZv3u1s+iDQ6stv5+ARi=pWvz0hXaOMW4izFrPQ@mail.gmail.com> <A7B2C6A7-22A0-40DC-8C2C-963C8AFDEA87@icloud.com> <CACh9nsYgS6-5YO8bp7uex9WUTu2XwFNHGbP=aR5DkQoO4NPwHA@mail.gmail.com> <B7E2FA3A-5D81-4EBD-977E-1958520298AE@icloud.com> <CACh9nsYOacwJ6D_sVenarjpVNNXgDdhSP-bFpdXVmoms5fkLOw@mail.gmail.com> <1528783795029-0.post@n3.nabble.com> <ff2ac1f6-105f-09e3-09d8-b5c5aeb70f1a@catalyst.net.nz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox