In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This section introduces the implementation logic of PostgreSQL for judging tuple visibility, focusing on the processing of the HeapTupleSatisfiesMVCC function.
I. data structure
Macro definition
/ / transaction ID, unsigned 32-bit integer typedef uint32 TransactionId;/*-* Special transaction ID values * transaction reserved by the system ID * * BootstrapTransactionId is the XID for "bootstrap" operations, and * FrozenTransactionId is used for very old tuples. Both should * always be considered valid. * * FirstNormalTransactionId is the first "normal" transaction id. * Note: if you need to change it, you must change pg_class.h as well. *-* / # define InvalidTransactionId ((TransactionId) 0) # define BootstrapTransactionId ((TransactionId) 1) # define FrozenTransactionId ((TransactionId) 2) # define FirstNormalTransactionId ((TransactionId) 3) # define MaxTransactionId ((TransactionId) 0xFFFFFFFF) / *-* transaction ID manipulation macros *- -* / # define TransactionIdIsValid (xid) ((xid)! = InvalidTransactionId) # define TransactionIdIsNormal (xid) ((xid) > = FirstNormalTransactionId) # define TransactionIdEquals (id1 Id2) ((id1) = = (id2) # define TransactionIdStore (xid, dest) (* (dest) = (xid)) # define StoreInvalidTransactionId (dest) (* (dest) = InvalidTransactionId) / * advance a transaction ID variable, handling wraparound correctly * / # define TransactionIdAdvance (dest)\ do {\ (dest) + + \ if ((dest))
< FirstNormalTransactionId) \ (dest) = FirstNormalTransactionId; \ } while(0)/* back up a transaction ID variable, handling wraparound correctly */#define TransactionIdRetreat(dest) \ do { \ (dest)--; \ } while ((dest) < FirstNormalTransactionId)/* compare two XIDs already known to be normal; this is a macro for speed *///比较两个已知是常规事务的XIDs;宏定义是为了性能考虑.#define NormalTransactionIdPrecedes(id1, id2) \ (AssertMacro(TransactionIdIsNormal(id1) && TransactionIdIsNormal(id2)), \ (int32) ((id1) - (id2)) < 0)/* compare two XIDs already known to be normal; this is a macro for speed */#define NormalTransactionIdFollows(id1, id2) \ (AssertMacro(TransactionIdIsNormal(id1) && TransactionIdIsNormal(id2)), \ (int32) ((id1) - (id2)) >Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.