Обсуждение: PageIndexTupleDelete

Поиск
Список
Период
Сортировка

PageIndexTupleDelete

От
Simon Riggs
Дата:
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



Re: PageIndexTupleDelete

От
Tom Lane
Дата:
Simon Riggs <simon@2ndQuadrant.com> writes:
> 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.

It used to be called all the time, before some of the more popular
paths got optimized into PageIndexMultiDelete calls.  I'm not
particularly worried about it being broken.  I *am* worried about
the performance hit of using MultiDelete to no purpose.
        regards, tom lane