diff options
| author | Tom Lane | 2016-09-09 23:00:59 +0000 |
|---|---|---|
| committer | Tom Lane | 2016-09-09 23:00:59 +0000 |
| commit | 24992c6db9fd40f342db1f22747ec9e56483796d (patch) | |
| tree | f2cc7c08f7e7363182b059629dab609ac4598f00 /src/backend/access | |
| parent | 1a4be103a523db8d47b464463ba175cc664442b2 (diff) | |
Rewrite PageIndexDeleteNoCompact into a form that only deletes 1 tuple.
The full generality of deleting an arbitrary number of tuples is no longer
needed, so let's save some code and cycles by replacing the original coding
with an implementation based on PageIndexTupleDelete.
We can always get back the old code from git if we need it again for new
callers (though I don't care for its willingness to mess with line pointers
it wasn't told to mess with).
Discussion: <[email protected]>
Diffstat (limited to 'src/backend/access')
| -rw-r--r-- | src/backend/access/brin/brin_pageops.c | 2 | ||||
| -rw-r--r-- | src/backend/access/brin/brin_xlog.c | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/access/brin/brin_pageops.c b/src/backend/access/brin/brin_pageops.c index 24ae38be653..68110090f70 100644 --- a/src/backend/access/brin/brin_pageops.c +++ b/src/backend/access/brin/brin_pageops.c @@ -245,7 +245,7 @@ brin_doupdate(Relation idxrel, BlockNumber pagesPerRange, if (extended) brin_page_init(BufferGetPage(newbuf), BRIN_PAGETYPE_REGULAR); - PageIndexDeleteNoCompact(oldpage, &oldoff, 1); + PageIndexTupleDeleteNoCompact(oldpage, oldoff); newoff = PageAddItem(newpage, (Item) newtup, newsz, InvalidOffsetNumber, false, false); if (newoff == InvalidOffsetNumber) diff --git a/src/backend/access/brin/brin_xlog.c b/src/backend/access/brin/brin_xlog.c index ed147299558..5a6b7288a9c 100644 --- a/src/backend/access/brin/brin_xlog.c +++ b/src/backend/access/brin/brin_xlog.c @@ -148,10 +148,8 @@ brin_xlog_update(XLogReaderState *record) page = (Page) BufferGetPage(buffer); offnum = xlrec->oldOffnum; - if (PageGetMaxOffsetNumber(page) + 1 < offnum) - elog(PANIC, "brin_xlog_update: invalid max offset number"); - PageIndexDeleteNoCompact(page, &offnum, 1); + PageIndexTupleDeleteNoCompact(page, offnum); PageSetLSN(page, lsn); MarkBufferDirty(buffer); |
