2018-02-20 10:40:05 +08:00
<!-- GFM - TOC -->
2018-02-22 14:47:54 +08:00
* [<EFBFBD> 洢<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#<23> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> )
2018-02-20 10:40:05 +08:00
* [1. InnoDB ](#1-innodb )
* [2. MyISAM ](#2-myisam )
2018-02-22 14:47:54 +08:00
* [3. InnoDB <20> <> MyISAM <20> ı Ƚ<C4B1> ](#3-innodb-<2D> <> -myisam-<2D> ı Ƚ<C4B1> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [1. <20> <> <EFBFBD> <EFBFBD> ](#1-<2D> <> <EFBFBD> <EFBFBD> )
* [2. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#2-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [3. <20> ַ<EFBFBD> <D6B7> <EFBFBD> ](#3-<2D> ַ<EFBFBD> <D6B7> <EFBFBD> )
* [4. ʱ<> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#4-ʱ<> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> )
* [1. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#1-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [1.1 B-Tree <20> <> <EFBFBD> <EFBFBD> ](#11-b-tree-<2D> <> <EFBFBD> <EFBFBD> )
* [1.2 <20> <> ϣ<EFBFBD> <CFA3> <EFBFBD> <EFBFBD> ](#12-<2D> <> ϣ<EFBFBD> <CFA3> <EFBFBD> <EFBFBD> )
* [1.3. <20> ռ <EFBFBD> <D5BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݣ<EFBFBD> R-Tree<65> <65> ](#13-<2D> ռ <EFBFBD> <D5BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> r-tree )
* [1.4 ȫ<> <C8AB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#14-ȫ<> <C8AB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [2. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ŵ<EFBFBD> ](#2-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ŵ<EFBFBD> )
* [3. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Ż<EFBFBD> ](#3-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> Ż<EFBFBD> )
* [3.1 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#31-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [3.2 ǰ<C7B0> <D7BA> <EFBFBD> <EFBFBD> ](#32-ǰ<C7B0> <D7BA> <EFBFBD> <EFBFBD> )
* [3.3 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#33-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [3.4 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> ˳<EFBFBD> <CBB3> ](#34-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> ˳<EFBFBD> <CBB3> )
* [3.5 <20> ۴<EFBFBD> <DBB4> <EFBFBD> <EFBFBD> <EFBFBD> ](#35-<2D> ۴<EFBFBD> <DBB4> <EFBFBD> <EFBFBD> <EFBFBD> )
* [3.6 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#36-<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> )
* [4. B-Tree <20> <> B+Tree ԭ<> <D4AD> ](#4-b-tree-<2D> <> -b+tree-ԭ<> <D4AD> )
2018-02-20 10:40:05 +08:00
* [4. 1 B-Tree ](#4-1-b-tree )
* [4.2 B+Tree ](#42-b+tree )
2018-02-22 14:47:54 +08:00
* [4.3 <20> <> <EFBFBD> <EFBFBD> ˳<EFBFBD> <CBB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <D6B8> <EFBFBD> <EFBFBD> B+Tree ](#43-<2D> <> <EFBFBD> <EFBFBD> ˳<EFBFBD> <CBB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <D6B8> <EFBFBD> <EFBFBD> -b+tree )
* [4.4 Ϊʲôʹ <C3B4> <CAB9> B-Tree <20> <> B+Tree ](#44-Ϊʲôʹ <C3B4> <CAB9> -b-tree-<2D> <> -b+tree )
* [<EFBFBD> <EFBFBD> ѯ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ż<EFBFBD> ](#<23> <> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD> <EFBFBD> Ż<EFBFBD> )
2018-02-20 10:40:05 +08:00
* [1. Explain ](#1-explain )
2018-02-22 14:47:54 +08:00
* [2. <20> <> <EFBFBD> ٷ<EFBFBD> <D9B7> ص<EFBFBD> <D8B5> <EFBFBD> ](#2-<2D> <> <EFBFBD> ٷ<EFBFBD> <D9B7> ص<EFBFBD> <D8B5> <EFBFBD> )
* [3. <20> <> <EFBFBD> ٷ<EFBFBD> <D9B7> ص<EFBFBD> <D8B5> <EFBFBD> ](#3-<2D> <> <EFBFBD> ٷ<EFBFBD> <D9B7> ص<EFBFBD> <D8B5> <EFBFBD> )
* [4. <20> <> <EFBFBD> ִ<EFBFBD> <D6B4> <EFBFBD> DELETE <20> <> INSERT <20> <> <EFBFBD> <EFBFBD> ](#4-<2D> <> <EFBFBD> ִ<EFBFBD> <D6B4> <EFBFBD> -delete-<2D> <> -insert-<2D> <> <EFBFBD> <EFBFBD> )
* [<EFBFBD> ֿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> ](#<23> ֿ<EFBFBD> <D6BF> <EFBFBD> <EFBFBD> ֱ<EFBFBD> )
* [<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> ƺ<EFBFBD> <EFBFBD> ϻָ<EFBFBD> ](#<23> <> <EFBFBD> <EFBFBD> ת<EFBFBD> ƺ<C6BA> <CDB9> ϻָ<CFBB> )
* [1. <20> <> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> ](#1-<2D> <> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> )
* [2. <20> <> <EFBFBD> ϻָ<CFBB> ](#2-<2D> <> <EFBFBD> ϻָ<CFBB> )
* [<EFBFBD> ο <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ](#<23> ο <EFBFBD> <CEBF> <EFBFBD> <EFBFBD> <EFBFBD> )
2018-02-20 10:40:05 +08:00
<!-- GFM - TOC -->
2018-02-22 14:47:54 +08:00
# <20> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
## 1. InnoDB
2018-02-22 14:47:54 +08:00
InnoDB <20> <> MySQL <20> <> Ĭ<EFBFBD> <C4AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 棬ֻ<E6A3AC> <D6BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ InnoDB <20> <> ֧<EFBFBD> ֵ<EFBFBD> <D6B5> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> ſ <EFBFBD> <C5BF> <EFBFBD> ʹ <EFBFBD> <CAB9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 洢<EFBFBD> <E6B4A2> <EFBFBD> 档
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> MVCC <20> <> ֧<EFBFBD> ָ߲<D6B8> <DFB2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> <CAB5> <EFBFBD> <EFBFBD> <EFBFBD> ĸ<EFBFBD> <C4B8> <EFBFBD> <EFBFBD> ĸ<EFBFBD> <C4B8> 뼶<EFBFBD> <EBBCB6> <EFBFBD> <EFBFBD> Ĭ<EFBFBD> ϼ<EFBFBD> <CFBC> <EFBFBD> <EFBFBD> ǿ<EFBFBD> <C7BF> ظ<EFBFBD> <D8B8> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ǻ<EFBFBD> <EFBFBD> ھ ۴<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ģ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> IJ<EFBFBD> ѯ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> кܸߵ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFB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FBD>
2018-02-20 10:40:05 +08:00
## 2. MyISAM
2018-02-22 14:47:54 +08:00
MyISAM <20> ṩ<EFBFBD> ˴ <EFBFBD> <CBB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ԣ<EFBFBD> <D4A3> <EFBFBD> <EFBFBD> <EFBFBD> ȫ<EFBFBD> <C8AB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѹ<EFBFBD> <D1B9> <EFBFBD> <EFBFBD> <EFBFBD> ռ 亯<D5BC> <E4BAAF> <EFBFBD> <EFBFBD> GIS<49> <53> <EFBFBD> ȡ<EFBFBD> <C8A1> <EFBFBD> MyISAM <20> <> ֧<EFBFBD> <D6A7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> м<EFBFBD> <D0BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ұ<EFBFBD> <D2B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <DEB7> <EFBFBD> ȫ<EFBFBD> ָ<EFBFBD> <D6B8> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
ֻ<EFBFBD> ܶ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ű<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Զ<EFBFBD> ִ<EFBFBD> м<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ǻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <EFBFBD> Լ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܵ<EFBFBD> <EFBFBD> <EFBFBD> һ Щ<EFBFBD> <EFBFBD> <EFBFBD> ݶ<EFBFBD> ʧ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƿdz<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ġ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ̬<EFBFBD> <EFBFBD> <EFBFBD> ߾<EFBFBD> ̬<EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> DELAY_KEY_WRITE ѡ <> <EFBFBD> <EEA3AC> ÿ<EFBFBD> <C3BF> <EFBFBD> <EFBFBD> ִ<EFBFBD> <D6B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĵ<DEB8> <C4B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> <D0B4> <EFBFBD> <EFBFBD> <EFBFBD> ̣<EFBFBD> <CCA3> <EFBFBD> <EFBFBD> ǻ<EFBFBD> д<EFBFBD> <D0B4> <EFBFBD> ڴ<EFBFBD> <DAB4> е ļ<D0B5> <C4BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> <D6BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߹رձ<D8B1> <D5B1> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> ŻὫ<C5BB> <E1BDAB> Ӧ<EFBFBD> <D3A6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> <D0B4> <EFBFBD> <EFBFBD> <EFBFBD> ̡<EFBFBD> <CCA1> <EFBFBD> <EFBFBD> ַ<EFBFBD> ʽ <EFBFBD> <CABD> <EFBFBD> Լ<EFBFBD> <D4BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> <D0B4> <EFBFBD> <EFBFBD> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <DDBF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <F0BBB5A3> <EFBFBD> Ҫִ<D2AA> <D6B4> <EFBFBD> <EFBFBD> <DEB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ժ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ٽ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> IJ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ô<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ı <EFBFBD> <EFBFBD> ʺϲ <EFBFBD> <EFBFBD> <EFBFBD> MyISAM ѹ<> <D1B9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߱<EFBFBD> <EFBFBD> Ƚ<EFBFBD> С <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ȼ<EFBFBD> <EFBFBD> <EFBFBD> Լ<EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> MyISAM<41> <4D>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
MyISAM <20> <> <EFBFBD> Ƽ <C6BC> <F2B5A5A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Խ<EFBFBD> <D4BD> ܸ<EFBFBD> ʽ <EFBFBD> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ijЩ<C4B3> <D0A9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܺܺá<DCBA>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## 3. InnoDB <20> <> MyISAM <20> ı Ƚ<C4B1>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**<2A> <> <EFBFBD> <EFBFBD> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
InnoDB <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͵ġ<CDB5>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**<2A> <> <EFBFBD> <EFBFBD> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
InnoDB ֧<> <D6A7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȱ<EFBFBD> <C8B1> ݡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**<2A> <> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
MyISAM <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĸ<F0BBB5B5> <C4B8> ʱ<EFBFBD> InnoDB <20> ߺ ܶ࣬<DCB6> <E0A3AC> <EFBFBD> һ ָ<D2BB> <D6B8> <EFBFBD> <EFBFBD> ٶ<EFBFBD> Ҳ<EFBFBD> <D2B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**<2A> <> <EFBFBD> <EFBFBD> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
MyISAM ֻ֧<D6BB> ֱ<EFBFBD> <D6B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> InnoDB <20> <> ֧<EFBFBD> <D6A7> <EFBFBD> м<EFBFBD> <D0BC> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**<2A> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
MyISAM ֧<> <D6A7> ȫ<EFBFBD> <C8AB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ռ <EFBFBD> <D5BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
# <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## 1. <20> <> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT <20> ֱ<EFBFBD> ʹ <EFBFBD> <CAB9> 8, 16, 24, 64 λ<> 洢<EFBFBD> ռ 䣬һ <E4A3AC> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ԽС <D4BD> <D0A1> <EFBFBD> <EFBFBD> Խ<EFBFBD> á<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
INT(11) <20> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> ǹ涨<C7B9> ˽<EFBFBD> <CBBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> ַ<EFBFBD> <D6B7> ĸ<EFBFBD> <C4B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ洢<DAB4> ͼ<EFBFBD> <CDBC> <EFBFBD> <EFBFBD> <EFBFBD> ˵<EFBFBD> <CBB5> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ġ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## 2. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
FLOAT <20> <> DOUBLE Ϊ<> <CEAA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͣ<EFBFBD> DECIMAL Ϊ<> ߾<EFBFBD> <DFBE> <EFBFBD> С <EFBFBD> <D0A1> <EFBFBD> <EFBFBD> <EFBFBD> ͡<EFBFBD> CPU ԭ<> <D4AD> ֧<EFBFBD> ָ<EFBFBD> <D6B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㣬<EFBFBD> <E3A3AC> <EFBFBD> Dz<EFBFBD> ֧<EFBFBD> <D6A7> DECIMAl <20> <> <EFBFBD> ͵ļ<CDB5> <C4BC> 㣬<EFBFBD> <E3A3AC> <EFBFBD> <EFBFBD> DECIMAL <20> ļ<EFBFBD> <C4BC> <EFBFBD> <EFBFBD> ȸ<EFBFBD> <C8B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> ߵ Ĵ<DFB5> <C4B4> ۡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
FLOAT<EFBFBD> <EFBFBD> DOUBLE <20> <> DECIMAL <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <D6B8> <EFBFBD> п<EFBFBD> <D0BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> DECIMAL(18, 9) <20> <> ʾ <EFBFBD> ܹ<EFBFBD> 18 λ<> <CEBB> ȡ 9 λ<> 洢С <E6B4A2> <D0A1> <EFBFBD> <EFBFBD> <EFBFBD> ֣<EFBFBD> ʣ<EFBFBD> <CAA3> 9 λ<> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֡<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## 3. <20> ַ<EFBFBD> <D6B7> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> CHAR <20> <> VARCHAR <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͣ<EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> Ƕ<EFBFBD> <C7B6> <EFBFBD> <EFBFBD> ģ<EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> DZ䳤<C7B1> ġ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
VARCHAR <20> <> <EFBFBD> ֱ䳤<D6B1> <E4B3A4> <EFBFBD> <EFBFBD> <EFBFBD> ܹ<EFBFBD> <DCB9> <EFBFBD> ʡ<EFBFBD> ռ 䣬<D5BC> <E4A3AC> Ϊֻ<CEAA> <D6BB> Ҫ<EFBFBD> 洢<EFBFBD> <E6B4A2> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> <EFBFBD> ݡ<EFBFBD> <DDA1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> <D6B4> UPDATE ʱ<> <CAB1> <EFBFBD> ܻ<EFBFBD> ʹ <EFBFBD> б <EFBFBD> <D0B1> ñ<EFBFBD> ԭ<EFBFBD> <D4AD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> ҳ<EFBFBD> <D2B3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɵĴ<C9B5> С ʱ<D0A1> <CAB1> <EFBFBD> <EFBFBD> Ҫִ<D2AA> ж<EFBFBD> <D0B6> <EFBFBD> <EFBFBD> IJ<EFBFBD> <C4B2> <EFBFBD> <EFBFBD> <EFBFBD> MyISAM <20> Ὣ<EFBFBD> в<EFBFBD> <D0B2> ɲ<EFBFBD> ͬ<EFBFBD> <CDAC> Ƭ<EFBFBD> δ洢<CEB4> <E6B4A2> <EFBFBD> <EFBFBD> InnoDB <20> <> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> ҳ<EFBFBD> <D2B3> ʹ <EFBFBD> зŽ<D0B7> ҳ<EFBFBD> ڡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
VARCHAR <20> ᱣ<EFBFBD> <E1B1A3> <EFBFBD> ַ<EFBFBD> <D6B7> <EFBFBD> ĩβ<C4A9> Ŀո <D5B8> CHAR <20> <> ɾ<EFBFBD> <C9BE> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## 4. ʱ<> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
MySQL <20> ṩ<EFBFBD> <E1B9A9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƶ<EFBFBD> <C6B5> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> ͣ<EFBFBD> DATATIME <20> <> TIMESTAMP<4D> <50>
2018-02-20 10:40:05 +08:00
**DATATIME**
2018-02-22 14:47:54 +08:00
<EFBFBD> ܹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1001 <20> 굽 9999 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ں<EFBFBD> ʱ<EFBFBD> 䣬<EFBFBD> <E4A3AC> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> 룬ʹ <EBA3AC> <CAB9> 8 <20> ֽڵĴ洢<C4B4> ռ 䡣
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> ء<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
Ĭ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> £<EFBFBD> MySQL <20> <> һ <EFBFBD> ֿ<EFBFBD> <D6BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ġ<EFBFBD> <C4A1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĸ<EFBFBD> ʽ <EFBFBD> <CABD> ʾ DATATIME ֵ<> <D6B5> <EFBFBD> <EFBFBD> <EFBFBD> 硰2008-01016 22:37:08<30> <38> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ANSI <20> <> <EFBFBD> <D7BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ں<EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <CABE> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
**TIMESTAMP**
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> UNIX ʱ<> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 1970 <20> <> 1 <20> <> 1 <20> <> <EFBFBD> <EFBFBD> ҹ<EFBFBD> <D2B9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> 䣩<EFBFBD> <E4A3A9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <CAB9> 4 <20> <> <EFBFBD> ֽڣ<D6BD> ֻ<EFBFBD> ܱ<EFBFBD> ʾ <EFBFBD> <CABE> 1970 <20> <> <20> <> 2038 <20> ꡣ
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> йء<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
MySQL <20> ṩ<EFBFBD> <E1B9A9> FROM_UNIXTIME() <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Unxi ʱ<> <CAB1> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> Ϊ<EFBFBD> <CEAA> <EFBFBD> ڣ<EFBFBD> <DAA3> <EFBFBD> <EFBFBD> ṩ<EFBFBD> <E1B9A9> UNIX_TIMESTAMP() <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> Ϊ Unix ʱ<> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
Ĭ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> £<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱû<EFBFBD> <EFBFBD> ָ<EFBFBD> <EFBFBD> TIMESTAMP <20> е <EFBFBD> ֵ<EFBFBD> <D6B5> <EFBFBD> Ὣ<EFBFBD> <E1BDAB> <EFBFBD> <EFBFBD> ֵ<EFBFBD> <D6B5> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> ǰʱ<C7B0> 䡣
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
Ӧ<EFBFBD> þ<EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> TIMESTAMP<4D> <50> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> <EFBFBD> <EFBFBD> DATETIME <20> ռ <EFBFBD> Ч<EFBFBD> ʸ<EFBFBD> <CAB8> ߡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
# <20> <> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ洢<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> ֵģ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڷ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> ֵģ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Բ<EFBFBD> ͬ<EFBFBD> 洢<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> в<EFBFBD> ͬ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͺ <EFBFBD> ʵ<EFBFBD> ֡<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѯ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ڷdz<EFBFBD> С <EFBFBD> ı <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ¼<EFBFBD> ȫ<EFBFBD> <EFBFBD> ɨ<EFBFBD> <EFBFBD> <EFBFBD> Ƚ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ч<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>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EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> ÷<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## 1. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 1.1 B-Tree <20> <> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
B-Tree <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Ǵ<EFBFBD> <C7B4> <EFBFBD> <EFBFBD> <EFBFBD> MySQL <20> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ĭ<EFBFBD> <C4AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͡<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> Ϊ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȫ<EFBFBD> <EFBFBD> ɨ<EFBFBD> 裬ֻ<EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɣ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˲<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ٶȿ<EFBFBD> <EFBFBD> ܶࡣ
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> У <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> й<EFBFBD> ͬ<EFBFBD> <EFBFBD> <EFBFBD> ɼ<EFBFBD> <EFBFBD> <EFBFBD> B-Tree <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȫ<EFBFBD> <C8AB> ֵ<EFBFBD> <D6B5> <EFBFBD> <EFBFBD> ֵ<EFBFBD> <D6B5> Χ <EFBFBD> ͼ<EFBFBD> ǰ<C7B0> <D7BA> <EFBFBD> ң<EFBFBD> <D2A3> <EFBFBD> <EFBFBD> м<EFBFBD> ǰ<C7B0> <D7BA> <EFBFBD> <EFBFBD> ֻ<EFBFBD> <D6BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǰ<C7B0> <D7BA> <EFBFBD> ҡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڲ<EFBFBD> <EFBFBD> ң<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͷ<EFBFBD> <EFBFBD> 顣
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǰ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> ˳<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> в<EFBFBD> <EFBFBD> ң<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 1.2 <20> <> ϣ<EFBFBD> <CFA3> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ڹ<EFBFBD> ϣ<EFBFBD> <EFBFBD> ʵ<EFBFBD> ֣<EFBFBD> <EFBFBD> ŵ<EFBFBD> <EFBFBD> Dz<EFBFBD> <EFBFBD> ҷdz<EFBFBD> <EFBFBD> 졣
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> MySQL <20> <> ֻ<EFBFBD> <D6BB> Memory <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʽ ֧<CABD> ֹ<EFBFBD> ϣ<EFBFBD> <CFA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
InnoDB <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ĺ<EFBFBD> <C4B9> ܽС <DCBD> <D0A1> <EFBFBD> <EFBFBD> <EFBFBD> Ӧ<EFBFBD> <D3A6> ϣ<EFBFBD> <CFA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ij<EFBFBD> <C4B3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֵ<EFBFBD> <D6B5> ʹ <EFBFBD> õķdz<C4B7> Ƶ<EFBFBD> <C6B5> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> B-Tree <20> <> <EFBFBD> <EFBFBD> ֮<EFBFBD> <D6AE> <EFBFBD> ٴ<EFBFBD> <D9B4> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> ϣ<EFBFBD> <CFA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> B-Tree <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> й<EFBFBD> ϣ<EFBFBD> <CFA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ Щ<D2BB> ŵ㣬<C5B5> <E3A3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ٵĹ<D9B5> ϣ<EFBFBD> <CFA3> <EFBFBD> ҡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ƣ<EFBFBD> <EFBFBD> <EFBFBD> ϣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϣֵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> 룬<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 洢<EFBFBD> ֶ<EFBFBD> ֵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Բ<EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <E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 +08:00
2018-02-22 14:47:54 +08:00
### 1.3. <20> ռ <EFBFBD> <D5BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݣ<EFBFBD> R-Tree<65> <65>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
MyISAM <20> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> ֧<EFBFBD> ֿռ <D6BF> <D5BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݴ洢<DDB4> <E6B4A2>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ռ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ά<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ч<EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ά<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϲ <EFBFBD> ѯ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 1.4 ȫ<> <C8AB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
MyISAM <20> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> ֧<EFBFBD> <D6A7> ȫ<EFBFBD> <C8AB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڲ<EFBFBD> <DAB2> <EFBFBD> <EFBFBD> ı <EFBFBD> <C4B1> е Ĺؼ<C4B9> <D8BC> ʣ<EFBFBD> <CAA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֱ<EFBFBD> ӱȽ<D3B1> <C8BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> ֵ<EFBFBD> <D6B5>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
ʹ <EFBFBD> <EFBFBD> MATCH AGAINST<53> <54> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨ<EFBFBD> <CDA8> WHERE<52> <45>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## 2. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ŵ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
- <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˷<EFBFBD> <CBB7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫɨ<D2AA> <C9A8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
- <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <CDB4> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
- <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> I/O <20> <> Ϊ˳<CEAA> <CBB3> I/O<> <4F>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## 3. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Ż<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 3.1 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ڽ<EFBFBD> <EFBFBD> в<EFBFBD> ѯʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> в<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> DZ<EFBFBD> <EFBFBD> <EFBFBD> ʽ <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> ֣<EFBFBD> Ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ǻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> IJ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> IJ<EFBFBD> ѯ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> actor_id <20> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
```sql
SELECT actor_id FROM sakila.actor WHERE actor_id + 1 = 5;
```
2018-02-22 14:47:54 +08:00
### 3.2 ǰ<C7B0> <D7BA> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> BLOB<4F> <42> TEXT <20> <> VARCHAR <20> <> <EFBFBD> ͵<EFBFBD> <CDB5> У <EFBFBD> <D0A3> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <CAB9> ǰ<C7B0> <D7BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> <D6BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʼ <EFBFBD> IJ<EFBFBD> <C4B2> <EFBFBD> <EFBFBD> ַ<EFBFBD> <D6B7> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǰ<EFBFBD> <EFBFBD> <EFBFBD> ȵ<EFBFBD> ѡ ȡ<EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ** <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ** <20> <> ȷ<EFBFBD> <C8B7> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ظ<EFBFBD> <D8B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֵ<EFBFBD> ͼ<EFBFBD> ¼<EFBFBD> <C2BC> <EFBFBD> <EFBFBD> <EFBFBD> ı <EFBFBD> ֵ<EFBFBD> <D6B5> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD> Խ<EFBFBD> ߣ<EFBFBD> <DFA3> <EFBFBD> ѯЧ<D1AF> <D0A7> ҲԽ<D2B2> ߡ<EFBFBD> <DFA1> <EFBFBD> <EFBFBD> <EFBFBD> ֵΪ 1 <20> <> <EFBFBD> <EFBFBD> ʱÿ<CAB1> <C3BF> <EFBFBD> <EFBFBD> ¼<EFBFBD> <C2BC> <EFBFBD> <EFBFBD> Ψһ <CEA8> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӧ<EFBFBD> <D3A6>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 3.3 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫʹ <EFBFBD> ö<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> в<EFBFBD> ѯʱ<EFBFBD> <EFBFBD> ʹ <EFBFBD> ö<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> ö<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܸ<EFBFBD> <EFBFBD> á<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> У <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ð<EFBFBD> actor_id <20> <> file_id <20> <> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
```sql
SELECT file_id, actor_ id FROM sakila.film_actor
WhERE actor_id = 1 OR film_id = 1;
```
2018-02-22 14:47:54 +08:00
### 3.4 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> е <EFBFBD> ˳<EFBFBD> <CBB3>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> ѡ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> з<EFBFBD> <EFBFBD> <EFBFBD> ǰ<EFBFBD> 棬<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> Ľ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> customer_id <20> <> ѡ <EFBFBD> <D1A1> <EFBFBD> Ա<EFBFBD> staff_id <20> <> <EFBFBD> ߣ<EFBFBD> <DFA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ð<EFBFBD> customer_id <20> з<EFBFBD> <D0B7> ڶ<EFBFBD> <DAB6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǰ<EFBFBD> 档
2018-02-20 10:40:05 +08:00
```sql
SELECT COUNT(DISTINCT staff_id)/COUNT(*) AS staff_id_selectivity,
COUNT(DISTINCT customer_id)/COUNT(*) AS customer_id_selectivity,
COUNT(*)
FROM payment;
```
```html
staff_id_selectivity: 0.0001
customer_id_selectivity: 0.0373
COUNT(*): 16049
```
2018-02-22 14:47:54 +08:00
### 3.5 <20> ۴<EFBFBD> <DBB4> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/b9e9ae8c-e216-4c01-b267-a50dbeb98fa4.jpg)
2018-02-22 14:47:54 +08:00
<EFBFBD> ۴<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݴ洢<EFBFBD> <EFBFBD> ʽ <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ۴ء<EFBFBD> <EFBFBD> <EFBFBD> ʾ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> к<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڵļ<EFBFBD> ֵ<EFBFBD> <EFBFBD> <EFBFBD> ܵش洢<EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> InnoDB <20> ľ۴<C4BE> <DBB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> <D0B4> <EFBFBD> <EFBFBD> <EFBFBD> B-Tree <20> <> Ҷ<EFBFBD> <D2B6> ҳ<EFBFBD> С <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> Ϊ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> д<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬ<EFBFBD> ĵط<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> ۴<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**<2A> ŵ<EFBFBD> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
1. <20> <> <EFBFBD> <EFBFBD> <D4B0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݱ<EFBFBD> <DDB1> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> 𣬼<EFBFBD> <F0A3ACBC> <EFBFBD> I/O <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2. <20> <> Ϊ<EFBFBD> <CEAA> <EFBFBD> ݱ<EFBFBD> <DDB1> <EFBFBD> <EFBFBD> <EFBFBD> B-Tree <20> У <EFBFBD> <D0A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݷ<EFBFBD> <DDB7> ʸ<EFBFBD> <CAB8> 졣
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**ȱ<> <C8B1> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
1. <20> ۴<EFBFBD> <DBB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <DEB6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> I/O <20> ܼ<EFBFBD> <DCBC> <EFBFBD> Ӧ<EFBFBD> õ<EFBFBD> <C3B5> <EFBFBD> <EFBFBD> ܣ<EFBFBD> <DCA3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȫ<EFBFBD> <C8AB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڴ棬<DAB4> <E6A3AC> û<EFBFBD> <C3BB> Ҫ<EFBFBD> þ۴<C3BE> <DBB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ٶ<EFBFBD> <D9B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ڲ<EFBFBD> <DAB2> <EFBFBD> ˳<EFBFBD> <EFBFBD> <F2A3ACB0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˳<EFBFBD> <CBB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ġ<EFBFBD>
3. <20> <> <EFBFBD> ²<EFBFBD> <C2B2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ۺܸߣ<DCB8> <DFA3> <EFBFBD> Ϊÿ<CEAA> <C3BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> µ<EFBFBD> <C2B5> ж<EFBFBD> <D0B6> <EFBFBD> <EFBFBD> ƶ<EFBFBD> <C6B6> <EFBFBD> <EFBFBD> µ<EFBFBD> λ<EFBFBD> á<EFBFBD>
4. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> 뵽ij<EBB5BD> <C4B3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҳ<EFBFBD> У <EFBFBD> <D0A3> 洢<EFBFBD> <E6B4A2> <EFBFBD> <EFBFBD> <EFBFBD> Ὣ<EFBFBD> <E1BDAB> ҳ<EFBFBD> <D2B3> <EFBFBD> ѳ<EFBFBD> <D1B3> <EFBFBD> <EFBFBD> <EFBFBD> ҳ<EFBFBD> <D2B3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɸ<EFBFBD> <C9B8> У <EFBFBD> ҳ<EFBFBD> <D2B3> <EFBFBD> ѻᵼ<D1BB> ±<EFBFBD> ռ <EFBFBD> ø<EFBFBD> <C3B8> <EFBFBD> <EFBFBD> Ĵ<EFBFBD> <C4B4> ̿ռ 䡣
5. <20> <> <EFBFBD> <EFBFBD> <EFBFBD> б Ƚ<D0B1> ϡ<EFBFBD> 裬<EFBFBD> <E8A3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҳ<EFBFBD> <D2B3> <EFBFBD> ѵ <EFBFBD> <D1B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݴ洢<DDB4> <E6B4A2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <CAB1> <EFBFBD> ۴<EFBFBD> <DBB4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܵ<EFBFBD> <DCB5> <EFBFBD> ȫ<EFBFBD> <C8AB> ɨ<EFBFBD> <C9A8> <EFBFBD> ٶȱ<D9B6> <C8B1> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 3.6 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> ѯ<EFBFBD> <EFBFBD> <EFBFBD> ֶε<EFBFBD> ֵ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## 4. B-Tree <20> <> B+Tree ԭ<> <D4AD>
2018-02-20 10:40:05 +08:00
### 4. 1 B-Tree
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/5ed71283-a070-4b21-85ae-f2cbfd6ba6e1.jpg)
2018-02-22 14:47:54 +08:00
Ϊ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> B-Tree<65> <65> <EFBFBD> <EFBFBD> <EFBFBD> ȶ<EFBFBD> <C8B6> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> ݼ<EFBFBD> ¼Ϊһ <CEAA> <D2BB> <EFBFBD> <EFBFBD> Ԫ<EFBFBD> <D4AA> [key, data]<5D> <> key Ϊ<> <CEAA> ¼<EFBFBD> ļ<EFBFBD> <C4BC> <EFBFBD> data Ϊ<> <CEAA> <EFBFBD> ݼ<EFBFBD> ¼<EFBFBD> <C2BC> key <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
B-Tree <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݽṹ<DDBD> <E1B9B9>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
- <20> <> <EFBFBD> <EFBFBD> Ҷ<EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬ<EFBFBD> <CDAC> <EFBFBD> <EFBFBD> <EFBFBD> ȣ <EFBFBD> Ҳ<EFBFBD> <D2B2> <EFBFBD> <EFBFBD> ˵ B-Tree <20> <> ƽ <EFBFBD> <C6BD> <EFBFBD> ģ<EFBFBD>
- һ <> <D2BB> <EFBFBD> ڵ<EFBFBD> <DAB5> е <EFBFBD> key <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҷǵݼ<C7B5> <DDBC> <EFBFBD> <EFBFBD> У <EFBFBD>
- <20> <> <EFBFBD> <EFBFBD> ij<EFBFBD> <C4B3> ָ<EFBFBD> <D6B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> key <20> ֱ<EFBFBD> <D6B1> <EFBFBD> key< sub > i</ sub > <20> <> key< sub > i+1</ sub > <EFBFBD> <EFBFBD> <EFBFBD> Ҳ<EFBFBD> Ϊ null<6C> <6C> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <D6B8> ָ<EFBFBD> <D6B8> <EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> key <20> <> <EFBFBD> <EFBFBD> key< sub > i</ sub > <20> <> С <EFBFBD> <D0A1> key< sub > i+1</ sub > <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> B-Tree <20> а <EFBFBD> key <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݵ<EFBFBD> <DDB5> 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<EFBFBD> <DAB2> <EFBFBD> ɾ<EFBFBD> <C9BE> ʱ<EFBFBD> <CAB1> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <D1A1> ϲ <EFBFBD> <CFB2> <EFBFBD> ת<EFBFBD> ƵȲ<C6B5> <C8B2> <EFBFBD> <EFBFBD> Ա<EFBFBD> <D4B1> <EFBFBD> B-Tree <20> <> <EFBFBD> ʡ<EFBFBD>
2018-02-20 10:40:05 +08:00
### 4.2 B+Tree
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/63cd5b50-d6d8-4df6-8912-ef4a1dd5ba13.jpg)
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> B-Tree <20> <> <EFBFBD> ȣ <EFBFBD> B+Tree <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ²<EFBFBD> ͬ<EFBFBD> 㣺
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
- ÿ<> <C3BF> <EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> ָ<EFBFBD> <D6B8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ 2d <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 2d+1<> <31>
- <20> ڽڵ㲻<DAB5> 洢 data<74> <61> ֻ<EFBFBD> 洢 key<65> <79> Ҷ<EFBFBD> ӽڵ㲻<DAB5> 洢ָ<E6B4A2> 롣
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 4.3 <20> <> <EFBFBD> <EFBFBD> ˳<EFBFBD> <CBB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> <D6B8> <EFBFBD> <EFBFBD> B+Tree
2018-02-20 10:40:05 +08:00
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/1ee5f0a5-b8df-43b9-95ab-c516c54ec797.jpg)
2018-02-22 14:47:54 +08:00
һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD> ϵͳ<EFBFBD> <EFBFBD> <EFBFBD> ļ<EFBFBD> ϵͳ<EFBFBD> <EFBFBD> ʹ <EFBFBD> õ<EFBFBD> B+Tree <20> ṹ<EFBFBD> <E1B9B9> <EFBFBD> ھ <EFBFBD> <DABE> <EFBFBD> B+Tree <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Ͻ<EFBFBD> <CFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ż<EFBFBD> <C5BB> <EFBFBD> <EFBFBD> <EFBFBD> Ҷ<EFBFBD> ӽڵ<D3BD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˳<EFBFBD> <CBB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ָ<EFBFBD> 룬<EFBFBD> <EBA3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ż<EFBFBD> <C5BB> <EFBFBD> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <CEAA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʵ<EFBFBD> <CAB5> <EFBFBD> <EFBFBD> ܡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
### 4.4 Ϊʲôʹ <C3B4> <CAB9> B-Tree <20> <> B+Tree
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݽṹҲ<EFBF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BD> һ <EFBFBD> <D2BB> <EFBFBD> ڵ<EFBFBD> <DAB5> Ĵ<EFBFBD> С <EFBFBD> <D0A1> Ϊ<EFBFBD> <CEAA> <EFBFBD> <EFBFBD> һ <EFBFBD> <D2BB> ҳ<EFBFBD> <D2B3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ÿ<EFBFBD> <C3BF> <EFBFBD> ڵ<EFBFBD> ֻ<EFBFBD> <D6BB> Ҫһ <D2AA> <D2BB> I/O <20> Ϳ <EFBFBD> <CDBF> <EFBFBD> <EFBFBD> <EFBFBD> ȫ<EFBFBD> <C8AB> <EFBFBD> 롣B-Tree <20> <> һ <EFBFBD> μ<EFBFBD> <CEBC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ h-1 <20> <> I/O<> <4F> <EFBFBD> <EFBFBD> <EFBFBD> ڵ㳣פ<E3B3A3> ڴ棩<DAB4> <E6A3A9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӷ<EFBFBD> Ϊ O(h)=O(logdN)<29> <> һ <EFBFBD> <D2BB> ʵ<EFBFBD> <CAB5> Ӧ<EFBFBD> <D3A6> <EFBFBD> У <EFBFBD> <D0A3> <EFBFBD> <EFBFBD> <EFBFBD> d <20> Ƿdz<C7B7> <C7B3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֣<EFBFBD> ͨ<EFBFBD> <CDA8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 100<30> <30> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> h <20> dz<EFBFBD> С <EFBFBD> <D0A1> ͨ<EFBFBD> <CDA8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 3<> <33> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֽṹ<D6BD> <E1B9B9> h <20> <> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> Ķࡣ<C4B6> <E0A1A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <DFBC> Ϻ ܽ<CFBA> <DCBD> Ľڵ㣨<DAB5> <E3A3A8> <EFBFBD> ӣ<EFBFBD> <D3A3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ͽ<EFBFBD> <CFBF> ܺ<EFBFBD> Զ<EFBFBD> <D4B6> <EFBFBD> <EFBFBD> <DEB7> <EFBFBD> <EFBFBD> þֲ<C3BE> <D6B2> ԣ<EFBFBD> Ч<EFBFBD> <D0A7> <EFBFBD> <EFBFBD> <EFBFBD> Ա<EFBFBD> B-Tree <20> <> <EFBFBD> ܶࡣ
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
B+Tree <20> <> <EFBFBD> ʺ<EFBFBD> <CABA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ԭ<EFBFBD> <D4AD> <EFBFBD> <EFBFBD> <EFBFBD> ڽڵ<DABD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD> d <20> йء<D0B9> <D8A1> <EFBFBD> <EFBFBD> <EFBFBD> B+Tree <20> ڽڵ<DABD> ȥ<EFBFBD> <C8A5> <EFBFBD> <EFBFBD> data <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˿<EFBFBD> <CBBF> <EFBFBD> ӵ<EFBFBD> и<EFBFBD> <D0B8> <EFBFBD> <EFBFBD> ij<EFBFBD> <C4B3> ȣ <EFBFBD> ӵ<EFBFBD> и<EFBFBD> <D0B8> õ<EFBFBD> <C3B5> <EFBFBD> <EFBFBD> ܡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
# <20> <> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD> <EFBFBD> Ż<EFBFBD>
2018-02-20 10:40:05 +08:00
## 1. Explain
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> SQL <20> <> <EFBFBD> 䣬<EFBFBD> <E4A3AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> б Ƚ<D0B1> <C8BD> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> ֶ<EFBFBD> <D6B6> У <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
- select_type : <20> <> ѯ<EFBFBD> <D1AF> <EFBFBD> ͣ<EFBFBD> <CDA3> м<D0BC> ѯ<EFBFBD> <D1AF> <EFBFBD> <EFBFBD> <EFBFBD> ϲ <EFBFBD> ѯ<EFBFBD> <D1AF> <EFBFBD> Ӳ<EFBFBD> ѯ
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
- key : ʹ <> õ<EFBFBD> <C3B5> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
- rows : ɨ<> <C9A8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## 2. <20> <> <EFBFBD> ٷ<EFBFBD> <D9B7> ص<EFBFBD> <D8B5> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѯ<EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˹<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˷<EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֮<EFBFBD> ⣬Ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> ò<EFBFBD> Ҫʹ <EFBFBD> <EFBFBD> SELECT * <20> <> <EFBFBD> 䣬Ҫ<E4A3AC> <D2AA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫѡ <D2AA> <D1A1> <EFBFBD> <EFBFBD> ѯ<EFBFBD> <D1AF> <EFBFBD> С <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## 3. <20> <> <EFBFBD> ٷ<EFBFBD> <D9B7> ص<EFBFBD> <D8B5> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> LIMIT <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȡ<EFBFBD> <C8A1> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <D2AA> <EFBFBD> <EFBFBD> Щ<EFBFBD> С <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Խ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȫ<EFBFBD> <EFBFBD> ɨ<EFBFBD> 衣<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 䣬<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȫ<EFBFBD> <EFBFBD> ɨ<EFBFBD> 裬<EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> <EFBFBD> Ҫɨ<EFBFBD> 輸<EFBFBD> м<EFBFBD> ¼<EFBFBD> <EFBFBD> <EFBFBD> ɣ <EFBFBD> ʹ <EFBFBD> <EFBFBD> Explain <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͨ<EFBFBD> <CDA8> <EFBFBD> ۲<EFBFBD> rows <20> ֶ<EFBFBD> <D6B6> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֲ<EFBFBD> <D6B2> 졣
2018-02-20 10:40:05 +08:00
```sql
SELECT * FROM sakila.film_actor WHERE film_id = 1;
```
2018-02-22 14:47:54 +08:00
## 4. <20> <> <EFBFBD> ִ<EFBFBD> <D6B4> <EFBFBD> DELETE <20> <> INSERT <20> <> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ִ<EFBFBD> е Ļ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ס <EFBFBD> ܶ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݡ<EFBFBD> ռ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ־<EFBFBD> <EFBFBD> <EFBFBD> ľ<EFBFBD> ϵͳ<EFBFBD> <EFBFBD> Դ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܶ<EFBFBD> С <EFBFBD> ĵ<EFBFBD> <EFBFBD> <EFBFBD> Ҫ<EFBFBD> IJ<EFBFBD> ѯ<EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
```sql
DELEFT FROM messages WHERE create < DATE_SUB ( NOW ( ) , INTERVAL 3 MONTH ) ;
```
```sql
rows_affected = 0
do {
rows_affected = do_query(
"DELETE FROM messages WHERE create < DATE_SUB ( NOW ( ) , INTERVAL 3 MONTH ) LIMIT 10000 " )
} while rows_affected > 0
```
2018-02-22 14:47:54 +08:00
# <20> ֿ<EFBFBD> <D6BF> <EFBFBD> <EFBFBD> ֱ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**1. <20> ֱ<EFBFBD> <D6B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> IJ<EFBFBD> ͬ**
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ֱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǽ<EFBFBD> һ <EFBFBD> ű<EFBFBD> <EFBFBD> ֳɶ<EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ЩС <EFBFBD> <EFBFBD> ӵ<EFBFBD> в<EFBFBD> ͬ<EFBFBD> ı <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǽ<EFBFBD> һ <EFBFBD> ű<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݷ<EFBFBD> Ϊ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 飬<EFBFBD> <EFBFBD> Щ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Դ洢<EFBFBD> <EFBFBD> ͬһ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϣ<EFBFBD> Ҳ<EFBFBD> <EFBFBD> <EFBFBD> Դ洢<EFBFBD> ڲ<EFBFBD> ͬ<EFBFBD> Ĵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ַ<EFBFBD> ʽ <EFBFBD> ±<EFBFBD> <EFBFBD> <EFBFBD> Ȼֻ<EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**2. ʹ <> ÷ֿ<C3B7> <D6BF> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1> <EFBFBD> ԭ<EFBFBD> <D4AD> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <EFBFBD> <EFBFBD> ķ<EFBFBD> չ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <EFBFBD> е ı <EFBFBD> <EFBFBD> <EFBFBD> Խ<EFBFBD> <EFBFBD> Խ<EFBFBD> ࣬<EFBFBD> <EFBFBD> <EFBFBD> ұ<EFBFBD> <EFBFBD> е <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ҳ<EFBFBD> <EFBFBD> Խ<EFBFBD> <EFBFBD> Խ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ô<EFBFBD> <EFBFBD> д<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <EFBFBD> <EFBFBD> Ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**3. <20> <> ֱ<EFBFBD> з<EFBFBD> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ģ<EFBFBD> 顢<EFBFBD> <EFBFBD> ϵ<EFBFBD> <EFBFBD> <EFBFBD> г ̶Ȼ<EFBFBD> <EFBFBD> ֳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͬ<EFBFBD> Ŀ<EFBFBD> <EFBFBD> ϡ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 磬<EFBFBD> <EFBFBD> <EFBFBD> ǻὨ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ʒ <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD> payDB<44> <42> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> <EFBFBD> ݿ<EFBFBD> userDB <20> ȣ <EFBFBD> <C8A3> ֱ<EFBFBD> <D6B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 洢<EFBFBD> <E6B4A2> Ŀ<EFBFBD> <C4BF> <EFBFBD> <EFBFBD> Ʒ <EFBFBD> йصı <D8B5> <C4B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> йصı <D8B5> <C4B1> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**4. ˮƽ <CBAE> з<EFBFBD> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> ѱ<EFBFBD> <EFBFBD> е <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݰ<EFBFBD> <EFBFBD> <EFBFBD> ij<EFBFBD> ֹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 洢<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ṹ<EFBFBD> <EFBFBD> ͬ<EFBFBD> ı <EFBFBD> <EFBFBD> У <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 簴 id <20> <> ɢ<EFBFBD> <C9A2> ֵ<EFBFBD> <D6B5> <EFBFBD> Ա<EFBFBD> <D4B1> Ƚ<EFBFBD> <C8BD> л<EFBFBD> <D0BB> ֣<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**5. <20> <> ֱ<EFBFBD> з<EFBFBD> <D0B7> <EFBFBD> ˮƽ <CBAE> зֵ<D0B7> ѡ <EFBFBD> <D1A1> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <EFBFBD> е ı <EFBFBD> ̫<EFBFBD> ࣬<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ŀ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ҵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ô<EFBFBD> <EFBFBD> ֱ<EFBFBD> з<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <EFBFBD> ı <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ࣬<EFBFBD> <EFBFBD> <EFBFBD> ǵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܴ<EFBFBD> <EFBFBD> <EFBFBD> Ӧ<EFBFBD> <EFBFBD> ѡ <EFBFBD> <EFBFBD> ˮƽ <EFBFBD> з֡<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**6. ˮƽ <CBAE> зֵ<D0B7> ʵ<EFBFBD> ַ<EFBFBD> ʽ **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> <EFBFBD> merge <20> 洢<EFBFBD> <E6B4A2> <EFBFBD> 档
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**7. <20> ֿ<EFBFBD> <D6BF> <EFBFBD> <EFBFBD> ֱ<EFBFBD> <D6B1> <EFBFBD> <EFBFBD> ڵ<EFBFBD> <DAB5> <EFBFBD> <EFBFBD> <EFBFBD> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
(1) <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> ִ<EFBFBD> зֿ<EFBFBD> <EFBFBD> ֱ<EFBFBD> ֮<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݴ洢<EFBFBD> <EFBFBD> <EFBFBD> ˲<EFBFBD> ͬ<EFBFBD> Ŀ<EFBFBD> <EFBFBD> ϣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݿⱾ<EFBFBD> <EFBFBD> <EFBFBD> ķֲ<EFBFBD> ʽ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȥִ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ߰<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ܴ<EFBFBD> <EFBFBD> ۣ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ӧ<EFBFBD> ó<EFBFBD> <EFBFBD> <EFBFBD> ȥЭ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƣ<EFBFBD> <EFBFBD> γ ɳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֻ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɱ<EFBFBD> <EFBFBD> ̷<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĸ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
(2) <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> ִ<EFBFBD> <EFBFBD> <EFBFBD> ˷ֿ<EFBFBD> <EFBFBD> ֱ<EFBFBD> ֮<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ա<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ὣԭ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ժ<EFBFBD> ǿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݻ<EFBFBD> <EFBFBD> ֵ<EFBFBD> <EFBFBD> <EFBFBD> ͬ<EFBFBD> ı <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <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BFBD> <EFBFBD> Ҳ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> л<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֹ<EFBFBD> <EFBFBD> <EFBFBD> ʱ<EFBFBD> <EFBFBD> <EFBFBD> л<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ⣬ʹ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <EFBFBD> <EFBFBD> ⡣<EFBFBD> <EFBFBD> <EFBFBD> ϻָ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˼<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ǵӹ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> лָ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ұ<EFBFBD> ֤<EFBFBD> <EFBFBD> <EFBFBD> ݵ<EFBFBD> <EFBFBD> <EFBFBD> ȷ<EFBFBD> ԡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## 1. <20> <> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**1.1 <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> л<EFBFBD> <D0BB> <EFBFBD> ɫ**
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ ̨<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϊ<EFBFBD> <EFBFBD> <EFBFBD> ⣬<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> һ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> -<2D> <> <EFBFBD> <EFBFBD> <EFBFBD> ƽ ṹ<C6BD> е <EFBFBD> <D0B5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ͱ<EFBFBD> <CDB1> <EFBFBD> <EFBFBD> <EFBFBD> ɫ<EFBFBD> <C9AB>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**1.2 <20> <> <EFBFBD> <EFBFBD> IP <20> <> ַ<EFBFBD> <D6B7> IP <20> й<EFBFBD> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
Ϊ MySQL ʵ<> <CAB5> ָ<EFBFBD> <D6B8> һ <EFBFBD> <D2BB> <EFBFBD> <EFBFBD> IP <20> <> ַ<EFBFBD> <D6B7> <EFBFBD> <EFBFBD> MySQL ʵ<> <CAB5> ʧЧʱ<D0A7> <CAB1> <EFBFBD> <EFBFBD> <EFBFBD> Խ<EFBFBD> IP <20> <> ַת<D6B7> Ƶ<EFBFBD> <C6B5> <EFBFBD> һ ̨ MySQL <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϡ<EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
**1.3 <20> м<EFBFBD> <D0BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
ͨ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ·<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʹ <EFBFBD> õķ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϡ<EFBFBD>
2018-02-20 10:40:05 +08:00
![](https://github.com/CyC2018/InterviewNotes/blob/master/pics/fabd5fa0-b75e-48d0-9e2c-31471945ceb9.jpg)
2018-02-22 14:47:54 +08:00
**1.4 <20> <> Ӧ<EFBFBD> <D3A6> <EFBFBD> д<EFBFBD> <D0B4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <D7AA> **
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ת<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϵ<EFBFBD> Ӧ<EFBFBD> <EFBFBD> <EFBFBD> п<EFBFBD> <EFBFBD> ܵ<EFBFBD> <EFBFBD> <EFBFBD> Ӧ<EFBFBD> ñ<EFBFBD> <EFBFBD> <EFBFBD> ̫<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
## 2. <20> <> <EFBFBD> ϻָ<CFBB>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
# <20> ο <EFBFBD> <CEBF> <EFBFBD> <EFBFBD> <EFBFBD>
2018-02-20 10:40:05 +08:00
2018-02-22 14:47:54 +08:00
- <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> MySQL
- [MySQL <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ݽṹ<DDBD> <E1B9B9> <EFBFBD> 㷨ԭ<E3B7A8> <D4AD> ](http://blog.codinglabs.org/articles/theory-of-mysql-index.html )
- [MySQL <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Ż<EFBFBD> ȫ<EFBFBD> <C8AB> <EFBFBD> <EFBFBD> ](http://www.runoob.com/w3cnote/mysql-index.html )
- [20+ <20> <> MySQL <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Ż<EFBFBD> <C5BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ѿ<EFBFBD> <D1BE> <EFBFBD> ](https://www.jfox.info/20-tiao-mysql-xing-nen-you-hua-de-zui-jia-jing-yan.html )