将数据和索引数据保存在内存中 - InnoDB与MyISAM [英] Keeping data plus index-data in memory - InnoDB vs. MyISAM

查看:776
本文介绍了将数据和索引数据保存在内存中 - InnoDB与MyISAM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设一个包含1 GB数据和1 GB索引数据的数据库。

Assume a database consisting of 1 GB of data and 1 GB of index data.

为了最小化磁盘IO,从而最大限度地提高性能,我想为MySQL分配内存包含索引的整个数据集可以保存在RAM中(假设机器有大量RAM)。

To minimize disk IO and hence maximize performance I want to allocate memory to MySQL so that the entire dataset including indexes can be kept in RAM (assume that the machine has RAM in abundance).

InnoDB参数 innodb_buffer_pool_size 用于指定InnoDB用于缓存其表的数据和索引的内存缓冲区的大小。 (注意:内存用于数据 AND 索引。)

The InnoDB parameter innodb_buffer_pool_size is used to specify the size of the memory buffer InnoDB uses to cache data and indexes of its tables. (Note: The memory is used for data AND indexes.)

MyISAM参数 key_buffer_size 用于指定MyISAM用于缓存其表的索引的内存缓冲区的大小。 (注意:内存只用于 ONLY 索引。)

The MyISAM parameter key_buffer_size is used to specify the size of the memory buffer MyISAM uses to cache indexes of its tables. (Note: The memory is used ONLY for indexes.)

如果我想要2 GB数据库(1 GB数据和1 GB索引)以适应InnoDB下的内存,我只需将 innodb_buffer_pool_size 配置为 2GB

If I want the 2 GB database (1 GB data and 1 GB index) to fit into memory under InnoDB, I'd simply configure the innodb_buffer_pool_size to be 2GB. The two gigabytes will hold both the data and the index.

但是,当设置MyISAM键 key_buffer_size 2GB ,该空间将用于索引,但不用于数据。

However, when setting the MyISAM key key_buffer_size to 2GB that space will be used for the index, but not for the data.

我的问题是:


  • MyISAM的数据缓冲区大小

推荐答案

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