自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 对电脑作如下设置

【桌面】→ 【右键】→ 【属性】→ 【外观】→ 【高级】→ 项目选择【窗口】→ 【颜色1(L)】→ 【选择(其它)】将色调改为:85。饱和度:123。亮度:205→添加到自定义颜色→在自定义颜色选定→确定

2012-03-13 10:59:02 557

原创 使用vs2019编译postgresql 12

1.按照PG的帮助下载需要的包,有一些不下到了,如xml的,但编译能通过,也许是12优化编译了,没存在的包能跳过了,具体原因再找2. git clone,速度慢的话,去网上找找,改hosts后,下载速度飞快。3.修改postgresql\src\tools\msvc\VSObjectFactory.pm中的DetermineVisualStudioVersion函数,直接返回retu...

2020-02-06 17:05:04 1486 1

原创 性能监控

vmstat 1 -SmSwap       si: Amount of memory swapped in from disk (/s).       so: Amount of memory swapped to disk (/s).CPU       These are percentages of total CPU time.       us: Time spent running n...

2018-03-13 19:56:26 487

原创 BenckMarkSQL5.0 绘图

yum install texinfo-texyum install libjpeg-turbo下载新版本的zlib http://www.zlib.net/./configure --prefix=/home/aaa/zlib1.2.6makemake installvi /etc/ld.so.conf.d/zlib.conf加入如下内容后保存退出/home/aaa/zlib1.2.6/li...

2018-03-13 14:11:18 326

原创 perf无函数堆栈

https://perf.wiki.kernel.org/index.php/Main_Page

2017-06-12 16:33:03 1507

原创 gperftools-2.5.93

gperftools 使用

2017-06-06 16:48:04 629

原创 使用oprofile-1.1.0

oprofile-1.1.0

2017-06-05 16:37:02 1367

原创 postgresql9.6中的 Row Security Policies

1.。中文VS2008下面编译pg9.6修改VSObjectFactory.pm 中的 DetermineVisualStudioVersion 直接 return '9.00';

2016-11-16 17:42:56 931

转载 mysql内核分析的网址

https://blogs.oracle.com/mysqlinnodb/

2014-09-24 17:19:41 643

原创 HandlerSocket

HandlerSocket是mysql的一个插件,主要是越过parser,optimizer这一层,直接对数据库进行key/value的存储,对于大内存的数据库,能极大的提高性能. 通过阅读代码,发现它主要用到了mysql的下面的结构体struct tablevec_entry { TABLE *table; size_t refcount; bool modifie

2012-05-10 16:09:28 1189

原创 replication

这是pg的主从备份,就是有一个主机把修改发给一个或多个副机,pg主从机之间是通过log来实现的,而不是采用简单的SQL,主机是sender,从机是receiver,就是进程,有多少个receiver,主机就有多少个进程,默认是异步的,就是主机不停的从硬盘上log中读取,之后发给副机,副机把收到的log应用到数据库中,主机中正在执行的事务是与发送没关系的,目前还没有实现从内存的log buf

2012-05-02 23:41:38 1212

原创 postgresql 中的 large object

//主要有下面两个系统表,pg_largeobject_metadata主要记录权限的,有用的只有pg_largeobjectCATALOG(pg_largeobject_metadata,2995){ Oid lomowner; /* OID of the largeobject owner */#ifdef CATALOG_VARLEN /* variab

2012-05-02 23:41:08 2591

原创 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 880

原创 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 806

原创 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 955

原创 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 1055

原创 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 1056

原创 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 1435

原创 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 1270

原创 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 791

原创 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 1055

原创 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 1389

原创 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 1121

原创 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 1242

原创 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 1804

原创 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 890

原创 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 952

原创 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 1190

原创 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 1142

原创 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 802

原创 read view

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

2012-04-20 23:56:30 1190

原创 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 544

原创 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 1190

原创 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 575

原创 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 1236

原创 postgresql中的统计信息

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

2012-04-20 23:54:01 3529

原创 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 1497 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 1669

原创 btree

/*Latching strategy of the InnoDB B-tree--------------------------------------A tree latch protects all non-leaf nodes of the tree. Each node of a treealso has a latch of its own.A B-tree

2012-03-09 13:44:41 642

原创 windows和linux下面通用的线程程序

是从mysq里面抓好出来的,只抓了一部分,主要是线程间通信,是用windows模拟linux,方便多线程的开发

2011-04-29 17:23:00 1479

空空如也

空空如也

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

TA关注的人

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