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.level <= 3 
  AND cscart_categories.storefront_id IN (0, 1) 
  AND cscart_categories.category_id IN(
    266, 
    356, 
    393, 
    1516, 
    1936, 
    2601, 
    2653, 
    2760, 
    2851, 
    2910, 
    2912, 
    2917, 
    2985, 
    2944, 
    3002, 
    3048, 
    3046, 
    3060, 
    2916, 
    3087, 
    3080, 
    3085, 
    3095, 
    3144, 
    3185, 
    3105, 
    3224, 
    3228, 
    3231, 
    3390, 
    3407, 
    3487, 
    3532, 
    3591, 
    3631, 
    3535, 
    3617, 
    3933, 
    4001, 
    4254, 
    4003, 
    4525, 
    4693, 
    5264, 
    4299, 
    4271, 
    4313, 
    4317, 
    4257, 
    4418, 
    4321, 
    4564, 
    4575, 
    4551, 
    4746, 
    4334, 
    4903, 
    4787, 
    4973, 
    5014, 
    5030, 
    5039, 
    3648, 
    3685, 
    5152, 
    4805, 
    5098, 
    5164, 
    4933, 
    5256, 
    5270, 
    5372, 
    5495, 
    5506, 
    5511, 
    5519, 
    5522, 
    4808, 
    5597, 
    5742, 
    5821, 
    4431, 
    5968, 
    5457, 
    6343, 
    6426, 
    6288, 
    6448, 
    2920, 
    3741, 
    6579, 
    6473, 
    6809, 
    6870, 
    6897, 
    6928, 
    6975, 
    5362, 
    6980, 
    7008, 
    5847, 
    7022, 
    7093, 
    7217, 
    7135, 
    7242, 
    7301, 
    7454, 
    7464, 
    7797, 
    7849, 
    7080, 
    7435, 
    8229, 
    5684, 
    6536, 
    8356, 
    8362, 
    8440, 
    5577, 
    8784, 
    8817, 
    8823, 
    6328, 
    6340, 
    6471, 
    9052, 
    9053, 
    9289, 
    2954, 
    9386, 
    4910, 
    9434, 
    9435, 
    4701, 
    9662, 
    9697, 
    9720, 
    9997, 
    10041, 
    10260, 
    10269, 
    10300, 
    10265, 
    10334, 
    10335, 
    10336, 
    10437, 
    10438
  ) 
ORDER BY 
  cscart_categories.is_trash asc, 
  cscart_categories.position asc, 
  cscart_category_descriptions.category asc

