Store data for songs MySQL DB
Posted
by Johan
on Stack Overflow
See other posts from Stack Overflow
or by Johan
Published on 2010-04-06T18:14:37Z
Indexed on
2010/04/06
18:23 UTC
Read the original article
Hit count: 325
I'm storing a huge set of songs in a MySQL database. This is what I store in the 'songs' table:
CREATE TABLE `songs` (
`song_id` int(10) unsigned NOT NULL auto_increment,
`song_artist` varchar(255) NOT NULL,
`song_track` varchar(255) NOT NULL,
`song_mix` varchar(255) NOT NULL,
`song_title` text NOT NULL,
`song_hash` varchar(40) NOT NULL,
`song_addtime` int(10) unsigned NOT NULL,
`song_source` text NOT NULL,
`song_file` varchar(255) NOT NULL,
PRIMARY KEY (`song_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1857 DEFAULT CHARSET=latin1
Now I'd like to keep track of how many plays each song has, and other song-specific data that relates to the song. I don't want to keep adding fields to the 'songs' table for this. How can I store song related data a more efficient way? What's the best practice here?
© Stack Overflow or respective owner