structure
CREATE TABLE IF NOT EXISTS `blabbing` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) CHARACTER SET utf8 NOT NULL,
`msg_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'
`body` varchar(255) CHARACTER SET utf8 NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=307 ;
Also if I want to add a responseto field can I use the same structure as the body field because this is a response and will have the same type of data that the field.
Since this is likely a primary key, using a hash function on an indexed column should be avoided. Hash functions are not sequential, so an ordered index will get fragmented VERY quickly.
Your best bet is to create a trigger to check the values don’t already exist, or put extra code as part of the insert. It will make for much faster inserts. Use an EXISTS with a subquery searching for a match.