SELECT 
  category_id 
FROM 
  cscart_sg_user_activity_log 
WHERE 
  action = 'cat_view' 
  AND category_id > 0 
GROUP BY 
  category_id 
ORDER BY 
  COUNT(*) DESC 
LIMIT 
  10

Query time 0.00438

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost": 2.5899126,
    "filesort": {
      "sort_key": "count(0) desc",
      "temporary_table": {
        "nested_loop": [
          {
            "table": {
              "table_name": "cscart_sg_user_activity_log",
              "access_type": "ALL",
              "loops": 1,
              "rows": 15319,
              "cost": 2.5899126,
              "filtered": 100,
              "attached_condition": "cscart_sg_user_activity_log.`action` = 'cat_view' and cscart_sg_user_activity_log.category_id > 0"
            }
          }
        ]
      }
    }
  }
}

Result

category_id
501
166
460
454
304
287
289
288
305
456