I want to retrieve phone_num and their count of unread message for each phone number from the table user_message. Below mentioned query takes 10 seconds to give result which is super duper slow for me.
Extra Info of table:
- I have Indexed Column phone_num and user_message_id
Count(phone_num) AS no_of_messages
WHERE user_message_id = "rd62tdw4n3"
AND msg_status = "unread"
GROUP BY phone_num