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, 
  cscart_categories.ab__lc_catalog_image_control 
FROM 
  cscart_categories 
  LEFT JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id 
  AND cscart_category_descriptions.lang_code = 'ar' 
  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 = 'ar' 
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.id_path LIKE '166/%' 
  AND cscart_categories.category_id != 264 
  AND cscart_categories.parent_id != 264 
  AND cscart_categories.storefront_id IN (0, 1) 
ORDER BY 
  cscart_categories.is_trash asc, 
  cscart_categories.position asc, 
  cscart_category_descriptions.category asc

Query time 0.00409

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "57.24"
    },
    "ordering_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_categories",
            "access_type": "range",
            "possible_keys": [
              "PRIMARY",
              "c_status",
              "parent",
              "id_path",
              "p_category_id"
            ],
            "key": "id_path",
            "used_key_parts": [
              "id_path"
            ],
            "key_length": "767",
            "rows_examined_per_scan": 62,
            "rows_produced_per_join": 1,
            "filtered": "2.00",
            "index_condition": "(`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`id_path` like '166/%')",
            "cost_info": {
              "read_cost": "28.04",
              "eval_cost": "0.12",
              "prefix_cost": "28.16",
              "data_read_per_join": "3K"
            },
            "used_columns": [
              "category_id",
              "parent_id",
              "id_path",
              "company_id",
              "storefront_id",
              "usergroup_ids",
              "status",
              "position",
              "is_trash",
              "ab__lc_catalog_image_control"
            ],
            "attached_condition": "(((`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`usergroup_ids`))) and (`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`status` = 'A') and (`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`category_id` <> 264) and (`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`parent_id` <> 264) and (`softwarepirmam_hewadelivard_cscart_4`.`cscart_categories`.`storefront_id` in (0,1)))"
          }
        },
        {
          "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": [
              "softwarepirmam_hewadelivard_cscart_4.cscart_categories.category_id",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.31",
              "eval_cost": "0.12",
              "prefix_cost": "28.59",
              "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": [
              "softwarepirmam_hewadelivard_cscart_4.cscart_categories.category_id",
              "const",
              "const",
              "const"
            ],
            "rows_examined_per_scan": 66,
            "rows_produced_per_join": 81,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "20.46",
              "eval_cost": "8.18",
              "prefix_cost": "57.24",
              "data_read_per_join": "138K"
            },
            "used_columns": [
              "name",
              "object_id",
              "type",
              "dispatch",
              "path",
              "lang_code"
            ]
          }
        }
      ]
    }
  }
}

Result

