PageIndexTupleDelete

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: PageIndexTupleDelete
Date: 2009-12-06 10:08:23
Message-ID: 1260094103.13774.44266.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Just noticed that PageIndexTupleDelete does not check that

pd_special != MAXALIGN(pd_special)

whereas PageIndexMultiDelete() does this. Both routines state that
"paranoia seems justified", so this omission looks like an error.

Looking a little deeper at this...

We only call PageIndexTupleDelete() in cases where
PageIndexMultiDelete() has only a single element. We also call it
directly (in btree case) when recovering page splits and when updating
parent pages as part of page removal.

Having a special function that exists only for use in rare occasions
seems like a great recipe for sporadic corruption, if we are taking the
"paranoia seems justified" approach.

I would be inclined to dispose of PageIndexTupleDelete altogether. We
may yet be able to optimise PageIndexMultiDelete for low values of
nitems, if that is important.

--
Simon Riggs www.2ndQuadrant.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kurt Harriman 2009-12-06 10:21:42 Re: Patch: Remove gcc dependency in definition of inline functions
Previous Message Simon Riggs 2009-12-06 07:59:52 Re: Hot standby, misc issues