select count(xxx) where id='5' xxx column is INT type i have an index on id column doe's help or inimical if i add an index on xxx column?
You just need an index on id. The query as it sounds should be fast. If you have a very large table and are running the same query multiple times it may be better to cache the results of have an auto generated table that contains the counts.
if its possible, use a cron to save this information every hour or so into a seperate table. a SELECT statement from the new table will obviously be fast. if you want the information updated manually, just run the update script manually from an admin panel or something.