MySQL sharding and primary key performance in InnoDB
I run a lyrics web site and I have a single table that basically keeps an index of songs; essentially primary key with auto increment (song_id), artist, and song title.
The lyrics themselves are stored across 10 shards, with each shard based on song_id MOD 10. There are two columns: song_id and song_lyrics. The song_id field is primary key, but not auto increment, and stores the same integer as in the index table.
My question is, being that from what I've read about InnoDB and primary key, is it any kind of performance hit that, for example on shard 0, the song_id rows go 10, 20, 30, etc. 开发者_如何学运维and are not consecutive? My fear is that skipping numbers in primary key is going to impact performance.
Even with memcached there isn't a huge strain right now, but I'm going to be adding some new features in addition to lyrics so if I'm going to change the schema, now is a better time than any. I appreciate any insight. Thank you!
providing the data is inserted in sequential order you shouldnt experience any performance issues.
http://dev.mysql.com/doc/refman/5.0/en/innodb-physical-structure.html
http://dev.mysql.com/doc/refman/5.0/en/innodb-index-types.html
精彩评论