Skip to content

Commit 8876e37

Browse files
committed
Reduce size of critial section during vacuum full, critical
sections now isn't nested. All user-defined functions now is called outside critsections. Small improvements in WAL protocol. TODO: improve XLOG replay
1 parent 815f584 commit 8876e37

File tree

5 files changed

+403
-246
lines changed

5 files changed

+403
-246
lines changed

src/backend/access/gist/gist.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.134 2006/05/10 23:18:38 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.135 2006/05/17 16:34:59 teodor Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -347,7 +347,7 @@ gistplacetopage(GISTInsertState *state, GISTSTATE *giststate)
347347
* Form index tuples vector to split:
348348
* remove old tuple if t's needed and add new tuples to vector
349349
*/
350-
itvec = gistextractbuffer(state->stack->buffer, &tlen);
350+
itvec = gistextractpage(state->stack->page, &tlen);
351351
if ( !is_leaf ) {
352352
/* on inner page we should remove old tuple */
353353
int pos = state->stack->childoffnum - FirstOffsetNumber;
@@ -501,7 +501,7 @@ gistplacetopage(GISTInsertState *state, GISTSTATE *giststate)
501501
}
502502

503503
rdata = formUpdateRdata(state->r->rd_node, state->stack->buffer,
504-
offs, noffs, false,
504+
offs, noffs,
505505
state->itup, state->ituplen,
506506
&(state->key));
507507

@@ -1157,7 +1157,7 @@ gistnewroot(Relation r, Buffer buffer, IndexTuple *itup, int len, ItemPointer ke
11571157
XLogRecData *rdata;
11581158

11591159
rdata = formUpdateRdata(r->rd_node, buffer,
1160-
NULL, 0, false,
1160+
NULL, 0,
11611161
itup, len, key);
11621162

11631163
recptr = XLogInsert(RM_GIST_ID, XLOG_GIST_NEW_ROOT, rdata);

src/backend/access/gist/gistutil.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/gist/gistutil.c,v 1.11 2006/05/10 09:19:54 teodor Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/gist/gistutil.c,v 1.12 2006/05/17 16:34:59 teodor Exp $
1212
*-------------------------------------------------------------------------
1313
*/
1414
#include "postgres.h"
@@ -112,18 +112,17 @@ gistfitpage(IndexTuple *itvec, int len) {
112112
* Read buffer into itup vector
113113
*/
114114
IndexTuple *
115-
gistextractbuffer(Buffer buffer, int *len /* out */ )
115+
gistextractpage(Page page, int *len /* out */ )
116116
{
117117
OffsetNumber i,
118118
maxoff;
119119
IndexTuple *itvec;
120-
Page p = (Page) BufferGetPage(buffer);
121120

122-
maxoff = PageGetMaxOffsetNumber(p);
121+
maxoff = PageGetMaxOffsetNumber(page);
123122
*len = maxoff;
124123
itvec = palloc(sizeof(IndexTuple) * maxoff);
125124
for (i = FirstOffsetNumber; i <= maxoff; i = OffsetNumberNext(i))
126-
itvec[i - FirstOffsetNumber] = (IndexTuple) PageGetItem(p, PageGetItemId(p, i));
125+
itvec[i - FirstOffsetNumber] = (IndexTuple) PageGetItem(page, PageGetItemId(page, i));
127126

128127
return itvec;
129128
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy