SELECT 
  categories.category_id, 
  categories.parent_id, 
  categories.id_path, 
  category_descriptions.category, 
  categories.position, 
  categories.status, 
  categories.company_id 
FROM 
  categories 
  LEFT JOIN category_descriptions ON categories.category_id = category_descriptions.category_id 
  AND category_descriptions.lang_code = 'en' 
WHERE 
  1 = 1 
  AND (
    categories.usergroup_ids = '' 
    OR FIND_IN_SET(0, categories.usergroup_ids) 
    OR FIND_IN_SET(1, categories.usergroup_ids)
  ) 
  AND categories.status IN ('A') 
  AND categories.level <= 3 
  AND categories.deleted_at IS NULL 
  AND categories.company_id = 39 
ORDER BY 
  categories.is_trash asc, 
  categories.position asc, 
  category_descriptions.category asc

Query time 0.04992

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "1151.51"
    },
    "ordering_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "nested_loop": [
        {
          "table": {
            "table_name": "categories",
            "access_type": "ref",
            "possible_keys": [
              "c_status",
              "index_categories_on_deleted_at"
            ],
            "key": "index_categories_on_deleted_at",
            "used_key_parts": [
              "deleted_at"
            ],
            "key_length": "6",
            "ref": [
              "const"
            ],
            "rows_examined_per_scan": 10182,
            "rows_produced_per_join": 33,
            "filtered": "0.33",
            "index_condition": "(`goimagine`.`categories`.`deleted_at` is null)",
            "cost_info": {
              "read_cost": "120.75",
              "eval_cost": "3.39",
              "prefix_cost": "1138.95",
              "data_read_per_join": "88K"
            },
            "used_columns": [
              "category_id",
              "parent_id",
              "id_path",
              "level",
              "company_id",
              "usergroup_ids",
              "status",
              "position",
              "is_trash",
              "deleted_at"
            ],
            "attached_condition": "((`goimagine`.`categories`.`company_id` = 39) and ((`goimagine`.`categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`goimagine`.`categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`goimagine`.`categories`.`usergroup_ids`))) and (`goimagine`.`categories`.`status` = 'A') and (`goimagine`.`categories`.`level` <= 3))"
          }
        },
        {
          "table": {
            "table_name": "category_descriptions",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id",
              "lang_code"
            ],
            "key_length": "9",
            "ref": [
              "goimagine.categories.category_id",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 33,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "9.16",
              "eval_cost": "3.39",
              "prefix_cost": "1151.51",
              "data_read_per_join": "154K"
            },
            "used_columns": [
              "category_id",
              "lang_code",
              "category"
            ]
          }
        }
      ]
    }
  }
}

Result

category_id parent_id id_path category position status company_id
2013 0 2013 All Products 0 A 39
1948 0 1948 Angels, Spiritual, Religious 0 A 39
1949 0 1949 Animals, Birds, Insects 0 A 39
1950 0 1950 Art Themed 0 A 39
1951 0 1951 Beach Decor, Nautical 0 A 39
1968 0 1968 Country, Rustic 0 A 39
1952 0 1952 Fantasy 0 A 39
1953 0 1953 Floral, Trees, Leaves 0 A 39
1954 0 1954 Food 0 A 39
1955 0 1955 Gingham, Paisley, Check, Plaid, Stripes 0 A 39
1956 0 1956 Gothic 0 A 39
1957 0 1957 Groovy, Retro, Colorful 0 A 39
1958 0 1958 Holidays 0 A 39
1959 0 1959 Kids Room 0 A 39
1960 0 1960 Kitchen Theme 0 A 39
1961 0 1961 Mandala 0 A 39
1962 0 1962 Manly Design 0 A 39
1963 0 1963 Misc 0 A 39
1976 0 1976 Mousepads 0 A 39
1964 0 1964 Music, Musical 0 A 39
1965 0 1965 Nature 0 A 39
1966 0 1966 Ornamental 0 A 39
1967 0 1967 Places to See, Point of interest 0 A 39
1969 0 1969 Sewing, Crafts 0 A 39
1970 0 1970 Southwest 0 A 39
1971 0 1971 Space 0 A 39
1972 0 1972 Steampunk 0 A 39
1973 0 1973 Transportation 0 A 39
1974 0 1974 Watercolor 0 A 39
1975 0 1975 Wine, Beer, Winery 0 A 39