Re: No heap lookups on index - Mailing list pgsql-hackers

From Jim C. Nasby
Subject Re: No heap lookups on index
Date
Msg-id 20060118223703.GV17896@pervasive.com
Whole thread Raw
In response to No heap lookups on index  (David Scott <davids@apptechsys.com>)
Responses Re: No heap lookups on index  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
On Wed, Jan 18, 2006 at 12:14:12PM -0800, David Scott wrote:
>    Do commercial databases implement MVCC in a way that allows an 
> efficient implementation of index lookups that can avoid heap lookups? 

Oracle does, but you pay in other ways. Instead of keeping dead tuples
in the main heap, they shuffle them off to an 'undo log'. This has some
downsides:

Rollbacks take *forever*, though this usually isn't much of an issue
unless you need to abort a really big transaction.

Every update/delete means two seperate writes to disk, one for the base
table and one for the undo log (well, there's also the redo log,
equivalent to our WAL). Though writes to undo can (and presumably are)
grouped together, so they should normally be a lot more efficient than
the updates to the base table unless you're updating data in table
order.

Of course there's downsides to our MVCC as well; the cost of index scans
is just one.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Unique constraints for non-btree indexes
Next
From: "Jim C. Nasby"
Date:
Subject: Re: No heap lookups on index