SELECT 
  categories.category_id, 
  categories.parent_id, 
  categories.id_path, 
  category_descriptions.category, 
  categories.position, 
  categories.status, 
  categories.company_id, 
  categories.storefront_id, 
  seo_names.name as seo_name, 
  seo_names.path as seo_path, 
  category_descriptions.mega_m_category_banner_url, 
  category_descriptions.mega_m_category_svg_icon 
FROM 
  categories 
  LEFT JOIN category_descriptions ON categories.category_id = category_descriptions.category_id 
  AND category_descriptions.lang_code = 'en' 
  LEFT JOIN seo_names ON seo_names.object_id = categories.category_id 
  AND seo_names.type = 'c' 
  AND seo_names.dispatch = '' 
  AND seo_names.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.storefront_id IN (0, 1) 
  AND categories.deleted_at IS NULL 
  AND categories.category_id IN(
    3, 
    5, 
    22, 
    25, 
    27, 
    28, 
    8, 
    39, 
    42, 
    4, 
    45, 
    52, 
    62, 
    71, 
    73, 
    75, 
    76, 
    78, 
    87, 
    96, 
    97, 
    105, 
    106, 
    108, 
    109, 
    112, 
    114, 
    115, 
    116, 
    117, 
    118, 
    2, 
    16, 
    143, 
    178, 
    179, 
    183, 
    194, 
    46, 
    195, 
    205, 
    206, 
    208, 
    100, 
    210, 
    211, 
    228, 
    51, 
    250, 
    265, 
    266, 
    275, 
    21, 
    336, 
    2896, 
    2528, 
    2529, 
    2530, 
    2532, 
    2890, 
    2891, 
    2893, 
    2894, 
    2895, 
    2898, 
    2899, 
    2900, 
    2901, 
    2902, 
    2903, 
    2909, 
    2911, 
    2913, 
    2914, 
    2915, 
    2916, 
    2918, 
    2919, 
    2920, 
    2921, 
    2928, 
    2929, 
    2930, 
    2932, 
    2943, 
    2944, 
    2945, 
    2946, 
    2947, 
    2948, 
    2949, 
    2531, 
    2978, 
    2951, 
    2952, 
    2953, 
    2954, 
    2955, 
    2956, 
    2957, 
    2958, 
    2959, 
    2960, 
    2961, 
    2962, 
    2963, 
    2964, 
    2965, 
    2966, 
    2967, 
    2968, 
    2969, 
    2970, 
    2971, 
    2972, 
    2973, 
    2974, 
    2975, 
    2977, 
    2979, 
    2980, 
    2981, 
    2982, 
    2983, 
    2984, 
    2985, 
    2986, 
    2892, 
    2987, 
    2988, 
    2989, 
    2991, 
    2993, 
    2995, 
    3007, 
    3008, 
    3009, 
    3010, 
    3011, 
    3012, 
    3014, 
    3015, 
    3016, 
    3017, 
    3018, 
    6658, 
    92, 
    6672, 
    6790, 
    6792, 
    7760, 
    11369, 
    11372, 
    11373, 
    11374
  ) 
  AND categories.company_id = 7 
ORDER BY 
  categories.is_trash asc, 
  categories.position asc, 
  category_descriptions.category asc