category_id parent_id id_path category position status company_id storefront_id seo_name seo_path ab__lc_catalog_image_control
379 378 166/378/379 Anker 10 A 0 0 anker-ar 166/378 none
323 322 166/322/323 Apple watch 10 A 0 0 apple-watch-ar 166/322 none
321 320 166/320/321 iPad 10 A 0 0 ipad-ar 166/320 none
235 234 166/234/235 iPhone 10 A 0 0 iphone-ar 166/234 none
356 167 166/167/356 Mac 10 A 0 0 mac-ar 166/167 none
415 414 166/351/414/415 Online & Smart UPS 10 A 0 0 online-and-smart-ups-ar 166/351/414 none
414 351 166/351/414 UPS 10 A 0 0 ups 166/351 none
357 170 166/170/357 Xiaomi 10 A 0 0 xiaomi-ar 166/170 none
360 359 166/328/359/360 أكسس بوينت داخلي 10 A 0 0 indoor-access-point-ar 166/328/359 none
344 329 166/329/344 إيربودز 10 A 0 0 airpods 166/329 none
601 600 166/600/601 بروسيسور (CPU) 10 A 0 0 cpu-ar 166/600 none
190 174 166/174/190 تلفازات 10 A 0 0 tvs 166/174 none
341 328 166/328/341 راوتر 10 A 0 0 router-ar 166/328 none
527 329 166/329/527 ساوند بارز 10 A 0 0 sound-bars-ar 166/329 none
362 342 166/328/342/362 سويتش مدار 10 A 0 0 managed-switch-ar 166/328/342 none
450 424 166/423/424/450 كابلات 10 A 0 0 cables-ar 166/423/424 none
167 166 166/167 كمبيوترات ولابتوبات 10 A 0 0 laptops 166 none
381 350 166/350/381 كومبو 10 A 0 0 combo-ar 166/350 none
514 513 166/513/514 هارد ديسك درايفز (HDD) 10 A 0 0 hard-disk-drives-hdd-ar 166/513 none
609 608 166/600/608/609 هارد ديسك درايفز (HDD) 10 A 0 0 hard-disk-drives-hdd-ar 166/600/608 none
352 167 166/167/352 Dell 20 A 0 0 dell-ar 166/167 none
326 234 166/234/326 Galaxy 20 A 0 0 galaxy 166/234 none
325 320 166/320/325 Galaxy Tab 20 A 0 0 galaxy-tab-ar 166/320 none
324 322 166/322/324 Galaxy Watch 20 A 0 0 galaxy-watch-ar 166/322 none
432 378 166/378/432 Hama 20 A 0 0 hama-ar 166/378 none
358 170 166/170/358 LG 20 A 0 0 lg-ar 166/170 none
613 414 166/351/414/613 Offline UPS 20 A 0 0 offline-ups-ar 166/351/414 none
429 351 166/351/429 PDU 20 A 0 0 pdu-ar 166/351 none
361 359 166/328/359/361 أكسس بوينت خارجي 20 A 0 0 outdoor-access-point-ar 166/328/359 none
602 600 166/600/602 جرافيكس كاردز (GPU) 20 A 0 0 graphics-cards-gpu-ar 166/600 none
337 174 166/174/337 ساوند بار (مكبرات) 20 A 0 0 sound-bars 166/174 none
610 608 166/600/608/610 سوليد ستيت درايف (SSD) 20 A 0 0 solid-state-drive-ssd-ar 166/600/608 none
515 513 166/513/515 سوليد ستيت درايفز (SSD) 20 A 0 0 solid-state-drives-ssd-ar 166/513 none
363 342 166/328/342/363 سويتش غير مدار 20 A 0 0 unmanaged-switch-ar 166/328/342 none
342 328 166/328/342 سويتشات 20 A 0 0 switch-ar 166/328 none
424 423 166/423/424 شواحن & HDMI 20 A 0 0 chargers-ar 166/423 none
382 350 166/350/382 ماوس 20 A 0 0 mouse-ar 166/350 none
451 424 166/423/424/451 محولات 20 A 0 0 power-adapter-ar 166/423/424 none
353 167 166/167/353 HP 30 A 0 0 hp-ar 166/167 none
236 234 166/234/236 Xiaomi 30 A 0 0 xiaomi-ar 166/234 none
443 378 166/378/443 Xiaomi 30 A 0 0 xiaomi-ar 166/378 none
339 320 166/320/339 Xiaomi Pad 30 A 0 0 xiaomi-pad 166/320 none
340 322 166/322/340 Xiaomi Smart Watches 30 A 0 0 xiaomi-smart-watches-ar 166/322 none
430 351 166/351/430 بطاريات 30 A 0 0 batteries-ar 166/351 none
343 543 166/328/543/343 كابل إيثرنت 30 A 0 0 ethernet-cable-ar 166/328/543 none
452 424 166/423/424/452 كومبو 30 A 0 0 combo-ar 166/423/424 none
383 350 166/350/383 كيبورد 30 A 0 0 keyboard-ar 166/350 none
603 600 166/600/603 ماذربوردز 30 A 0 0 motherboards-ar 166/600 none
425 423 166/423/425 محطة شحن 30 A 0 0 docking-stations 166/423 none
234 166 166/234 هواتف 30 A 0 0 mobiles 166 none
516 513 166/513/516 يو إس بي فلاش درايفز 30 A 0 0 usb-flash-drives-ar 166/513 none
544 543 166/328/543/544 كابلات كوكسيل 40 A 0 0 coaxial-cable-ar 166/328/543 none
483 378 166/378/483 Dviced 40 A 0 0 dviced-ar 166/378 none
469 320 166/320/469 Huawei Pads 40 A 0 0 huawei-pads-ar 166/320 none
471 322 166/322/471 Huawei Watches 40 A 0 0 huawei-watches-ar 166/322 none
354 167 166/167/354 Lenovo 40 A 0 0 lenovo-ar 166/167 none
505 170 166/170/505 Lenovo 40 A 0 0 lenovo-ar 166/170 none
559 234 166/234/559 Motorola 40 A 0 0 motorola-ar-2 166/234 none
526 170 166/170/526 Samsung 40 A 0 0 samsung-ar 166/170 none
359 328 166/328/359 أكسس بوينت 40 A 0 0 access-point-ar 166/328 none
486 174 166/174/486 بروجكترات 40 A 0 0 projectors-ar 166/174 none
604 600 166/600/604 بي سي كيسز 40 A 0 0 pc-cases-ar 166/600 none
320 166 166/320 تابلتات 40 A 0 0 tablets-ar 166 none
170 166 166/170 شاشات كمبيوتر 40 A 0 0 monitors-ar 166 none
426 424 166/423/424/426 محولات 40 A 0 0 adapters-ar 166/423/424 none
517 513 166/513/517 ميموري كاردز 40 A 0 0 memory-cards-ar 166/513 none
174 166 166/174 تلفاز وسينما 50 A 0 0 tv-and-theatre 166 none
322 166 166/322 ساعات ذكية 50 A 0 0 smart-watches 166 none
364 328 166/328/364 (فايروال) جدار حماية 50 A 0 0 firewall-ar 166/328 none
355 167 166/167/355 Asus 50 A 0 0 asus-ar 166/167 none
490 378 166/378/490 Belkin 50 A 0 0 belkin-ar 166/378 none
528 170 166/170/528 Dell 50 A 0 0 dell-ar 166/170 none
614 320 166/320/614 Honor Pad 50 A 0 0 honor-pad-ar 166/320 none
470 234 166/234/470 Huawei 50 A 0 0 huawei-ar 166/234 none
567 543 166/328/543/567 POE Adapters 50 A 0 0 poe-adapters-ar 166/328/543 none
605 600 166/600/605 باور سبلاي (PSU) 50 A 0 0 power-supply-psu-ar 166/600 none
399 329 166/329/399 سماعات الهيدست 50 A 0 0 headsets-ar 166/329 none
518 513 166/513/518 كارد ريدرز 50 A 0 0 card-readers-ar 166/513 none
446 351 166/351/446 مقابس وحافظات كهربائية 50 A 0 0 sockets-and-wall-plugs-ar 166/351 none
529 170 166/170/529 Asus 60 A 0 0 asus-ar 166/170 none
506 378 166/378/506 Baykron 60 A 0 0 baykron-ar 166/378 none
444 167 166/167/444 Microsoft 60 A 0 0 microsoft-ar 166/167 none
606 600 166/600/606 بي سي كولينج 60 A 0 0 pc-cooling-ar 166/600 none
457 329 166/329/457 سماعات 60 A 0 0 headphone-ar 166/329 none
648 351 166/351/648 شاحن سيارة كهربائية 60 A 0 0 ev-car-chargers-ar 166/351 none
328 166 166/328 معدات الشبكات 60 A 0 0 network-ar 166 none
448 423 166/423/448 واقيات الشاشة 60 A 0 0 screen-protectors-ar 166/423 none
366 328 166/328/366 وحدة تحكم الوصول اللاسلكي (WAC) 60 A 0 0 wireless-access-controller-wac 166/328 none
525 167 166/167/525 acer 65 A 0 0 acer-ar 166/167 none
530 170 166/170/530 HP 70 A 0 0 hp-ar 166/170 none
532 167 166/167/532 MSI 70 A 0 0 msi 166/167 none
449 423 166/423/449 أغطية وحافظات 70 A 0 0 cases-and-covers-ar 166/423 none
477 423 166/423/477 أقلام لمس 70 A 0 0 stylus-pens-ar 166/423 none
608 600 166/600/608 بي سي ستوراج 70 A 0 0 pc-storage 166/600 none
347 329 166/329/347 مكبرات 70 A 0 0 speakers-ar 166/329 none
329 166 166/329 مكبرات وسماعات 70 A 0 0 headphone-and-speakers-ar 166 none
438 328 166/328/438 موسع نطاق 70 A 0 0 range-extender-ar 166/328 none
519 167 166/167/519 All in One 80 A 0 0 all-in-one-ar 166/167 none
531 170 166/170/531 MSI 80 A 0 0 msi-ar 166/170 none
481 328 166/328/481 آلة لحام الألياف الضوئية 80 A 0 0 fiber-splicing-machine-ar 166/328 none
607 600 166/600/607 رام 80 A 0 0 ram-ar 166/600 none
492 424 166/423/424/492 الشحن اللاسلكي والحوامل 90 A 0 0 wireless-charging-and-stands-ar 166/423/424 none
520 423 166/423/520 كاميرا ويب 100 A 0 0 webcam-camera-ar 166/423 none
350 166 166/350 ماوس وكيبورد 110 A 0 0 mouse-and-keyboard-ar 166 none
585 423 166/423/585 واتش باندز 110 A 0 0 watch-bands-ar 166/423 none
351 166 166/351 وحدات الطاقة 120 A 0 0 ups-and-power-units 166 none
586 423 166/423/586 تراكيرز 120 A 0 0 trackers-ar 166/423 none
523 399 166/329/399/523 سماعات المكتب 120 A 0 0 office-headsets-ar 166/329/399 none
524 399 166/329/399/524 سماعات جيمينغ 120 A 0 0 gaming-headsets-ar 166/329/399 none
543 328 166/328/543 كابلات الشبكة 120 A 0 0 network-cable-ar 166/328 none
657 423 166/423/657 Car Phone Holders 130 A 0 0 car-phone-holders-ar 166/423 none
378 166 166/378 باور بانك 130 A 0 0 power-banks-ar 166 none
564 328 166/328/564 رابط لاسلكي مخصص 130 A 0 0 point-to-point-ar 166/328 none
589 328 166/328/589 آي بي فون 140 A 0 0 ip-phone-ar 166/328 none
513 166 166/513 التخزين الخارجي 140 A 0 0 external-storage-ar 166 none
423 166 166/423 إكسسوارات 150 A 0 0 accessories-ar 166 none
600 166 166/600 مكونات الكمبيوتر 160 A 0 0 pc-compnents-ar 166 none