BRIN added a new function, PageIndexDeleteNoCompact(), which is like
PageIndexMultiDelete but does not remove unused line pointers. However,
all the callers pass it just a single offset. So the callers would
really be more interested in efficiently squeezing out a single tuple
from a page, like PageIndexTupleDelete() does, than a bulk operation.
PageIndexDeleteNoCompact() is not optimal for the single item case. Note
that PageIndexMultiDelete() first checks if if the number of removed
items is small (<= 2), and just calls PageIndexTupleDelete in a loop in
that case.
How about replacing PageIndexDeleteNoCompact() with something more like
PageIndexTupleDelete()? It ought to be both faster and simpler.
PS. The comment above PageIndexDeleteNoCompact says that unused items at
the end of the array are removed. But looking at the code, I don't see
it doing that.
- Heikki