Query time 0.00782

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "211.64"
    },
    "ordering_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_categories",
            "access_type": "range",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "p_category_id"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "category_id"
            ],
            "key_length": "3",
            "rows_examined_per_scan": 149,
            "rows_produced_per_join": 0,
            "filtered": "0.67",
            "cost_info": {
              "read_cost": "209.06",
              "eval_cost": "0.20",
              "prefix_cost": "209.26",
              "data_read_per_join": "5K"
            },
            "used_columns": [
              "category_id",
              "parent_id",
              "id_path",
              "level",
              "company_id",
              "usergroup_ids",
              "status",
              "position",
              "is_trash",
              "storefront_id"
            ],
            "attached_condition": "(((`webmarco`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`webmarco`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`webmarco`.`cscart_categories`.`usergroup_ids`)) and (`webmarco`.`cscart_categories`.`status` = 'A') and (`webmarco`.`cscart_categories`.`level` <= 3) and (`webmarco`.`cscart_categories`.`storefront_id` in (0,1)) and (`webmarco`.`cscart_categories`.`category_id` in (266,356,393,1516,1936,2601,2653,2760,2851,2910,2912,2917,2985,2944,3002,3048,3046,3060,2916,3087,3080,3085,3095,3144,3185,3105,3224,3228,3231,3390,3407,3487,3532,3591,3631,3535,3617,3933,4001,4254,4003,4525,4693,5264,4299,4271,4313,4317,4257,4418,4321,4564,4575,4551,4746,4334,4903,4787,4973,5014,5030,5039,3648,3685,5152,4805,5098,5164,4933,5256,5270,5372,5495,5506,5511,5519,5522,4808,5597,5742,5821,4431,5968,5457,6343,6426,6288,6448,2920,3741,6579,6473,6809,6870,6897,6928,6975,5362,6980,7008,5847,7022,7093,7217,7135,7242,7301,7454,7464,7797,7849,7080,7435,8229,5684,6536,8356,8362,8440,5577,8784,8817,8823,6328,6340,6471,9052,9053,9289,2954,9386,4910,9434,9435,4701,9662,9697,9720,9997,10041,10260,10269,10300,10265,10334,10335,10336,10437,10438)))"
          }
        },
        {
          "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": [
              "webmarco.cscart_categories.category_id",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.99",
              "eval_cost": "0.20",
              "prefix_cost": "210.45",
              "data_read_per_join": "4K"
            },
            "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": [
              "webmarco.cscart_categories.category_id",
              "const",
              "const",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 0,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.99",
              "eval_cost": "0.20",
              "prefix_cost": "211.65",
              "data_read_per_join": "1K"
            },
            "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
10300 10260 10260/10300 Lawn & Garden 0 A 0 0 lawn-and-garden 10260
4805 4271 4271/4805 Audio 0 A 0 0 audio 4271
4808 4254 4001/4254/4808 Biometric Monitor Accessories 0 A 0 0 biometric-monitor-accessories 4001/4254
4431 4254 4001/4254/4431 Biometric Monitors 0 A 0 0 biometric-monitors 4001/4254
10438 10437 6328/10437/10438 Cars 0 A 0 0 cars 6328/10437
4313 4271 4271/4313 Circuit Boards & Components 0 A 0 0 circuit-boards-and-components 4271
3087 2916 2910/2916/3087 Clocks 0 A 0 0 clocks 2910/2916
4321 4271 4271/4321 Communications 0 A 0 0 communications 4271
4525 4003 4001/4003/4525 Cosmetics 0 A 0 0 cosmetics 4001/4003
2916 2910 2910/2916 Decor 0 A 0 0 decor 2910
10334 10265 10265/10334 Exercise & Fitness 0 A 0 0 exercise-and-fitness 10265
2944 2910 2910/2944 Fireplace & Wood Stove Accessories 0 A 0 0 fireplace-and-wood-stove-accessories 2910
4334 4003 4001/4003/4334 Hair Care 0 A 0 0 hair-care 4001/4003
6809 6473 6473/6809 Heating, Ventilation & Air Conditioning 0 A 0 0 heating-ventilation-and-air-conditioning 6473
5495 5372 5372/5495 Hobbies & Creative Arts 0 A 0 0 hobbies-and-creative-arts-en 5372
356 266 266/356 Home & Office 0 A 0 0 home-and-office-en 266
3080 2910 2910/3080 Household Appliance Accessories 0 A 0 0 household-appliance-accessories 2910
2912 2910 2910/2912 Household Appliances 0 A 0 0 household-appliances 2910
3105 2910 2910/3105 Household Supplies 0 A 0 0 household-supplies 2910
2760 2653 2653/2760 Jewelry 0 A 0 0 jewelry 2653
2920 2910 2910/2920 Kitchen & Dining 0 A 0 0 kitchen-and-dining 2910
3741 2920 2910/2920/3741 Kitchen Tools & Utensils 0 A 0 0 kitchen-tools-and-utensils 2910/2920
7435 7080 6473/7080/7435 Measuring Tools & Sensors 0 A 0 0 measuring-tools-and-sensors-en 6473/7080
3224 3105 2910/3105/3224 Moisture Absorbers 0 A 0 0 moisture-absorbers 2910/3105
7135 6473 6473/7135 Plumbing 0 A 0 0 plumbing-en 6473
266 0 266 Services 0 A 0 0 services-en
4257 4003 4001/4003/4257 Shaving & Grooming 0 A 0 0 shaving-and-grooming 4001/4003
3228 3105 2910/3105/3228 Storage & Organization 0 A 0 0 storage-and-organization 2910/3105
4564 4321 4271/4321/4564 Telephony 0 A 0 0 telephony 4271/4321
10437 6328 6328/10437 Tires 0 A 0 0 tires-en 6328
7080 6473 6473/7080 Tools 0 A 0 0 tools-en 6473
4787 4271 4271/4787 Video 0 A 0 0 video 4271
4973 4787 4271/4787/4973 Video Players & Recorders 0 A 0 0 video-players-and-recorders 4271/4787
3231 3105 2910/3105/3231 Waste Containment Accessories 0 A 0 0 waste-containment-accessories 2910/3105
10335 10334 10265/10334/10335 Weight Lifting 0 A 0 0 weight-lifting 10265/10334
3002 2944 2910/2944/3002 Wood Stove Fans & Blowers 0 A 0 0 wood-stove-fans-and-blowers 2910/2944
3631 3591 3532/3591/3631 Cigarettes 10 A 0 0 cigarettes 3532/3591
4317 4313 4271/4313/4317 Circuit Prototyping 10 A 0 0 circuit-board-accessories 4271/4313
6975 6928 6288/6928/6975 Activity Toys 10 A 0 0 activity-toys 6288/6928
3085 3080 2910/3080/3085 Air Conditioner Accessories 10 A 0 0 air-conditioner-accessories 2910/3080
2653 0 2653 Apparel & Accessories 10 A 0 0 apparel-and-accessories
2917 2912 2910/2912/2917 Climate Control Appliances 10 A 0 0 climate-control-appliances 2910/2912
5506 5495 5372/5495/5506 Collectibles 10 A 0 0 collectibles 5372/5495
3535 3532 3532/3535 Food Items 10 A 0 0 food-items 3532
6426 6343 5457/6343/6426 Moving & Shipping Boxes 10 A 0 0 moving-and-shipping-boxes 5457/6343
4003 4001 4001/4003 Personal Care 10 A 0 0 personal-care 4001
6340 6328 6328/6340 Vehicle Parts & Accessories 10 A 0 0 vehicle-parts-and-accessories 6328
4910 4805 4271/4805/4910 Audio Accessories 20 A 0 0 audio-accessories 4271/4805
7008 6980 5362/6980/7008 Baby Activity Toys 20 A 0 0 baby-activity-toys 5362/6980
7464 7454 5362/7454/7464 Baby Carrier Accessories 20 A 0 0 baby-carrier-accessories 5362/7454
5821 5742 5742/5821 Cameras 20 A 0 0 cameras 5742
393 356 266/356/393 Cleaning Services 20 A 0 0 cleaning-services 266/356
6448 6288 6288/6448 Games 20 A 0 0 games 6288
4001 0 4001 Health & Beauty 20 A 0 0 health-and-beauty
4254 4001 4001/4254 Health Care 20 A 0 0 health-care 4001
5522 2910 2910/5522 Lighting Accessories 20 A 0 0 lighting-accessories 2910
6536 5684 5684/6536 Outdoor Recreation 20 A 0 0 outdoor-recreation 5684
6471 6340 6328/6340/6471 Vehicle Safety & Security 20 A 0 0 vehicle-safety-and-security 6328/6340
5362 0 5362 Baby & Toddler 25 A 0 0 baby-and-toddler
3591 3532 3532/3591 Tobacco Products 30 A 0 0 tobacco-products 3532
5577 5495 5372/5495/5577 Arts & Crafts 30 A 0 0 arts-and-crafts 5372/5495
5098 4805 4271/4805/5098 Audio Players & Recorders 30 A 0 0 audio-players-and-recorders 4271/4805
3532 0 3532 Food, Beverages & Tobacco 30 A 0 0 food-beverages-and-tobacco
6870 6809 6473/6809/6870 HVAC Controls 40 A 0 0 hvac-controls-en 6473/6809
3144 3080 2910/3080/3144 Fan Accessories 40 A 0 0 fan-accessories 2910/3080
2910 0 2910 Home & Garden 40 A 0 0 home-and-garden
7242 7135 6473/7135/7242 Water Dispensing & Filtration 40 A 0 0 water-dispensing-and-filtration-en 6473/7135
5152 3685 3648/3685/5152 Outdoor Storage Boxes 50 A 0 0 outdoor-storage-boxes 3648/3685
6980 5362 5362/6980 Baby Toys & Activity Equipment 50 A 0 0 baby-toys-and-activity-equipment 5362
3648 0 3648 Furniture 50 A 0 0 furniture
9720 9697 9697/9720 Mobile Phone Accessories 50 A 0 0 mobile-phone-accessories 9697
5372 0 5372 Arts & Entertainment 60 A 0 0 arts-and-entertainment-en
1936 266 266/1936 Economy & Finance Services 60 A 0 0 economy-and-finance-services 266
5457 0 5457 Office Supplies 60 A 0 0 office-supplies-en
7454 5362 5362/7454 Baby Transport Accessories 70 A 0 0 baby-transport-accessories 5362
3046 2912 2910/2912/3046 Laundry Appliances 80 A 0 0 laundry-appliances-en 2910/2912
3185 3080 2910/3080/3185 Humidifier Accessories 80 A 0 0 humidifier-accessories 2910/3080
3617 3535 3532/3535/3617 Snack Foods 80 A 0 0 snack-foods 3532/3535
5684 0 5684 Sporting Goods 80 A 0 0 sporting-goods
6288 0 6288 Toys & Games 90 A 0 0 toys-and-games
3048 2912 2910/2912/3048 Vacuums 100 A 0 0 vacuums-en 2910/2912
5847 5495 5372/5495/5847 Musical Instrument & Orchestra Accessories 100 A 0 0 musical-instrument-and-orchestra-accessories-en 5372/5495
4271 0 4271 Electronics 110 A 0 0 electronics-en
2601 1936 266/1936/2601 Payments and Telephone Top-ups 110 A 0 0 payments-and-telephone-top-ups-en 266/1936
6328 0 6328 Vehicles & Parts 120 A 0 0 vehicles-and-parts
6473 0 6473 Hardware 130 A 0 0 hardware
5742 0 5742 Cameras & Optics 140 A 0 0 cameras-and-optics
5030 4313 4271/4313/5030 Printed Circuit Boards 140 A 0 0 printed-circuit-boards-en 4271/4313
6343 5457 5457/6343 Shipping Supplies 160 A 0 0 shipping-supplies 5457
9697 0 9697 All Categories 190 A 0 0 all-categories-en
7797 6928 6288/6928/7797 Play Vehicles 190 A 0 0 play-vehicles 6288/6928
8356 6536 5684/6536/8356 Boating & Water Sports 210 A 0 0 boating-and-water-sports 5684/6536
3487 2916 2910/2916/3487 Piggy Banks & Money Jars 710 A 0 0 piggy-banks-and-money-jars 2910/2916
2851 2760 2653/2760/2851 Watches 1070 A 0 0 watches 2653/2760
3685 3648 3648/3685 Outdoor Furniture 1220 A 0 0 outdoor-furniture 3648
6928 6288 6288/6928 Toys 1400 A 0 0 toys 6288