Query time 0.00400

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "69.97"
    },
    "ordering_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "nested_loop": [
        {
          "table": {
            "table_name": "categories",
            "access_type": "range",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "p_category_id",
              "index_categories_on_deleted_at"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 155,
            "rows_produced_per_join": 0,
            "filtered": "0.03",
            "cost_info": {
              "read_cost": "69.90",
              "eval_cost": "0.01",
              "prefix_cost": "69.90",
              "data_read_per_join": "134"
            },
            "used_columns": [
              "category_id",
              "parent_id",
              "id_path",
              "company_id",
              "usergroup_ids",
              "status",
              "position",
              "is_trash",
              "deleted_at",
              "storefront_id"
            ],
            "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`.`storefront_id` in (0,1)) and (`goimagine`.`categories`.`deleted_at` is null) and (`goimagine`.`categories`.`category_id` in (3,5,22,25,27,28,8,39,42,4,45,52,62,71,73,75,76,78,87,96,97,105,106,108,109,112,114,115,116,117,118,2,16,143,178,179,183,194,46,195,205,206,208,100,210,211,228,51,250,265,266,275,21,336,2896,2528,2529,2530,2532,2890,2891,2893,2894,2895,2898,2899,2900,2901,2902,2903,2909,2911,2913,2914,2915,2916,2918,2919,2920,2921,2928,2929,2930,2932,2943,2944,2945,2946,2947,2948,2949,2531,2978,2951,2952,2953,2954,2955,2956,2957,2958,2959,2960,2961,2962,2963,2964,2965,2966,2967,2968,2969,2970,2971,2972,2973,2974,2975,2977,2979,2980,2981,2982,2983,2984,2985,2986,2892,2987,2988,2989,2991,2993,2995,3007,3008,3009,3010,3011,3012,3014,3015,3016,3017,3018,6658,92,6672,6790,6792,7760,11369,11372,11373,11374)))"
          }
        },
        {
          "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": 0,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.01",
              "eval_cost": "0.01",
              "prefix_cost": "69.92",
              "data_read_per_join": "232"
            },
            "used_columns": [
              "category_id",
              "lang_code",
              "category",
              "mega_m_category_banner_url",
              "mega_m_category_svg_icon"
            ]
          }
        },
        {
          "table": {
            "table_name": "seo_names",
            "access_type": "ref",
            "possible_keys": [
              "PRIMARY",
              "dispatch"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "object_id",
              "type",
              "dispatch",
              "lang_code"
            ],
            "key_length": "206",
            "ref": [
              "goimagine.categories.category_id",
              "const",
              "const",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.04",
              "eval_cost": "0.01",
              "prefix_cost": "69.97",
              "data_read_per_join": "86"
            },
            "used_columns": [
              "name",
              "object_id",
              "company_id",
              "type",
              "dispatch",
              "path",
              "lang_code"
            ]
          }
        }
      ]
    }
  }
}

Result

