SELECT 
  a.object_id, 
  COUNT(b.post_id) as total_items 
FROM 
  cscart_discussion as a 
  LEFT JOIN cscart_discussion_posts as b ON a.thread_id = b.thread_id 
WHERE 
  a.object_type = 'M' 
  AND b.status = 'A' 
GROUP BY 
  a.object_id

Query time 0.00178

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "1.67"
    },
    "grouping_operation": {
      "using_temporary_table": true,
      "using_filesort": false,
      "nested_loop": [
        {
          "table": {
            "table_name": "b",
            "access_type": "ALL",
            "possible_keys": [
              "thread_id",
              "thread_id_2"
            ],
            "rows_examined_per_scan": 8,
            "rows_produced_per_join": 1,
            "filtered": "12.50",
            "cost_info": {
              "read_cost": "1.22",
              "eval_cost": "0.10",
              "prefix_cost": "1.32",
              "data_read_per_join": "448"
            },
            "used_columns": [
              "post_id",
              "thread_id",
              "status"
            ],
            "attached_condition": "((`s2cart`.`b`.`status` = 'A') and (`s2cart`.`b`.`thread_id` is not null))"
          }
        },
        {
          "table": {
            "table_name": "a",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY",
              "object_id"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "thread_id"
            ],
            "key_length": "3",
            "ref": [
              "s2cart.b.thread_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "10.00",
            "cost_info": {
              "read_cost": "0.25",
              "eval_cost": "0.01",
              "prefix_cost": "1.67",
              "data_read_per_join": "2"
            },
            "used_columns": [
              "thread_id",
              "object_id",
              "object_type"
            ],
            "attached_condition": "(`s2cart`.`a`.`object_type` = 'M')"
          }
        }
      ]
    }
  }
}