As below code, I set chat_id and student_id as primary key so that the same chat will be added for another student_id. When it goes to production, the record will be a lot. Should I add one more index for student_id only so that the search will be faster for every user when they come back to the screen to see recently messages?
CREATE TABLE `tim_chat_recipients` (
`chat_id` INT(11) NOT NULL,
`student_id` INT(11) NOT NULL,
`message_status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '1:New, 2:Read, 3:Deleted',
PRIMARY KEY (`chat_id`, `student_id`))COLLATE='latin1_swedish_ci' ENGINE=InnoDB;