I have this small, simple table:

CREATE TABLE `ads_tracker` (
  `type` smallint unsigned NOT NULL,
  `reference` smallint unsigned NOT NULL,
  `date` timestamp NOT NULL,
  `action` enum('view','click') NOT NULL DEFAULT 'view'
) COMMENT='' ENGINE='InnoDB' COLLATE 'utf8_unicode_ci';

It has only an index as the Primary Key, but nothing else. Will there be any noticeable difference between inserting rows now (empty table), with say 100,000 rows, and say 1,000,000 rows? I figure UPDATEs will be slower, but I'd say that an INSERT could be pretty much just as fast, as there are no indexes except for the primary key. Or am I wrong there?


When you are mass INSERTs into an InnoDB table with just a Primary Key you are building up the gen_clust_index (a.k.a. Clustered Index).

Secondary Indexes are built in conjunction with the Clustered Index. Since you have no Secondary Indexes, this reload would be just fine.

I would high recommend doing two things when reloading:

When you use the bulk insert buffer, it helps load the data into a treelike structure that makes it easier to load into a non-empty table.

  • Does this apply when using InnoDB? The manual refers to MyISAM but not InnoDB. Thanks – Nathan Labenz Jul 7 '12 at 23:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.