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

Query time 0.04546

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` = 7) 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
2952 2948 2530/2948/2952 4-H / FFA 0 A 7
2977 2978 2531/2978/2977 4-H / FFA 0 A 7
3007 2918 2530/2918/3007 4th of July 0 A 7
3008 2970 2531/2970/3008 4th of July 0 A 7
2995 2899 2896/2899/2995 Anniversary 0 A 7
2929 2928 2530/2928/2929 Autism 0 A 7
2984 2983 2531/2983/2984 Autism 0 A 7
3015 2948 2530/2948/3015 Birds 0 A 7
3016 2978 2531/2978/3016 Birds 0 A 7
2922 2918 2530/2918/2922 Black Friday 0 A 7
2985 2983 2531/2983/2985 Cancer 0 A 7
2986 2928 2530/2928/2986 Cancer 0 A 7
2919 2918 2530/2918/2919 Christmas 0 A 7
2971 2970 2531/2970/2971 Christmas 0 A 7
2988 2892 2892/2988 Christmas 0 A 7
3009 2948 2530/2948/3009 Dinosaurs 0 A 7
3010 2978 2531/2978/3010 Dinosaurs 0 A 7
2949 2948 2530/2948/2949 Dog & Cat 0 A 7
3011 2978 2531/2978/3011 Dogs & Cats 0 A 7
3012 2918 2530/2918/3012 Easter 0 A 7
3014 2970 2531/2970/3014 Easter 0 A 7
2947 2945 2530/2945/2947 Graduation 0 A 7
2982 2980 2531/2980/2982 Graduation 0 A 7
2990 2892 2892/2990 Graduation 0 A 7
11373 11369 11369/11373 Half Moon Place Cards 0 A 7
2920 2918 2530/2918/2920 Halloween 0 A 7
2973 2970 2531/2970/2973 Halloween 0 A 7
11372 11369 11369/11372 Hexagon Place Cards 0 A 7
2951 2978 2531/2978/2951 Memorial 0 A 7
2987 2892 2892/2987 Party 0 A 7
11374 11369 11369/11374 Rectangle Place Cards 0 A 7
2950 2948 2530/2948/2950 Sloth 0 A 7
2930 2928 2530/2928/2930 Suicide Prevention 0 A 7
2946 2945 2530/2945/2946 Teacher 0 A 7
2981 2980 2531/2980/2981 Teacher 0 A 7
2898 2890 2896/2890/2898 Teacher Appreciation 0 A 7
2921 2918 2530/2918/2921 Thanksgiving 0 A 7
2972 2970 2531/2970/2972 Thanksgiving 0 A 7
11369 0 11369 The Acrylic Sign Collection 0 A 7
2927 2918 2530/2918/2927 Valentine's Day 0 A 7
2989 2892 2892/2989 Wedding 0 A 7
3017 2978 2531/2978/3017 Wildlife 0 A 7
3018 2948 2530/2948/3018 Wildlife 0 A 7
2529 2896 2896/2529 Photo Holders 1 A 7
7760 0 7760 Acrylic Ornaments & Keychains 1 A 7
2901 2899 2896/2899/2901 Baby Shower 1 A 7
2894 2893 2896/2893/2894 Engagement 1 A 7
2909 2530 2530/2909 Personalized Names & Designs 1 A 7
2963 2531 2531/2963 Personalized Names & Designs 1 A 7
2900 2899 2896/2899/2900 Birthday 2 A 7
2528 2896 2896/2528 Christmas Ornaments 2 A 7
2911 2530 2530/2911 Monograms 2 A 7
2964 2531 2531/2964 Monograms 2 A 7
2895 2893 2896/2893/2895 Reception Decor 2 A 7
2896 0 2896 Scrabble Gifts & Decor 2 A 7
2913 2530 2530/2913 Family Names 3 A 7
2965 2531 2531/2965 Family Names 3 A 7
2530 0 2530 Iron On Decals 3 A 7
2890 2896 2896/2890 School 3 A 7
2531 0 2531 RTA Decals 4 A 7
2914 2530 2530/2914 Team Aunt & Uncle 4 A 7
2966 2531 2531/2966 Team Aunt & Uncle 4 A 7
2893 2896 2896/2893 Wedding 4 A 7
2532 2530 2530/2532 Baby Reveal 5 A 7
2899 2896 2896/2899 Celebrations 5 A 7
2892 0 2892 Instant Download - Printables 5 A 7
2968 2531 2531/2968 Wedding 5 A 7
2970 2531 2531/2970 Holidays 6 A 7
2902 2896 2896/2902 Magnet & Push Pins 6 A 7
2932 2530 2530/2932 Wedding 6 A 7
2891 2890 2896/2890/2891 Graduation 7 A 7
2956 2531 2531/2956 Home Organization & Decor 7 A 7
2944 2530 2530/2944 Mom Life 7 A 7
2991 2896 2896/2991 Wine Charms 7 A 7
2992 2896 2896/2992 Baby Shower 8 A 7
2974 2531 2531/2974 Healthcare 8 A 7
2918 2530 2530/2918 Holidays 8 A 7
2967 2531 2531/2967 Christian - Bible Verses 9 A 7
2916 2530 2530/2916 Healthcare 9 A 7
2903 2896 2896/2903 Supplies - DIY Ornaments 9 A 7
2978 2531 2531/2978 Animal 10 A 7
2915 2530 2530/2915 Christian - Bible Verses 10 A 7
2904 2896 2896/2904 Wholesale 10 A 7
2948 2530 2530/2948 Animal 11 A 7
2962 2531 2531/2962 Home States 11 A 7
2928 2530 2530/2928 Awareness 12 A 7
2957 2531 2531/2957 Bunco 12 A 7
2943 2530 2530/2943 Baby 13 A 7
2975 2531 2531/2975 Military/Law Enforcement 13 A 7
2917 2530 2530/2917 Hair Stylist 14 A 7
2969 2531 2531/2969 Mom Life 14 A 7
2953 2530 2530/2953 Sports/Gym/Music 15 A 7
2960 2531 2531/2960 Strong Women 15 A 7
2945 2530 2530/2945 School 16 A 7
2980 2531 2531/2980 School 16 A 7
2983 2531 2531/2983 Awareness 17 A 7
2954 2530 2530/2954 Military/Law Enforcement 17 A 7
2961 2530 2530/2961 Home States 18 A 7
2955 2531 2531/2955 Office / Business 18 A 7
2979 2531 2531/2979 Sports/Gym/Music 19 A 7
2959 2530 2530/2959 Strong Women 19 A 7
2958 2530 2530/2958 Bunco 20 A 7
2994 2531 2531/2994 Heartbeat 20 A 7
2993 2530 2530/2993 Heartbeat 21 A 7