天天看點

mysql源代碼目錄innodb引擎目錄詳解

innobase目錄解讀

  • api:
  • arch:
  • btr:B+樹實作
    File Name   What Name Stands For         Size     Comment Inside File
      ---------   --------------------         ------   -------------------
      btr0btr.c   B-tree / B-tree              82,400   B-tree
      btr0cur.c   B-tree / Cursor             103,233   index tree cursor
      btr0sea.c   B-tree / Search              41,788   index tree adaptive search
      btr0pcur.c  B-tree / persistent cursor   16,720   index tree persistent cursor
               
  • buf:緩沖池的實作,包括LRU算法,FLUSH重新整理算法
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      buf0buf.c   Buffering / Buffering 65,582   The database buffer buf_pool
      buf0flu.c   Buffering / Flush     29,583   ... flush algorithm
      buf0lru.c   / least-recently-used 27,515   ... replacement algorithm
      buf0rea.c   Buffering / read      21,504   ... read
               
  • clone:
  • data:這是影響行的次要實用程式例程的集合。
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      data0data.c Data / Data           15,344   SQL data field and tuple
      data0type.c Data / Type            7,417   Data types
               
  • dict:InnoDB存儲引擎中記憶體數字字典的實作。
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      dict0dict.c Dictionary / Dictionary 114,263 Data dictionary system
      dict0boot.c Dictionary / boot     11,704   ... booting
      dict0crea.c Dictionary / Create   37,278   ... creation
      dict0load.c Dictionary / load     34,049   ... load to memory cache
      dict0mem.c  Dictionary / memory    7,470   ... memory object creation
               
  • eval:評估步驟是解釋SQL語句過程的後期部分—在\ pars(PARSING)期間已經進行了解析。
    File Name   What Name Stands For  Size    Comment Inside File
      ---------   --------------------  ------  -------------------
      eval0eval.c Evaluating/Evaluating 17,061  SQL evaluator
      eval0proc.c Evaluating/Procedures  5,001  Executes SQL procedures
               
  • fil:Innodb存儲引擎中檔案資料結構以及對檔案的一些操作。
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      fil0fil.c   File / File          118,312   The low-level file system
               
  • fsp:可以了解為file space,即對InnoDB存儲引擎實體檔案的管理,如頁,區,段等。
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      fsp0fsp.c   File Space Management 110,495  File space management
               
  • fts:
  • fut:通用的實用檔案程式
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      fut0fut.c   File Utility / Utility   293   File-based utilities
      fut0lst.c   File Utility / List   14,176   File-based list utilities
               
  • gis:
  • ha:雜湊演算法的實作。
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      ha0ha.c     Hashing / Hashing      8,145   Hash table with external chains
      hash0hash.c Hashing / Hashing      3,283   Simple hash table utility
               
  • handler:繼承于mysql的handler,插件式存儲引擎的實作。
  • ibuf:插入緩存的實作。
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      ibuf0ibuf.c Insert Buffer /       91,397   Insert buffer
               
  • include:innodb将頭檔案(.h,.ic)檔案都統一放在這個檔案夾下。
  • lob:
  • lock:Innodb存儲引擎鎖的實作。
    File Name   What Name Stands For  Size    Comment Inside File
      ---------   --------------------  ------  -------------------
      lock0lock.c Lock / Lock           139,207 The transaction lock system
               
  • log:日志緩沖和重組日志檔案的實作。
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      log0log.c   Logging / Logging     86,043   Database log
      log0recv.c  Logging / Recovery    91,352   Recovery
               
  • mach:機器格式
    File Name   What Name Stands For  Size    Comment Inside File
      ---------   --------------------  ------  -------------------
      mach0data.c Machine/Data           2,335  Utilities for converting
               
  • mem:輔助緩存池的實作,用來申請一些資料結構的記憶體。
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      mem0mem.c   Memory / Memory       10,310   The memory management
      mem0dbg.c   Memory / Debug        22,054   ... the debug code
      mem0pool.c  Memory / Pool         16,511   ... the lowest level
               
  • mtr:事務的底層實作
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      mtr0mtr.c   Mini-transaction /    12,620   Mini-transaction buffer
      mtr0log.c   Mini-transaction / Log 8,090   ... log routines
               
  • os:封裝一些對于作業系統的操作
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      os0file.c   OS / File            104,081   To i/o primitives
      os0thread.c OS / Thread            7,754   To thread control primitives
      os0proc.c   OS / Process          16,919   To process control primitives
      os0sync.c   OS / Synchronization  14,256   To synchronization primitives
               
  • page:頁的實作
    File Name   What Name Stands For  Size    Comment Inside File
      ---------   --------------------  ------  -------------------
      page0page.c Page / Page           51,731  Index page routines
      page0cur.c  Page / Cursor         38,127  The page cursor
               
  • pars:工作是輸入一個包含SQL語句的字元串并輸出一個記憶體中的分析樹。 EVALUATING(子目錄\ eval)程式将使用該樹。
    File Name   What Name Stands For Size    Comment Inside File
      ---------   -------------------- ------  -------------------
      pars0pars.c Parsing/Parsing      45,376  SQL parser
      pars0grm.c  Parsing/Grammar      62,685  A Bison parser
      pars0opt.c  Parsing/Optimizer    31,268  Simple SQL Optimizer
      pars0sym.c  Parsing/Symbol Table  5,239  SQL parser symbol table
      lexyy.c     Parsing/Lexer        62,071  Lexical scanner
               
  • que:程式que0que.c表面上是關于包含送出/復原語句的存儲過程的執行。
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      que0que.c   Query Graph / Query   30,774   Query graph
               
  • read:read0read.c程式使用\ trx程式組中的某些功能打開查詢結果的“讀取視圖”。
    File Name   What Name Stands For Size    Comment Inside File
      ---------   -------------------- ------  -------------------
      read0read.c Read / Read           9,935  Cursor read
               
  • rem:記錄管理器,有時,您會問,圍繞頁面行中資料的所有那些位是什麼,這就是您找到答案的地方。
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      rem0rec.c   Record Manager        38,573   Record Manager
      rem0cmp.c   Record Manager /      26,617   Comparison services for records
                  Comparison
               
  • row:對于各種類型行資料的操作。
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      row0row.c   Row / Row             18,375   General row routines
      row0uins.c  Row / Undo Insert      6,799   Fresh insert undo
      row0umod.c  Row / Undo Modify     19,712   Undo modify of a row
      row0undo.c  Row / Undo            10,512   Row undo
      row0vers.c  Row / Version         14,385   Row versions
      row0mysql.c Row / MySQL          112,462   Interface [to MySQL]
      row0ins.c   Row / Insert          42,829   Insert into a table
      row0sel.c   Row / Select         111,719   Select
      row0upd.c   Row / Update          51,824   Update of a row
      row0purge.c Row / Purge           15,609   Purge obsolete records
               
  • srv:對于InnoDB存儲引擎參數的涉及
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      srv0srv.c   Server / Server       75,633   Server main program
      srv0que.c   Server / Query         2,463   Server query execution
      srv0start.c Server / Start        50,154   Starts the server
               
  • sync:InnoDB存儲引擎互斥量(Mutex)的實作
    File Name   What Name Stands For Size    Comment Inside File
      ---------   -------------------- ------  -------------------
      sync0sync.c Synchronization /    37,940  Mutex, the basic sync primitive
      sync0arr.c  ... / array          26,455  Wait array used in primitives
      sync0rw.c   ... / read-write     22,846  read-write lock for thread sync
               
  • trx:事務的實作
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      trx0trx.c   Transaction /         50,480   The transaction
      trx0purge.c Transaction / Purge   29,133   ... Purge old versions
      trx0rec.c   Transaction / Record  37,346   ... Undo log record
      trx0roll.c  / Rollback            31,448   ... Rollback
      trx0sys.c   Transaction / System  27,018   ... System
      trx0rseg.c  / Rollback segment     6,445   ... Rollback segment
      trx0undo.c  Transaction / Undo    51,519   ... Undo log
               
  • usr:一個使用者可以有多個會話(該會話是連接配接和斷開連接配接之間發生的所有事情)。
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      usr0sess.c  User / Session         1,740   Sessions
               
  • ut:工具類
    File Name   What Name Stands For  Size     Comment Inside File
      ---------   --------------------  ------   -------------------
      ut0ut.c     Utilities / Utilities  9,728   Various utilities
      ut0byte.c   Utilities / Debug        793   Byte utilities
      ut0rnd.c    Utilities / Random     1,474   Random numbers and hashing
      ut0mem.c    Utilities / Memory    10,358   Memory primitives
      ut0dbg.c    Utilities / Debug      2,579   Debug utilities