6.1.3 位数类型 ................................................................................................................ 46
6.2 日期和时间类型 ............................................................................................................... 47
6.3 字符串类型 ...................................................................................................................... 48
6.3.1 基本的字符串类型 ................................................................................................ 48
6.3.2 ENUM 类型 ........................................................................................................... 51
6.3.3 SET 类型 ................................................................................................................ 52
6.4 选择合适的数据类型 ...................................................................................................... 54
6.5 基本运算符 ...................................................................................................................... 55
7.MySQL 常用函数 ....................................................................................................................... 56
7.1 数值函数 .......................................................................................................................... 56
7.2 时间和日期函数 .............................................................................................................. 58
7.3 字符串函数 ...................................................................................................................... 66
7.4 其他常用函数 .................................................................................................................. 70
8.MySQL 开发 ............................................................................................................................... 73
8.1 存储过程 .......................................................................................................................... 73
8.2 MySQL 事件调度器(Event Scheduler) ............................................................................ 77
8.3 SQL Mode 及相关问题 .................................................................................................... 81
9.索引的使用和优化 ...................................................................................................................... 83
9.1 Mysql 索引概述 ............................................................................................................... 83
9.2 索引的使用 ...................................................................................................................... 85
9.3 SQL 优化 .......................................................................................................................... 86
9.4 MySQL Explain 详解 ...................................................................................................... 92
10.优化 MySQL Server ................................................................................................................ 100
10.1 MySQL Sserver 参数调优 ............................................................................................ 100
10.2 应用优化 ...................................................................................................................... 103
10.3 I/O 问题 ........................................................................................................................ 105
10.4 其他优化 ...................................................................................................................... 106
11.表类型(存储引擎) .............................................................................................................. 108
11.1 InnoDB 存储引擎 ......................................................................................................... 109
11.1.1 InnoDB 概述 ...................................................................................................... 109
11.1.2 InnoDB 的配置 .................................................................................................. 110
11.1.3 InnoDB 表空间 .................................................................................................. 111
11.1.4 InnoDB 优化 ...................................................................................................... 114
11.1.5 InnoDB 监视器(InnoDB Monitor) ............................................................... 127
11.1.6 InnoDB 和 MySQL 复制 ................................................................................... 128
11.1.7 MySQL Optimize Table ..................................................................................... 128
................................................................................................................. 129
12.1 MyISAM 表锁 .............................................................................................................. 131
12.2 InnoDB 锁问题 ............................................................................................................. 137
12.2.1 背景知识 ........................................................................................................... 137
12.2.2 InnoDB 的行锁模式及加锁方法 ...................................................................... 140
12.2.3 InnoDB 行锁实现方式 ...................................................................................... 143
12.2.4 间隙锁(Next-Key 锁) .................................................................................. 148
12.3 事务控制 ...................................................................................................................... 162