views:

46

answers:

1

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!

+1  A: 

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

f00