Heim >Datenbank >MySQL-Tutorial >数据库关于InnoDb的使用详解_MySQL

数据库关于InnoDb的使用详解_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:58:511039Durchsuche

InnoDb 介绍:
  InnoDb 存储引擎,支持事务,行锁,外键.InnoDb 设计用来处理大数据量时提供最好的性能.


  InnoDb 提供自己的缓存(buffer pool) 还缓存数据和索引.innodb 把数据和索引存放到表空间(tablespace) ,表空间是几个磁盘文件或者是原是设备文件(raw disk). 它不像MyISAM 存储引擎,每个表只是一个文件.(这样在某些系统下最大2G限制). 而Innodb没有此限制,可以无限扩展.
  Mysql4.0 的以后版本都支持innodb 存储.

  InnoDb 配置:
  innodb 管理的两个磁盘文件是表空间文件和日志文件.
  表空间定义:
  innodb_data_file_path=datafile_spec1[;datafile_spec2]...
  文件声明格式: file_name:file_size[:autoextend[:max:max_file_size]]
  innodb_data_home_dir 声明文件存放目录.

  mysql 读取配置文件的顺序:
  `/etc/my.cnf' Global options.
  `DATADIR/my.cnf' Server-specific options.
  `defaults-extra-file' The file specified with the --defaults-extra-file option.
  `~/.my.cnf' User-specific options.

  内存使用下面的加起来不要超过2G:

  innodb_buffer_pool_size
  + key_buffer_size
  + max_connections*(sort_buffer_size+read_buffer_size+binlog_cache_size)
  + max_connections*2MB

  InnoDb 参数说明:

  innodb_additional_mem_pool_size
  存储数据字典信息和内部结构信息, 如果你的表越多,这个需要的内存就越多,如果你预留的空间不够,就开始象系统申请内存.errlog 会有错误. 缺省设置为1M.
  innodb_autoextend_increment
  当表空间满时字段扩展大小.

  innodb_buffer_pool_size
  数据和索引用的缓存大小.一般时系统物理内存的50~80% .

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn