I can’t find any info regarding my question. This is more theoretical question.
For example, i have table keywords.
CREATE TABLE IF NOT EXISTS `keywords` (
`kid` int(11) unsigned NOT NULL AUTO_INCREMENT,
`language_id` int(11) NOT NULL,
`keyword` varchar(120) NOT NULL,
PRIMARY KEY (`kid`),
UNIQUE KEY `custom_idx` (`language_id`,`keyword`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
My server has 1GB of free RAM memory. My table has millions of rows and size of my custom_idx is more than 1GB. Index can’t fit into RAM memory. What would mysql do ? Is only part of this index will be stored in the memory ? Will this break BTREE/Clustered index performance dramatically ?
Also, if size of my index can’t fit into innodb_buffer_pool_size limits, what would happen ?
Is replication is the answer to enormous InnoDB databases where indexes can’t fit into RAM memory ?
InnoDB uses the InnoDB buffer pool (whose size is controlled using the
innodb_buffer_pool_sizevariable) to cache a lot of different data structures, including row data and indexes. If your data set is too large for this buffer pool, MySQL will of course swap. How dramatic the effects are, you’ll have to measure. It can be anything between “barely noticeable” and “queries take 1000x longer”.Replication is most certainly not a solution. Replication only syncs your data to another machine, and it doesn’t allow schema differences (e.g., different indexes, if you had that in mind) between them. If that other machine is equally underequipped, you’ll come out with two instead of one slow database servers. You should probably install more memory into the first server.