We have a table with a composite Primary key consisting of three fields (and it is in MySQL 5.1). There are near 200 inserts and 200 selects per second on this table, and th
SELECT
s a tiny bit, though the effect is pretty much negligible and not worth worrying about.INSERT
s, and you certainly are doing enough INSERT
s to worry about it. This is much more of a concern if it's a MyISAM table, where an INSERT
locks the table, than if it's an InnoDB table. If, by going with the auto_increment primary key, you would be able to leave those columns unindexed, you would benefit from the change. If you would still need to keep those three columns indexed, though (for example, if you need to enforce uniqueness on the combination of them), it isn't going to do anything for you performance-wise.