From: | Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> |
---|---|
To: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org> |
Subject: | BRIN and PageIndexDeleteNoCompact |
Date: | 2014-11-18 15:31:20 |
Message-ID: | 546B6648.3000300@vmware.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Andrew Dunstan | 2014-11-18 15:31:26 | Re: proposal: plpgsql - Assert statement |
Previous Message | Alvaro Herrera | 2014-11-18 14:19:38 | Re: pg_basebackup vs. Windows and tablespaces |