1

For 35 million records I have this table

CREATE TABLE IF NOT EXISTS `records` (
  `code` varchar(12) NOT NULL,
  `type` varchar(255) NOT NULL,
  `used` set('y','n') NOT NULL default 'n',
  PRIMARY KEY  (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

The code is alphanumerical and unique. I just have to check if a code exists and whether or not it has been used.

What server specs would you recommend? Any other suggestions on arquitechture? We will probably be using Rackspace so if you have any experience with them that would be great.

1 Answers1

1

Given the above table description, my first order of business would be to get rid of the duplicate index for three reasons:

  1. it would slow down inserts
  2. needlessly bloat the table to about triple the amount on index info
  3. would render either the PRIMARY KEY or the code index useless in EXPLAIN plans

NOTE : A duplicate index is an index that has the same leading columns as another index. You would remove the index if the leading columns has no additional columns needed by certain queries.

Please run this to discard the duplicate index

ALTER TABLE records DROP INDEX code;

You need to find out how much memory and disk will be need for a given dataset.

Please see my other posts on memory, threading, and InnoDB configurations

RolandoMySQLDBA
  • 185,223
  • 33
  • 326
  • 536