category_id parent_id id_path category position status company_id storefront_id seo_name seo_path mega_m_category_banner_url mega_m_category_svg_icon
2952 2948 2530/2948/2952 4-H / FFA 0 A 7 0 4-h-ffa 2530/2948
2977 2978 2531/2978/2977 4-H / FFA 0 A 7 0 4-h-ffa 2531/2978
3007 2918 2530/2918/3007 4th of July 0 A 7 0 4th-of-july 2530/2918
3008 2970 2531/2970/3008 4th of July 0 A 7 0 4th-of-july 2531/2970
2995 2899 2896/2899/2995 Anniversary 0 A 7 0 anniversary 2896/2899
2929 2928 2530/2928/2929 Autism 0 A 7 0 autism 2530/2928
2984 2983 2531/2983/2984 Autism 0 A 7 0 autism 2531/2983
3016 2978 2531/2978/3016 Birds 0 A 7 0 birds 2531/2978
3015 2948 2530/2948/3015 Birds 0 A 7 0 birds 2530/2948
2985 2983 2531/2983/2985 Cancer 0 A 7 0 cancer 2531/2983
2986 2928 2530/2928/2986 Cancer 0 A 7 0 cancer 2530/2928
2919 2918 2530/2918/2919 Christmas 0 A 7 0 christmas 2530/2918
2988 2892 2892/2988 Christmas 0 A 7 0 christmas 2892
2971 2970 2531/2970/2971 Christmas 0 A 7 0 christmas 2531/2970
3009 2948 2530/2948/3009 Dinosaurs 0 A 7 0 dinosaurs 2530/2948
3010 2978 2531/2978/3010 Dinosaurs 0 A 7 0 dinosaurs 2531/2978
2949 2948 2530/2948/2949 Dog & Cat 0 A 7 0 dog-and-cat 2530/2948
3011 2978 2531/2978/3011 Dogs & Cats 0 A 7 0 dogs-and-cats 2531/2978
3012 2918 2530/2918/3012 Easter 0 A 7 0 easter 2530/2918
3014 2970 2531/2970/3014 Easter 0 A 7 0 easter 2531/2970
2947 2945 2530/2945/2947 Graduation 0 A 7 0 graduation 2530/2945
2982 2980 2531/2980/2982 Graduation 0 A 7 0 graduation 2531/2980
11373 11369 11369/11373 Half Moon Place Cards 0 A 7 0 arch-half-moon-place-cards 11369
2973 2970 2531/2970/2973 Halloween 0 A 7 0 halloween 2531/2970
2920 2918 2530/2918/2920 Halloween 0 A 7 0 halloween 2530/2918
11372 11369 11369/11372 Hexagon Place Cards 0 A 7 0 hexagon-place-cards 11369
2951 2978 2531/2978/2951 Memorial 0 A 7 0 memorial 2531/2978
2987 2892 2892/2987 Party 0 A 7 0 party 2892
11374 11369 11369/11374 Rectangle Place Cards 0 A 7 0 rectangle-place-cards 11369
2930 2928 2530/2928/2930 Suicide Prevention 0 A 7 0 suicide-prevention 2530/2928
2981 2980 2531/2980/2981 Teacher 0 A 7 0 teacher 2531/2980
2946 2945 2530/2945/2946 Teacher 0 A 7 0 teacher 2530/2945
2898 2890 2896/2890/2898 Teacher Appreciation 0 A 7 0 teacher-appreciation 2896/2890
2921 2918 2530/2918/2921 Thanksgiving 0 A 7 0 thanksgiving 2530/2918
2972 2970 2531/2970/2972 Thanksgiving 0 A 7 0 thanksgiving 2531/2970
11369 0 11369 The Acrylic Sign Collection 0 A 7 0 the-acrylic-wedding-collection
2989 2892 2892/2989 Wedding 0 A 7 0 wedding 2892
3017 2978 2531/2978/3017 Wildlife 0 A 7 0 wildlife 2531/2978
3018 2948 2530/2948/3018 Wildlife 0 A 7 0 wildlife 2530/2948
2529 2896 2896/2529 Photo Holders 1 A 7 0 photo-holders 2896
7760 0 7760 Acrylic Ornaments & Keychains 1 A 7 0 acrylic-ornaments-and-keychains
2901 2899 2896/2899/2901 Baby Shower 1 A 7 0 baby-shower 2896/2899
2894 2893 2896/2893/2894 Engagement 1 A 7 0 engagement 2896/2893
2909 2530 2530/2909 Personalized Names & Designs 1 A 7 0 personalized-names-and-designs 2530
2963 2531 2531/2963 Personalized Names & Designs 1 A 7 0 personalized-names-and-designs 2531
2900 2899 2896/2899/2900 Birthday 2 A 7 0 birthday 2896/2899
2528 2896 2896/2528 Christmas Ornaments 2 A 7 0 ornaments-en-5 2896
2964 2531 2531/2964 Monograms 2 A 7 0 monograms 2531
2911 2530 2530/2911 Monograms 2 A 7 0 monograms 2530
2895 2893 2896/2893/2895 Reception Decor 2 A 7 0 reception-decor 2896/2893
2896 0 2896 Scrabble Gifts & Decor 2 A 7 0 scrabble-gifts-and-decor
2913 2530 2530/2913 Family Names 3 A 7 0 family-names 2530
2965 2531 2531/2965 Family Names 3 A 7 0 family-names 2531
2530 0 2530 Iron On Decals 3 A 7 0 iron-on-decals
2890 2896 2896/2890 School 3 A 7 0 school-and-teacher 2896
2531 0 2531 RTA Decals 4 A 7 0 rta-decals
2914 2530 2530/2914 Team Aunt & Uncle 4 A 7 0 team-aunt-and-uncle 2530
2966 2531 2531/2966 Team Aunt & Uncle 4 A 7 0 team-aunt-and-uncle 2531
2893 2896 2896/2893 Wedding 4 A 7 0 wedding-en-2 2896
2532 2530 2530/2532 Baby Reveal 5 A 7 0 baby-reveal-iron-on-decals 2530
2899 2896 2896/2899 Celebrations 5 A 7 0 celebrations 2896
2892 0 2892 Instant Download - Printables 5 A 7 0 instant-download-printables
2968 2531 2531/2968 Wedding 5 A 7 0 wedding 2531
2970 2531 2531/2970 Holidays 6 A 7 0 holidays 2531
2902 2896 2896/2902 Magnet & Push Pins 6 A 7 0 magnet-and-push-pins 2896
2932 2530 2530/2932 Wedding 6 A 7 0 wedding 2530
2891 2890 2896/2890/2891 Graduation 7 A 7 0 graduation-en-2 2896/2890
2956 2531 2531/2956 Home Organization & Decor 7 A 7 0 home-organization-and-decor 2531
2944 2530 2530/2944 Mom Life 7 A 7 0 mom-life 2530
2991 2896 2896/2991 Wine Charms 7 A 7 0 wine-charms 2896
2974 2531 2531/2974 Healthcare 8 A 7 0 hospital-nurse 2531
2918 2530 2530/2918 Holidays 8 A 7 0 holidays 2530
2967 2531 2531/2967 Christian - Bible Verses 9 A 7 0 christian-bible-verses 2531
2916 2530 2530/2916 Healthcare 9 A 7 0 hospital-nurse 2530
2903 2896 2896/2903 Supplies - DIY Ornaments 9 A 7 0 supplies-diy-ornaments 2896
2978 2531 2531/2978 Animal 10 A 7 0 animal 2531
2915 2530 2530/2915 Christian - Bible Verses 10 A 7 0 christian-bible-verses 2530
2948 2530 2530/2948 Animal 11 A 7 0 animal 2530
2962 2531 2531/2962 Home States 11 A 7 0 home-states 2531
2928 2530 2530/2928 Awareness 12 A 7 0 awareness 2530
2957 2531 2531/2957 Bunco 12 A 7 0 bunco 2531
2943 2530 2530/2943 Baby 13 A 7 0 baby 2530
2975 2531 2531/2975 Military/Law Enforcement 13 A 7 0 his-life-saved-mine-shirt-decal 2531
2969 2531 2531/2969 Mom Life 14 A 7 0 mom-life 2531
2953 2530 2530/2953 Sports/Gym/Music 15 A 7 0 sports-gym-music 2530
2960 2531 2531/2960 Strong Women 15 A 7 0 strong-women 2531
2980 2531 2531/2980 School 16 A 7 0 school 2531
2945 2530 2530/2945 School 16 A 7 0 school 2530
2983 2531 2531/2983 Awareness 17 A 7 0 awareness 2531
2954 2530 2530/2954 Military/Law Enforcement 17 A 7 0 military-police 2530
2961 2530 2530/2961 Home States 18 A 7 0 home-states 2530
2955 2531 2531/2955 Office / Business 18 A 7 0 office-business 2531
2979 2531 2531/2979 Sports/Gym/Music 19 A 7 0 sports-gym-music 2531
2959 2530 2530/2959 Strong Women 19 A 7 0 strong-women 2530
2958 2530 2530/2958 Bunco 20 A 7 0 bunco 2530
2993 2530 2530/2993 Heartbeat 21 A 7 0 heartbeat 2530