SELECT 
  pf.feature_id, 
  pf.company_id, 
  pf.feature_type, 
  pf.parent_id, 
  pf.display_on_product, 
  pf.display_on_catalog, 
  pf.display_on_header, 
  cscart_product_features_descriptions.description, 
  cscart_product_features_descriptions.internal_name, 
  cscart_product_features_descriptions.lang_code, 
  cscart_product_features_descriptions.prefix, 
  cscart_product_features_descriptions.suffix, 
  pf.categories_path, 
  cscart_product_features_descriptions.full_description, 
  pf.status, 
  pf.comparison, 
  pf.position, 
  pf.purpose, 
  pf.feature_style, 
  pf.filter_style, 
  pf.feature_code, 
  pf.timestamp, 
  pf.updated_timestamp, 
  pf_groups.position AS group_position, 
  cscart_product_features_values.value, 
  cscart_product_features_values.variant_id, 
  cscart_product_features_values.value_int, 
  pf.yml2_exclude_prices, 
  cscart_product_features_descriptions.yml2_variants_unit, 
  abt_filters.filter_id 
FROM 
  cscart_product_features AS pf 
  LEFT JOIN cscart_product_features AS pf_groups ON pf.parent_id = pf_groups.feature_id 
  LEFT JOIN cscart_product_features_descriptions AS pf_groups_description ON pf_groups_description.feature_id = pf.parent_id 
  AND pf_groups_description.lang_code = 'ru' 
  LEFT JOIN cscart_product_features_descriptions ON cscart_product_features_descriptions.feature_id = pf.feature_id 
  AND cscart_product_features_descriptions.lang_code = 'ru' 
  INNER JOIN cscart_product_features_values ON cscart_product_features_values.feature_id = pf.feature_id 
  AND cscart_product_features_values.product_id = 22710 
  AND cscart_product_features_values.lang_code = 'ru' 
  LEFT JOIN cscart_product_filters AS abt_filters ON abt_filters.feature_id = pf.feature_id 
  AND abt_filters.company_id = pf.company_id 
  INNER JOIN cscart_ult_objects_sharing ON (
    cscart_ult_objects_sharing.share_object_id = pf.feature_id 
    AND cscart_ult_objects_sharing.share_company_id = 1 
    AND cscart_ult_objects_sharing.share_object_type = 'product_features'
  ) 
WHERE 
  1 = 1 
  AND pf.feature_type != 'G' 
  AND pf.status IN ('A') 
  AND (
    pf_groups.status IN ('A') 
    OR pf_groups.status IS NULL
  ) 
  AND pf.display_on_product = 'Y' 
  AND (
    pf.categories_path = '' 
    OR ISNULL(pf.categories_path) 
    OR FIND_IN_SET(5, pf.categories_path) 
    OR FIND_IN_SET(18, pf.categories_path) 
    OR FIND_IN_SET(40, pf.categories_path) 
    OR FIND_IN_SET(42, pf.categories_path) 
    OR FIND_IN_SET(392, pf.categories_path)
  ) 
GROUP BY 
  pf.feature_id 
ORDER BY 
  group_position asc, 
  pf_groups_description.description asc, 
  pf_groups.feature_id asc, 
  pf.position asc, 
  cscart_product_features_descriptions.description asc, 
  pf.feature_id asc

