Re: An idle thought

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: An idle thought
Date: 2010-03-18 15:31:55
Message-ID: 87mxy5wsr8.fsf@ca.afilias.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

simon(at)2ndQuadrant(dot)com (Simon Riggs) writes:
> On Tue, 2010-03-16 at 15:29 +0000, Greg Stark wrote:
>
>> big batch delete
>
> Is one of the reasons for partitioning, allowing the use of truncate.

Sure, but it would be even nicer if DELETE could be thus made cheaper
without needing to interfere with the schema.

The concurrency issue might be resolved (*might!*) by the following
complication...

- A delete request is looking at a page, and concludes, "oh, all the
tuples here are now marked dead!".

- It flags the page as *possibly* dead. Almost what Greg suggests for
the visibility map, but this is just marking it as "proposed dead."

- It throws the page number, along with xid, into a side map.

When something wants to do something with the page (e.g. - vacuum), it
sees that it's "possibly dead," and looks at the "side map" for the list
of xids that wanted to mark the page dead.

for each xid:
if xid is still active
do nothing with it
else
remove xid entry from the map

if all xids were failed
remove flag from page
if any xid committed
empty the page; the tuples are all dead

I'm less confident about that last "clause" - I *think* that if *any*
page-clearing XID is found, that means the page is well and truly clear,
doesn't it?

The extra "map" mayn't be a nice thing.

It's food for thought, anyways.
--
let name="cbbrowne" and tld="linuxfinances.info" in String.concat "@" [name;tld];;
The real problem with the the year 2000 is that there are too many
zero bits and that adversely affects the global bit density.
-- Boyd Roberts <boyd(at)france3(dot)fr>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2010-03-18 15:48:57 Re: ALTER ROLE/DATABASE RESET ALL versus security
Previous Message Pavel Stehule 2010-03-18 15:15:04 Re: WIP: shared ispell dictionary