Update hypopg_index.cpp

This commit is contained in:
bjyb 2023-09-17 23:00:02 +08:00
parent 95d9400d77
commit 705c19c73d
1 changed files with 19 additions and 1 deletions

View File

@ -127,6 +127,12 @@ void InitHypopg()
}
isExplain = false;
}
/*
SQLAllocConnect() allocates a connection handle and associated resources within the
environment that is identified by the input environment handle. Call SQLGetInfo() with
fInfoType set to SQL_ACTIVE_CONNECTIONS to query the number of connections that
can be allocated at any one time. SQLAllocEnv() must be called before calling this function.*/
/*
Set_hypopg_prehook function:
@ -185,7 +191,18 @@ static Oid hypo_getNewOid(Oid relid)
/* Open the relation on which we want a new OID */
relation = heap_open(relid, AccessShareLock);
/*In PostgreSQL, AccessShareLock is a lock type used to
control concurrent access to database objects. It is a read
lock that allows multiple transactions to read from the same
object at the same time, but it prevents concurrent transactions
from acquiring conflicting locks, such as write locks or exclusive locks.
When a transaction obtains AccessShareLock on an object, other
transactions can also obtain AccessShareLock on the same object.
This means that multiple transactions can read objects at the same
time without interfering with each other.*/
reltablespace = relation->rd_rel->reltablespace;
relpersistence = relation->rd_rel->relpersistence;
@ -300,6 +317,7 @@ List *get_table_indexes(Oid oid)
heap_close(rel, NoLock);
return indexes;
}
/*Read-only here will not cause deadlock, so use NoLock lock.*/
/* Return the names of all the columns involved in the index. */