Query time 0.00282

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "21.29"
    },
    "ordering_operation": {
      "using_filesort": true,
      "grouping_operation": {
        "using_temporary_table": true,
        "using_filesort": false,
        "nested_loop": [
          {
            "table": {
              "table_name": "cscart_product_features_values",
              "access_type": "ref",
              "possible_keys": [
                "PRIMARY",
                "fl",
                "lang_code",
                "product_id",
                "fpl",
                "idx_product_feature_variant_id"
              ],
              "key": "product_id",
              "used_key_parts": [
                "product_id"
              ],
              "key_length": "3",
              "ref": [
                "const"
              ],
              "rows_examined_per_scan": 38,
              "rows_produced_per_join": 19,
              "filtered": "51.30",
              "cost_info": {
                "read_cost": "9.50",
                "eval_cost": "1.95",
                "prefix_cost": "13.30",
                "data_read_per_join": "15K"
              },
              "used_columns": [
                "feature_id",
                "product_id",
                "variant_id",
                "value",
                "value_int",
                "lang_code"
              ],
              "attached_condition": "(`test_uchur_k`.`cscart_product_features_values`.`lang_code` = 'ru')"
            }
          },
          {
            "table": {
              "table_name": "pf",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY",
                "status"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "feature_id"
              ],
              "key_length": "3",
              "ref": [
                "test_uchur_k.cscart_product_features_values.feature_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 1,
              "filtered": "8.38",
              "cost_info": {
                "read_cost": "4.87",
                "eval_cost": "0.16",
                "prefix_cost": "20.12",
                "data_read_per_join": "3K"
              },
              "used_columns": [
                "feature_id",
                "feature_code",
                "company_id",
                "purpose",
                "feature_style",
                "filter_style",
                "feature_type",
                "categories_path",
                "parent_id",
                "display_on_product",
                "display_on_catalog",
                "display_on_header",
                "status",
                "position",
                "comparison",
                "timestamp",
                "updated_timestamp",
                "yml2_exclude_prices"
              ],
              "attached_condition": "((`test_uchur_k`.`pf`.`feature_type` <> 'G') and (`test_uchur_k`.`pf`.`status` = 'A') and (`test_uchur_k`.`pf`.`display_on_product` = 'Y') and ((`test_uchur_k`.`pf`.`categories_path` = '') or (`test_uchur_k`.`pf`.`categories_path` is null) or (0 <> find_in_set(5,`test_uchur_k`.`pf`.`categories_path`)) or (0 <> find_in_set(18,`test_uchur_k`.`pf`.`categories_path`)) or (0 <> find_in_set(40,`test_uchur_k`.`pf`.`categories_path`)) or (0 <> find_in_set(42,`test_uchur_k`.`pf`.`categories_path`)) or (0 <> find_in_set(392,`test_uchur_k`.`pf`.`categories_path`))))"
            }
          },
          {
            "table": {
              "table_name": "pf_groups",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "feature_id"
              ],
              "key_length": "3",
              "ref": [
                "test_uchur_k.pf.parent_id"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "19.00",
              "cost_info": {
                "read_cost": "0.41",
                "eval_cost": "0.03",
                "prefix_cost": "20.69",
                "data_read_per_join": "613"
              },
              "used_columns": [
                "feature_id",
                "status",
                "position"
              ],
              "attached_condition": "<if>(found_match(pf_groups), ((`test_uchur_k`.`pf_groups`.`status` = 'A') or (`test_uchur_k`.`pf_groups`.`status` is null)), true)"
            }
          },
          {
            "table": {
              "table_name": "pf_groups_description",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "feature_id",
                "lang_code"
              ],
              "key_length": "9",
              "ref": [
                "test_uchur_k.pf.parent_id",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.08",
                "eval_cost": "0.03",
                "prefix_cost": "20.80",
                "data_read_per_join": "754"
              },
              "used_columns": [
                "feature_id",
                "description",
                "lang_code"
              ]
            }
          },
          {
            "table": {
              "table_name": "cscart_product_features_descriptions",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "feature_id",
                "lang_code"
              ],
              "key_length": "9",
              "ref": [
                "test_uchur_k.cscart_product_features_values.feature_id",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.08",
                "eval_cost": "0.03",
                "prefix_cost": "20.91",
                "data_read_per_join": "754"
              },
              "used_columns": [
                "feature_id",
                "description",
                "internal_name",
                "full_description",
                "prefix",
                "suffix",
                "lang_code",
                "yml2_variants_unit"
              ]
            }
          },
          {
            "table": {
              "table_name": "cscart_ult_objects_sharing",
              "access_type": "eq_ref",
              "possible_keys": [
                "PRIMARY"
              ],
              "key": "PRIMARY",
              "used_key_parts": [
                "share_object_id",
                "share_company_id",
                "share_object_type"
              ],
              "key_length": "159",
              "ref": [
                "test_uchur_k.cscart_product_features_values.feature_id",
                "const",
                "const"
              ],
              "rows_examined_per_scan": 1,
              "rows_produced_per_join": 0,
              "filtered": "100.00",
              "using_index": true,
              "cost_info": {
                "read_cost": "0.08",
                "eval_cost": "0.03",
                "prefix_cost": "21.02",
                "data_read_per_join": "49"
              },
              "used_columns": [
                "share_company_id",
                "share_object_id",
                "share_object_type"
              ],
              "attached_condition": "(`test_uchur_k`.`cscart_ult_objects_sharing`.`share_object_id` = `test_uchur_k`.`cscart_product_features_values`.`feature_id`)"
            }
          },
          {
            "table": {
              "table_name": "abt_filters",
              "access_type": "ref",
              "possible_keys": [
                "feature_id",
                "company_id"
              ],
              "key": "company_id",
              "used_key_parts": [
                "company_id"
              ],
              "key_length": "5",
              "ref": [
                "test_uchur_k.pf.company_id"
              ],
              "rows_examined_per_scan": 2,
              "rows_produced_per_join": 0,
              "filtered": "100.00",
              "cost_info": {
                "read_cost": "0.19",
                "eval_cost": "0.09",
                "prefix_cost": "21.29",
                "data_read_per_join": "62"
              },
              "used_columns": [
                "filter_id",
                "company_id",
                "feature_id"
              ],
              "attached_condition": "<if>(is_not_null_compl(abt_filters), (`test_uchur_k`.`abt_filters`.`feature_id` = `test_uchur_k`.`cscart_product_features_values`.`feature_id`), true)"
            }
          }
        ]
      }
    }
  }
}

