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 = 9046 
ORDER BY 
  categories.is_trash asc, 
  categories.position asc, 
  category_descriptions.category asc

Query time 0.03879

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "1154.90"
    },
    "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` = 9046) 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": "12.56",
              "eval_cost": "3.39",
              "prefix_cost": "1154.90",
              "data_read_per_join": "154K"
            },
            "used_columns": [
              "category_id",
              "lang_code",
              "category"
            ]
          }
        }
      ]
    }
  }
}

Result

category_id parent_id id_path category position status company_id
20877 0 20877 Animals 0 A 9046
20878 20877 20877/20878 Arachnids 0 A 9046
20885 0 20885 Armed Forces 0 A 9046
20922 20921 20921/20922 Baskets 0 A 9046
20879 20877 20877/20879 Birds 0 A 9046
20886 0 20886 Camouflage 0 A 9046
20887 0 20887 Carbon Fiber 0 A 9046
20888 0 20888 Cartoons 0 A 9046
20890 0 20890 Colorful 0 A 9046
20889 0 20889 Constitutional 0 A 9046
20880 20877 20877/20880 Crustaceans 0 A 9046
20891 0 20891 Cultural 0 A 9046
20923 20921 20921/20923 Decorative 0 A 9046
20892 0 20892 Electrical 0 A 9046
20896 0 20896 Fabrics 0 A 9046
20881 20877 20877/20881 Fish 0 A 9046
20897 0 20897 Flags 0 A 9046
20924 20921 20921/20924 Flooring 0 A 9046
20898 0 20898 Flowers 0 A 9046
20899 0 20899 Food and Drink 0 A 9046
20900 0 20900 Games 0 A 9046
20893 0 20893 Geometric 0 A 9046
20901 0 20901 Guns 0 A 9046
20902 0 20902 Heros 0 A 9046
20903 0 20903 Holidays 0 A 9046
20882 20877 20877/20882 Insects 0 A 9046
20904 0 20904 Leather 0 A 9046
20883 20877 20877/20883 Mammals 0 A 9046
20905 0 20905 Medical Awareness 0 A 9046
20906 0 20906 Metal 0 A 9046
20907 0 20907 Mineral 0 A 9046
20895 0 20895 Miscellaneous 0 A 9046
20908 0 20908 Money 0 A 9046
20909 0 20909 Musical 0 A 9046
20910 0 20910 Mythical 0 A 9046
20925 20921 20921/20925 Other Wood 0 A 9046
20894 0 20894 Paintings 0 A 9046
20926 20921 20921/20926 Plywood 0 A 9046
20911 0 20911 Public Service 0 A 9046
20912 0 20912 Religious 0 A 9046
20884 20877 20877/20884 Reptiles 0 A 9046
20913 20906 20906/20913 Rusty Metal 0 A 9046
20914 0 20914 Sci Fi 0 A 9046
20915 0 20915 Skulls 0 A 9046
20916 0 20916 Sports 0 A 9046
20917 0 20917 Tartan 0 A 9046
20918 0 20918 Textures 0 A 9046
20919 0 20919 Tools 0 A 9046
20927 20921 20921/20927 Trees and Tree Bark 0 A 9046
20920 0 20920 Vehicles 0 A 9046
20921 0 20921 Wood 0 A 9046