Hi,
I have following query to counts pin and group based on their type but this query takes more than 500ms
SELECT COUNT(`pin_id`) AS total,`pin_type` FROM `pins` USE INDEX(user_pin USING GSI)
WHERE user_name='mustanish123' AND
`pin_type` IN ["atlas","review"] AND
`place_id`='MMI000' GROUP BY `pin_type`;
Above query uses following index
CREATE INDEX `user_pin` ON `pins`(`pin_type`,`user_name`)
What Index should be used to speed up this query. Thanks for the help