原创 PHYSICAL RECORD
/* PHYSICAL RECORD (OLD STYLE) =========================== The physical record, which is the data type of all the
原创 rollback segment
/* Transaction rollback segment header */ /*-------------------------------------------------------------*/ #define TRX
原创 doublewrite buffer
http://www.mysqlperformanceblog.com/2006/08/04/innodb-double-write/ /** Doublewrite control struct */ struct trx_do
原创 postgresql中新增數據類型
在ADT目錄下面新增一個文件,主要實現下面四個函數 in : 輸入函數,把SQL中的輸入轉化成數據庫內部表示 out: 輸出函數,把數據庫內部表示轉化成可視的內容 send recv 相當於二進制的 in ,out 在 includ
原创 Transaction
TransactionId 是一個32位的無符號整數,事務和子事務的id,全是按照一個順序來的,當這個32位整數用完一圈後,就需要一些特殊的操作 /*---------- * Check to see if it's safe to
原创 query graph
/* Query graph query thread node: the fields are protected by the kernel mutex with the exceptions named below */struc
原创 Building Indexes Concurrently
/* * We do a concurrent index build by first inserting the catalog entry for the * index via index_create(), marking
原创 INFORMATION SCHEMA table cache
這是系統視圖的cache,看樣子mysql沒有用buffer pool,而是專門對系統視圖做了一個cache 每個表都有自已在內存中的cache, 最大爲16M,分配時是按chunk進行的,初始大小是1024個行的大小,按照new = o
原创 file space
/* SPACE HEADER ============ File space header data structure: this data structure is contained in the first page
原创 log
/* Offsets of a log block header */ #define LOG_BLOCK_HDR_NO 0 /* block number which must be > 0 and is allowed t
原创 spin lock; rw lock
/* Our mutex implementation works as follows: After that we perform the atomic test-and-set instruction on the memory w
原创 btree
/* Latching strategy of the InnoDB B-tree -------------------------------------- A tree latch protects all non-leaf nod
原创 windows和linux下面通用的線程程序
是從mysq裏面抓出來的,只抓了一部分,主要是線程間通信,是用windows模擬linux,方便多線程的開發 #ifndef TP_OS_H #define TP_OS_H #ifdef __cplusplus #define
原创 read view
這就是多版本中在事務要讀取元組時,進行判斷的事務快照,和postgresql中的snapshot一樣,就是名不一樣,都是把事務啓動時,還有運行的事務ID記錄在一個列表裏面,事務ID在這之間的還需要判斷,比這區間小的認爲是已提交的,比這區間
原创 mysql的innodb啓動過程
fil_init 主要是初始化文件打開指針哈希表,所有打開的文件全記錄在 fil_system 之中,構造按名字查找的哈希表 buf_pool_init 內存緩衝池的初始化,對應 buf_pool_ptr 數組之中,還初始化了 adap