I've been wondering about this for quite some time. Is it better to do this where the primary key ticket_id is counted:
SELECT COUNT(ticket_id)
FROM tickets
WHERE ticket_country_id = 238
Or to do this:
SELECT COUNT(ticket_country_id)
FROM tickets
WHERE ticket_country_id = 238
In this case ticket_country_id is an indexed foreign key, but we could also assume it's just a non-indexed column (perhaps the answer would be different for non-indexed columns)
In other words, does it matter that I am calling on another column for the COUNT()?
Obviously the performance saving would probably be small, but I like to do things the best way.