diff options
author | Vadim B. Mikheev <vadim4o@yahoo.com> | 1998-12-15 12:47:01 +0000 |
---|---|---|
committer | Vadim B. Mikheev <vadim4o@yahoo.com> | 1998-12-15 12:47:01 +0000 |
commit | 3f7fbf85dc5b42dfd33c803efe6c90533773576a (patch) | |
tree | df8f84075ae7a27fa6b7ec0d063a03898e0b1bbb /src/backend/access/gist/gist.c | |
parent | c5a27161a188b235ce3c0afb1b12e8942ac8e963 (diff) | |
download | postgresql-3f7fbf85dc5b42dfd33c803efe6c90533773576a.tar.gz |
Initial MVCC code.
New code for locking buffer' context.
Diffstat (limited to 'src/backend/access/gist/gist.c')
-rw-r--r-- | src/backend/access/gist/gist.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index a761784204..ce9ef24c88 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -104,8 +104,7 @@ gistbuild(Relation heap, Buffer buffer = InvalidBuffer; bool *compvec; - /* GiSTs only know how to do stupid locking now */ - RelationSetLockForWrite(index); + /* no locking is needed */ setheapoverride(true); /* so we can see the new pg_index tuple */ initGISTstate(&giststate, index); @@ -269,7 +268,6 @@ gistbuild(Relation heap, /* okay, all heap tuples are indexed */ heap_endscan(scan); - RelationUnsetLockForWrite(index); if (pred != NULL || oldPred != NULL) { @@ -343,7 +341,12 @@ gistinsert(Relation r, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation itup = index_formtuple(RelationGetDescr(r), datum, nulls); itup->t_tid = *ht_ctid; + /* + * Notes in ExecUtils:ExecOpenIndices() + * RelationSetLockForWrite(r); + */ + res = gistdoinsert(r, itup, &giststate); for (i = 0; i < r->rd_att->natts; i++) if (compvec[i] == TRUE) @@ -351,7 +354,6 @@ gistinsert(Relation r, Datum *datum, char *nulls, ItemPointer ht_ctid, Relation pfree(itup); pfree(compvec); - /* XXX two-phase locking -- don't unlock the relation until EOT */ return res; } @@ -1103,8 +1105,12 @@ gistdelete(Relation r, ItemPointer tid) Buffer buf; Page page; - /* must write-lock on delete */ + /* + * Notes in ExecUtils:ExecOpenIndices() + * Also note that only vacuum deletes index tuples now... + * RelationSetLockForWrite(r); + */ blkno = ItemPointerGetBlockNumber(tid); offnum = ItemPointerGetOffsetNumber(tid); @@ -1120,7 +1126,6 @@ gistdelete(Relation r, ItemPointer tid) WriteBuffer(buf); - /* XXX -- two-phase locking, don't release the write lock */ } void |