pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shawn Michael <smichael@rightnow.com>
To: Nigel J. Andrews <nandrews@investsystems.co.uk>
Cc: pgsql-admin@postgresql.org
Subject: Re: newbie qs; fixing and checking databases
Date: Mon, 21 Oct 2002 13:37:06 -0600
Message-ID: <20021021193706.GA9265@nobody.rightnowtech.com> (raw)
In-Reply-To: <Pine.LNX.4.21.0210160726410.20427-100000@ponder.fairway2k.co.uk>
References: <Pine.LNX.4.21.0210160726410.20427-100000@ponder.fairway2k.co.uk>

On 2002.10.16 00:34 Nigel J. Andrews wrote:
> On Tue, 15 Oct 2002, Tom Lane wrote:
> 
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > Rusty Wright wrote:
> > >> Are there commands provided with postgresql for checking the databases
> > >> and also for repairing them?
> > 
> > > We don't have checks because thing rarely break.
> > 
> > Or at least: there are seldom any programmable-in-advance patterns to
> > our failures.  We prefer to put our efforts into preventing problems
> > rather than cleaning up after 'em...
> 
> Does this question mean that there known, detectable data integrity (not
> referential integrity) problems with MySQL?


With the isam and myisam table formats you are subject to corruption due to sudden crashes of the database.  From my limited understanding of low level database internals, the lack of transactions is the major cause of the need for the tools that Rusty was asking about.  

With PostgreSQL if postmaster cores mid transaction, upon startup because that transaction was not commited, effectively the transaction "never happened"... the corrupt data is just thrown away.  With MySQL it is different,  the transaction will have been half written to disk when the core happened and that row will be corrupt within the database files.  Upon startup of mysqld no rollback is performed and the data remains in a half written state (corrupt).  The tools (isamchk, myisamchk and CHECK TABLE table;) exist to fix the corruption (read: delete the row) in that specific table, at the possible cost of referential integrity.


> 
> Wondering because it seems an odd question to me and it could be a factor in a
> descision, although the number of MySQL installations out there one would have
> to there is no problem or all those web sites surely would be terribly unhappy.
> 


Most people don't notice these problems with MySQL because there are not that many sites out there that are "high volume" enough to have MySQL core in one thread while another is performing a write.  When these cores do happen the startup script for mysql (safe_mysqld) is basically a big while true ; do mysqld ; done loop,  total down time for these people is typically less than a second and only 1 web page gets an error.  Also as part of the startup otions for mysql is/was "auto repair", which I think is effectively some form of "CHECK TABLE table; if corrupt REPAIR TABLE table".

Shawn




view thread (12+ messages)

Message-ID: <20021021193706.GA9265@nobody.rightnowtech.com>
Permalink:  ../20021021193706.GA9265@nobody.rightnowtech.com/
Also on:    postgresql.org/message-id/20021021193706.GA9265@nobody.rightnowtech.com

 · 

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: smichael@rightnow.com, nandrews@investsystems.co.uk
  Subject: Re: newbie qs; fixing and checking databases
  In-Reply-To: <20021021193706.GA9265@nobody.rightnowtech.com>
  References: <Pine.LNX.4.21.0210160726410.20427-100000@ponder.fairway2k.co.uk> <20021021193706.GA9265@nobody.rightnowtech.com>

* 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