自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(26)
  • 收藏
  • 关注

原创 dictionary

table 对应 column; index 对应 field     /** Data structure for a column in a table */struct dict_col_struct{/*----------------------*//** The following are copied from dtype_t,so that all bit-

2012-04-21 00:02:52 895

原创 index

/** Data structure for a field in an index */struct dict_field_struct{ dict_col_t* col; /*!< pointer to the table column */ const char* name; /*!< name of the column */ unsigned prefix_len:1

2012-04-21 00:02:38 818

原创 buffer pool

/* IMPLEMENTATION OF THE BUFFER POOL =================================Performance improvement:------------------------Thread scheduling in NT may be so slow that the OS wait mechanism sh

2012-04-21 00:02:22 969

原创 innodb system table

//基本不下面几个系统表table = dict_mem_table_create("SYS_TABLES", DICT_HDR_SPACE, 8, 0); dict_mem_table_add_col(table, heap, "NAME", DATA_BINARY, 0, 0); dict_mem_table_add_col(table, heap, "ID", DATA_BI

2012-04-21 00:01:02 1075

原创 TABLESPACE MEMORY CACHE

/* IMPLEMENTATION OF THE TABLESPACE MEMORY CACHE =============================================The tablespace cache is responsible for providing fast read/write access totablespaces and log

2012-04-21 00:00:54 1071

原创 lock

/* An explicit record lock affects both the record and the gap before it.An implicit x-lock does not affect the gap, it only locks the indexrecord from read or update.If a transaction has modi

2012-04-21 00:00:46 1449

原创 asyn io

/** The asynchronous i/o array slot structure */typedef struct os_aio_slot_struct os_aio_slot_t;/** The asynchronous i/o array slot structure */struct os_aio_slot_struct{ ibool is_read; /*!

2012-04-21 00:00:36 1282

原创 memory pool

/*The main components of the memory consumption are:1. buffer pool,2. parsed and optimized SQL statements,3. data dictionary cache,4. log buffer,5. locks for each transaction,6. hash t

2012-04-20 23:59:56 803

原创 Binary Log

/***************************************************************************** MySQL Binary Log log_event.h This log consists of events. Each event has a fixed-length header, possibly

2012-04-20 23:59:49 1077

原创 Transaction

TransactionId 是一个32位的无符号整数,事务和子事务的id,全是按照一个顺序来的,当这个32位整数用完一圈后,就需要一些特殊的操作/*---------- * Check to see if it's safe to assign another XID. This protects against * catastrophic data loss due to X

2012-04-20 23:59:40 1415

原创 file space

/* SPACE HEADER ============File space header data structure: this data structure is contained in thefirst page of a space. The space for this header is reserved in every extentdescripto

2012-04-20 23:58:25 1138

原创 doublewrite buffer

http://www.mysqlperformanceblog.com/2006/08/04/innodb-double-write/  /** Doublewrite control struct */struct trx_doublewrite_struct{ mutex_t mutex; /*!< mutex protecting the first_free fiel

2012-04-20 23:58:17 1251

原创 rollback segment

/* Transaction rollback segment header *//*-------------------------------------------------------------*/#define TRX_RSEG_MAX_SIZE 0 /* Maximum allowed size for rollback segment in pages */#def

2012-04-20 23:58:07 1837

原创 purge

/** The control structure used in the purge operation */struct trx_purge_struct{ ulint state; /*!< Purge system state */ sess_t* sess; /*!< System session running the purge query */

2012-04-20 23:58:00 902

原创 INFORMATION SCHEMA table cache

这是系统视图的cache,看样子mysql没有用buffer pool,而是专门对系统视图做了一个cache每个表都有自已在内存中的cache, 最大为16M,分配时是按chunk进行的,初始大小是1024个行的大小,按照new = old + old/2这样的速度增加    /** Memory for each table in the intermediate buf

2012-04-20 23:57:50 963

原创 spin lock; rw lock

/*Our mutex implementation works as follows: After that we perform the atomictest-and-set instruction on the memory word. If the test returns zero, weknow we got the lock first. If the test retu

2012-04-20 23:57:18 1209

原创 master thread

mysql 中最重要的 daemon 线程,控制了大部分的后台工作 /** Types of threads existing in the system. */enum srv_thread_type { SRV_COM = 1, /**< threads serving communication and queries */ SRV_CONSOLE, /**< threa

2012-04-20 23:57:02 1158

原创 PHYSICAL RECORD

/* PHYSICAL RECORD (OLD STYLE) ===========================The physical record, which is the data type of all the recordsfound in index pages of the database, has the following format(low

2012-04-20 23:56:45 821

原创 read view

这就是多版本中在事务要读取元组时,进行判断的事务快照,和postgresql中的snapshot一样,就是名不一样,都是把事务启动时,还有运行的事务ID记录在一个列表里面,事务ID在这之间的还需要判断,比这区间小的认为是已提交的,比这区间大的认为是看不到的 /*多版本的限制FACT A: Cursor read view on a secondary index sees only

2012-04-20 23:56:30 1205

原创 log

/* Offsets of a log block header */#define LOG_BLOCK_HDR_NO 0 /* block number which must be > 0 and is allowed to wrap around at 2G; the highest bit is set to 1 if this is the firs

2012-04-20 23:56:17 554

原创 query graph

/* Query graph query thread node: the fields are protected by the kernelmutex with the exceptions named below */struct que_thr_struct{ que_common_t common;  /*!< type: QUE_NODE_THR */ ulint  mag

2012-04-20 23:55:39 1210

原创 Building Indexes Concurrently

/* * We do a concurrent index build by first inserting the catalog entry for the * index via index_create(), marking it not indisready and not indisvalid. * Then we commit our transaction and st

2012-04-20 23:54:48 585

原创 postgresql中增加系统参数

/* * Certain options can only be set at certain times. The rules are * like this: * * INTERNAL options cannot be set by the user at all, but only through * internal processes ("server_versio

2012-04-20 23:54:09 1261

原创 postgresql中的统计信息

pg里面有一个专门的进程 statistics collector 负责对数据库,表,函数的调用次数进行统计,通过socket与执行查询的进程进行通信,当执行语句的进程,在执行一条语句时,会在执行前,把上条语句的统计信息通过socket发送给 statistics collector 进程,这样做是因为上个事务已经 commit 或 rollback 了,统计的是事务已完成的数量。 sta

2012-04-20 23:54:01 3556

原创 postgresql中新增数据类型

在ADT目录下面新增一个文件,主要实现下面四个函数in : 输入函数,把SQL中的输入转化成数据库内部表示out: 输出函数,把数据库内部表示转化成可视的内容send recv 相当于二进制的 in ,out 在 include/catalog/pg_proc.h 中 增加那四个函数在 pg_proc的定义,这个pg_proc.h会生成BKI文件 include/c

2012-04-20 23:53:27 1548 2

原创 mysql的innodb启动过程

fil_init 主要是初始化文件打开指针哈希表,所有打开的文件全记录在 fil_system 之中,构造按名字查找的哈希表 buf_pool_init 内存缓冲池的初始化,对应 buf_pool_ptr 数组之中,还初始化了 adaptive hash index 的内存log_init 初始化log缓冲区,默认大小为 512*16k, 每个log页面大小为 #define OS_FIL

2012-04-20 23:53:02 1676

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除