Result

feature_id company_id feature_type parent_id display_on_product display_on_catalog display_on_header description internal_name lang_code prefix suffix categories_path full_description status comparison position purpose feature_style filter_style feature_code timestamp updated_timestamp group_position value variant_id value_int yml2_exclude_prices yml2_variants_unit filter_id
1 1 E 0 Y Y N Бренд Бренд (Общие) ru 4,6,7,8,9,10,18,20,21,23,24,25,13,26,29,39,1,2,3,5,11,12,15,16,17,19,22,28,31,32,33,34,35,36,37,38,63,73,74,59,139,142,143,155,169,76,69,131,179,180,210,157,58,57,228,229,114,236,239,136,161,245,222,247,97,62,148,106,181,105,282,264,98,207,163,68,253,55,288,147,221,312,151,325,298,268,208,328,321,345,352,331,54,159,65,175,380,311,286 A N 0 organize_catalog brand checkbox 1760347417 1763916902 1 2
55 1 S 0 Y Y N Модель Модель ГЛАВНАЯ ru A N 20 find_products text checkbox 1760456410 1763694640 1347 13
56 1 M 0 Y Y N Назначение Назначение ГЛАВНАЯ ru 25,5,6,7,8,9,10,18,19,20,22,23,24,26,28,29,31,32,33,34,36,37,1,2,3,4,11,12,13,15,16,17,21,35,38,39,221,352 A N 30 find_products multiple_checkbox checkbox 1760456422 1763401203 122 6
6 1 M 0 Y Y N Сезонность Сезонность ГЛАВНАЯ ru 10,2,5,6,7,8,9,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,28,29,31,32,33,34,36,37,38,39,40,42,43,44,45,50,221,352,1 A N 40 find_products multiple_checkbox checkbox 1760418064 1763399599 59 8
77 1 S 0 Y N N Тип Тип ГЛАВНАЯ ru 6,1,2,3,4,5,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,28,29,31,32,33,34,35,36,37,38,39,54,75,76,131,228,239,253,264,292,304,331 A N 45 find_products text checkbox 1760544628 1763697318 1353
57 1 M 0 Y N N Пол Пол ГЛАВНАЯ ru 25,5,6,7,8,9,10,18,19,20,22,23,24,26,28,29,31,32,33,34,36,37,1 A N 50 find_products multiple_checkbox checkbox 1760456600 1763399580 123 12
58 1 M 0 Y N N Материал Материал ГЛАВНАЯ ru 25,5,6,7,8,9,10,18,19,20,22,23,24,26,28,29,31,32,33,34,36,37,1,2,3,4,11,12,13,15,16,17,21,35,38,39,221,241 A N 140 find_products multiple_checkbox checkbox 1760456699 1763694518 126 9
59 1 M 0 Y N N Состав материала Состав материала ГЛАВНАЯ ru 25,5,6,7,8,9,10,18,19,20,22,23,24,26,28,29,31,32,33,34,36,37,21,39 A N 150 find_products multiple_checkbox checkbox 1760456872 1762147616 1355
47 1 M 0 Y N N Технология Технология ГЛАВНАЯ ru 5,6,7,8,9,10,18,19,20,21,22,23,24,25,26,28,29,31,32,33,34,36,37,39 A N 290 find_products multiple_checkbox checkbox 1760455940 1762147790 1296 15
60 1 S 0 Y N N Анатомический крой Анатомический крой ГЛАВНАЯ ru 25,5,6,7,8,9,10,18,19,20,22,23,24,26,28,29,31,32,33,34,36,37 A N 291 find_products text checkbox 1760456925 1762146166 129
3 1 S 0 Y Y N Таблица размеров Таблица размеров ru 6,24,7,8,9,10,25,18,26,28,29,33,34,31,32,36,37,5,19,20,22,23 A N 490 group_variation_catalog_item dropdown_labels checkbox 1760400769 1762147725 26 14
39 1 S 0 Y Y N Цвет Цвет ГЛАВНАЯ ru 9,1,2,3,4,5,6,7,8,10,11,12,13,15,16,17,18,19,20,21,22,23,24,25,26,28,29,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,50,54,62,65,103,135,144,152,175,241,312,352,387 A N 510 group_catalog_item dropdown_images color 1760455336 1765503843 165 5
66 1 S 0 Y N N Страна-изготовитель Страна-изготовитель ГЛАВНАЯ ru 25,1,2,3,4,5,6,7,8,9,10,11,12,13,15,16,17,18,19,20,21,22,23,24,26,28,29,31,32,33,34,35,36,37,38,39,40,42,43,44,45,46,50,54,62,65,103,135,144,152,175,241,312,352,387 A N 540 find_products text checkbox 1760457362 1763689783 147 17