SELECT 
  cscart_categories.category_id, 
  cscart_categories.parent_id, 
  cscart_categories.id_path, 
  cscart_category_descriptions.category, 
  cscart_categories.position, 
  cscart_categories.status, 
  cscart_categories.company_id, 
  cscart_categories.storefront_id, 
  cscart_seo_names.name as seo_name, 
  cscart_seo_names.path as seo_path 
FROM 
  cscart_categories 
  LEFT JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id 
  AND cscart_category_descriptions.lang_code = 'en' 
  LEFT JOIN cscart_seo_names ON cscart_seo_names.object_id = cscart_categories.category_id 
  AND cscart_seo_names.type = 'c' 
  AND cscart_seo_names.dispatch = '' 
  AND cscart_seo_names.lang_code = 'en' 
WHERE 
  1 = 1 
  AND (
    cscart_categories.usergroup_ids = '' 
    OR FIND_IN_SET(
      0, cscart_categories.usergroup_ids
    ) 
    OR FIND_IN_SET(
      1, cscart_categories.usergroup_ids
    )
  ) 
  AND cscart_categories.status IN ('A') 
  AND cscart_categories.parent_id IN (174) 
  AND cscart_categories.id_path LIKE '166/174/%' 
  AND cscart_categories.category_id != 264 
  AND cscart_categories.parent_id != 264 
  AND cscart_categories.storefront_id IN (0, 1) 
  AND cscart_categories.category_id IN(
    167, 165, 168, 169, 170, 171, 172, 166, 
    175, 176, 177, 178, 179, 180, 181, 182, 
    185, 186, 187, 188, 189, 174, 190, 191, 
    193, 194, 195, 196, 197, 198, 199, 200, 
    201, 202, 203, 204, 208, 209, 210, 211, 
    212, 213, 214, 215, 216, 217, 218, 219, 
    220, 221, 222, 223, 224, 225, 226, 227, 
    228, 229, 230, 231, 232, 234, 235, 236, 
    237, 238, 240, 241, 242, 243, 244, 245, 
    246, 247, 248, 249, 250, 251, 252, 253, 
    254, 263, 255
  ) 
ORDER BY 
  cscart_categories.is_trash asc, 
  cscart_categories.position asc, 
  cscart_category_descriptions.category asc

Query time 0.00140

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "6.37"
    },
    "ordering_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_categories",
            "access_type": "ref",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "parent",
              "id_path",
              "p_category_id"
            ],
            "key": "parent",
            "used_key_parts": [
              "parent_id"
            ],
            "key_length": "3",
            "ref": [
              "const"
            ],
            "rows_examined_per_scan": 5,
            "rows_produced_per_join": 0,
            "filtered": "1.02",
            "cost_info": {
              "read_cost": "5.00",
              "eval_cost": "0.01",
              "prefix_cost": "6.00",
              "data_read_per_join": "175"
            },
            "used_columns": [
              "category_id",
              "parent_id",
              "id_path",
              "company_id",
              "storefront_id",
              "usergroup_ids",
              "status",
              "position",
              "is_trash"
            ],
            "attached_condition": "(((`danishecarter_latest`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`danishecarter_latest`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`danishecarter_latest`.`cscart_categories`.`usergroup_ids`)) and (`danishecarter_latest`.`cscart_categories`.`status` = 'A') and (`danishecarter_latest`.`cscart_categories`.`id_path` like '166/174/%') and (`danishecarter_latest`.`cscart_categories`.`category_id` <> 264) and (`danishecarter_latest`.`cscart_categories`.`storefront_id` in (0,1)) and (`danishecarter_latest`.`cscart_categories`.`category_id` in (167,165,168,169,170,171,172,166,175,176,177,178,179,180,181,182,185,186,187,188,189,174,190,191,193,194,195,196,197,198,199,200,201,202,203,204,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,234,235,236,237,238,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,263,255)))"
          }
        },
        {
          "table": {
            "table_name": "cscart_category_descriptions",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id",
              "lang_code"
            ],
            "key_length": "9",
            "ref": [
              "danishecarter_latest.cscart_categories.category_id",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.05",
              "eval_cost": "0.01",
              "prefix_cost": "6.06",
              "data_read_per_join": "158"
            },
            "used_columns": [
              "category_id",
              "lang_code",
              "category"
            ]
          }
        },
        {
          "table": {
            "table_name": "cscart_seo_names",
            "access_type": "ref",
            "possible_keys": [
              "PRIMARY",
              "dispatch"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "object_id",
              "type",
              "dispatch",
              "lang_code"
            ],
            "key_length": "206",
            "ref": [
              "danishecarter_latest.cscart_categories.category_id",
              "const",
              "const",
              "const"
            ],
            "rows_examined_per_scan": 5,
            "rows_produced_per_join": 0,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.26",
              "eval_cost": "0.05",
              "prefix_cost": "6.37",
              "data_read_per_join": "442"
            },
            "used_columns": [
              "name",
              "object_id",
              "type",
              "dispatch",
              "path",
              "lang_code"
            ]
          }
        }
      ]
    }
  }
}

Result

category_id parent_id id_path category position status company_id storefront_id seo_name seo_path
190 174 166/174/190 LED TVs 10 A 0 0 led-tvs 166/174
191 174 166/174/191 Plasma TVs 20 A 0 0 plasma-tvs 166/174
193 174 166/174/193 3D TVs 30 A 0 0 3d-tvs 166/174
194 174 166/174/194 DVD & Blu-ray Players 40 A 0 0 dvd-and-blu-ray-players 166/174
195 174 166/174/195 Home Theater Systems 50 A 0 0 home-theater-systems 166/174