BRIN and PageIndexDeleteNoCompact - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject BRIN and PageIndexDeleteNoCompact
Date
Msg-id 546B6648.3000300@vmware.com
Whole thread Raw
Responses Re: BRIN and PageIndexDeleteNoCompact  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: proposal: plpgsql - Assert statement
Next
From: David Fetter
Date:
Subject: Re: double counting of lines in psql