Let's say that I'm making an IRC bot, and in addition to all the other stuff that should be stored in the DB, I want to log all the messages in each channel in which the bot is present.
I already have a
channels table with columns
channel_name, and some other info.
For logging each message, what seems the most sense to me is to create a
messages_channelname table for each channel, and in there store the message along with whatever other information is associated with it.
That elicits a problem, though - the name of the table is now dissociated from the channel's
id (although I could alleviate this by making the table name
I feel like the best practice here, rather than what makes the most sense, would be to have a master
messages table that contains the messages from all channels, with columns
id would be the index of the message per channel. But then I'd have (unfounded) concerns about table size and possibly search speed.
What's the best way to go about this?