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.01071

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "7.27"
    },
    "grouping_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "cost_info": {
        "sort_cost": "0.19"
      },
      "nested_loop": [
        {
          "table": {
            "table_name": "b",
            "access_type": "index",
            "possible_keys": [
              "thread_id",
              "thread_id_2"
            ],
            "key": "thread_id_2",
            "used_key_parts": [
              "thread_id",
              "status"
            ],
            "key_length": "6",
            "rows_examined_per_scan": 19,
            "rows_produced_per_join": 1,
            "filtered": "10.00",
            "using_index": true,
            "cost_info": {
              "read_cost": "4.42",
              "eval_cost": "0.38",
              "prefix_cost": "4.80",
              "data_read_per_join": "851"
            },
            "used_columns": [
              "post_id",
              "thread_id",
              "status"
            ],
            "attached_condition": "((`webmarco`.`b`.`status` = 'A') and (`webmarco`.`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": [
              "webmarco.b.thread_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "10.00",
            "cost_info": {
              "read_cost": "1.90",
              "eval_cost": "0.04",
              "prefix_cost": "7.08",
              "data_read_per_join": "4"
            },
            "used_columns": [
              "thread_id",
              "object_id",
              "object_type"
            ],
            "attached_condition": "(`webmarco`.`a`.`object_type` = 'M')"
          }
        }
      ]
    }
  }
}

Result

object_id total_items
41 1