Navigation Menu

Skip to content

Commit

Permalink
Support HOT update on PostgreSQL 9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 30, 2015
1 parent f4e2154 commit 10ea55c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pgroonga.c
Expand Up @@ -916,14 +916,20 @@ PGrnIsAliveCtid(Relation table, ItemPointer ctid)
ItemPointerData realCtid;
bool allDead;
bool found;
bool isAlive;
bool isAlive = false;

buffer = ReadBuffer(table, ItemPointerGetBlockNumber(ctid));
snapshot = RegisterSnapshot(GetLatestSnapshot());
realCtid = *ctid;
found = heap_hot_search_buffer(&realCtid, table, buffer, snapshot, &tuple,
&allDead, true);
isAlive = (found && CtidToUInt64(&(tuple.t_self)) == CtidToUInt64(ctid));
if (found) {
uint64 tupleID;

tupleID = CtidToUInt64(&(tuple.t_self));
isAlive = (tupleID == CtidToUInt64(ctid) ||
tupleID == CtidToUInt64(&realCtid));
}
UnregisterSnapshot(snapshot);
ReleaseBuffer(buffer);

Expand Down

0 comments on commit 10ea55c

Please sign in to comment.