From: Tom Lane <tgl@sss.pgh.pa.us>
To: Markus Bertheau <twanger@bluetwanger.de>
Cc: pgsql-performance@postgresql.org
Subject: Re: recovery after long delete
Date: Thu, 14 Apr 2005 12:34:30 -0400
Message-ID: <1505.1113496470@sss.pgh.pa.us> (raw)
In-Reply-To: <1113493643.7249.35.camel@localhost.localdomain>
References: <1113493643.7249.35.camel@localhost.localdomain>
Markus Bertheau <twanger@bluetwanger.de> writes:
> Now if you pull the plug after 2, at startup, pg will go through the
> in-progress txns and mark them as aborted. That's all the recovery in
> this case. All rows are still there. O(1).
Right. (Actually it's O(checkpoint interval), because we have to make
sure that everything we did since the last checkpoint actually got to
disk --- but in principle, there's zero recovery effort.)
> How does oracle do that? Has all this something to do with mvcc? Why
> does it take oracle so long to recover?
Oracle doesn't do MVCC the same way we do. They update rows in place
and put the previous version of a row into an "undo log". If the
transaction aborts, they have to go back through the undo log and put
back the previous version of the row. I'm not real clear on how that
applies to deletions, but I suppose it's the same deal: cost of undoing
a transaction in Oracle is proportional to the number of rows it
changed. There's also the little problem that the space available for
UNDO logs is limited :-(
As against which, they don't have to VACUUM. So it's a tradeoff.
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, twanger@bluetwanger.de
Subject: Re: recovery after long delete
In-Reply-To: <1505.1113496470@sss.pgh.pa.us>
* 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