SELECT 
  v.feature_id, 
  v.value, 
  v.value_int, 
  v.variant_id, 
  f.feature_type, 
  fd.internal_name, 
  fd.description, 
  fd.prefix, 
  fd.suffix, 
  vd.variant, 
  f.parent_id, 
  f.position, 
  gf.position as gposition, 
  f.display_on_header, 
  f.display_on_catalog, 
  f.display_on_product, 
  f.feature_code, 
  f.purpose 
FROM 
  cscart_product_features as f 
  LEFT JOIN cscart_product_features_values as v ON v.feature_id = f.feature_id 
  LEFT JOIN cscart_product_features_descriptions as fd ON fd.feature_id = v.feature_id 
  AND fd.lang_code = 'en' 
  LEFT JOIN cscart_product_feature_variants fv ON fv.variant_id = v.variant_id 
  LEFT JOIN cscart_product_feature_variant_descriptions as vd ON vd.variant_id = fv.variant_id 
  AND vd.lang_code = 'en' 
  LEFT JOIN cscart_product_features as gf ON gf.feature_id = f.parent_id 
  AND gf.feature_type = 'G' 
WHERE 
  f.status IN ('A') 
  AND v.product_id = 224454 
  AND f.display_on_catalog = 'Y' 
  AND (
    f.categories_path = '' 
    OR FIND_IN_SET(266, f.categories_path) 
    OR FIND_IN_SET(327, f.categories_path) 
    OR FIND_IN_SET(1695, f.categories_path) 
    OR FIND_IN_SET(2599, f.categories_path)
  ) 
  AND IF(
    f.parent_id, 
    (
      SELECT 
        status 
      FROM 
        cscart_product_features as df 
      WHERE 
        df.feature_id = f.parent_id
    ), 
    'A'
  ) IN ('A') 
  AND (
    v.variant_id != 0 
    OR (
      f.feature_type != 'C' 
      AND v.value != ''
    ) 
    OR (f.feature_type = 'C') 
    OR v.value_int != ''
  ) 
  AND v.lang_code = 'en' 
ORDER BY 
  fd.internal_name, 
  fv.position

Query time 0.01061

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "437.20"
    },
    "ordering_operation": {
      "using_temporary_table": true,
      "using_filesort": true,
      "nested_loop": [
        {
          "table": {
            "table_name": "f",
            "access_type": "ALL",
            "possible_keys": [
              "PRIMARY",
              "status"
            ],
            "rows_examined_per_scan": 539,
            "rows_produced_per_join": 53,
            "filtered": "10.00",
            "cost_info": {
              "read_cost": "103.02",
              "eval_cost": "10.78",
              "prefix_cost": "113.80",
              "data_read_per_join": "23K"
            },
            "used_columns": [
              "feature_id",
              "feature_code",
              "purpose",
              "feature_type",
              "categories_path",
              "parent_id",
              "display_on_product",
              "display_on_catalog",
              "display_on_header",
              "status",
              "position"
            ],
            "attached_condition": "((`webmarco`.`f`.`status` = 'A') and (`webmarco`.`f`.`display_on_catalog` = 'Y') and ((`webmarco`.`f`.`categories_path` = '') or find_in_set(266,`webmarco`.`f`.`categories_path`) or find_in_set(327,`webmarco`.`f`.`categories_path`) or find_in_set(1695,`webmarco`.`f`.`categories_path`) or find_in_set(2599,`webmarco`.`f`.`categories_path`)) and (if(`webmarco`.`f`.`parent_id`,(/* select#2 */ select `webmarco`.`df`.`status` from `webmarco`.`cscart_product_features` `df` where (`webmarco`.`df`.`feature_id` = `webmarco`.`f`.`parent_id`)),'A') = 'A'))",
            "attached_subqueries": [
              {
                "dependent": true,
                "cacheable": false,
                "query_block": {
                  "select_id": 2,
                  "cost_info": {
                    "query_cost": "1.20"
                  },
                  "table": {
                    "table_name": "df",
                    "access_type": "eq_ref",
                    "possible_keys": [
                      "PRIMARY"
                    ],
                    "key": "PRIMARY",
                    "used_key_parts": [
                      "feature_id"
                    ],
                    "key_length": "3",
                    "ref": [
                      "webmarco.f.parent_id"
                    ],
                    "rows_examined_per_scan": 1,
                    "rows_produced_per_join": 1,
                    "filtered": "100.00",
                    "cost_info": {
                      "read_cost": "1.00",
                      "eval_cost": "0.20",
                      "prefix_cost": "1.20",
                      "data_read_per_join": "440"
                    },
                    "used_columns": [
                      "feature_id",
                      "status"
                    ]
                  }
                }
              }
            ]
          }
        },
        {
          "table": {
            "table_name": "v",
            "access_type": "ref",
            "possible_keys": [
              "PRIMARY",
              "fl",
              "variant_id",
              "lang_code",
              "product_id",
              "fpl",
              "idx_product_feature_variant_id"
            ],
            "key": "fpl",
            "used_key_parts": [
              "feature_id",
              "product_id",
              "lang_code"
            ],
            "key_length": "12",
            "ref": [
              "webmarco.f.feature_id",
              "const",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 53,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "53.90",
              "eval_cost": "10.78",
              "prefix_cost": "178.48",
              "data_read_per_join": "41K"
            },
            "used_columns": [
              "feature_id",
              "product_id",
              "variant_id",
              "value",
              "value_int",
              "lang_code"
            ],
            "attached_condition": "((`webmarco`.`v`.`variant_id` <> 0) or ((`webmarco`.`f`.`feature_type` <> 'C') and (`webmarco`.`v`.`value` <> '')) or (`webmarco`.`f`.`feature_type` = 'C') or (`webmarco`.`v`.`value_int` <> ''))"
          }
        },
        {
          "table": {
            "table_name": "fd",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "feature_id",
              "lang_code"
            ],
            "key_length": "9",
            "ref": [
              "webmarco.f.feature_id",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 53,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "53.90",
              "eval_cost": "10.78",
              "prefix_cost": "243.16",
              "data_read_per_join": "122K"
            },
            "used_columns": [
              "feature_id",
              "description",
              "prefix",
              "suffix",
              "lang_code",
              "internal_name"
            ]
          }
        },
        {
          "table": {
            "table_name": "fv",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "variant_id"
            ],
            "key_length": "3",
            "ref": [
              "webmarco.v.variant_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 53,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "53.90",
              "eval_cost": "10.78",
              "prefix_cost": "307.84",
              "data_read_per_join": "61K"
            },
            "used_columns": [
              "variant_id",
              "position"
            ]
          }
        },
        {
          "table": {
            "table_name": "vd",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "variant_id",
              "lang_code"
            ],
            "key_length": "9",
            "ref": [
              "webmarco.fv.variant_id",
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 53,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "53.90",
              "eval_cost": "10.78",
              "prefix_cost": "372.52",
              "data_read_per_join": "243K"
            },
            "used_columns": [
              "variant_id",
              "variant",
              "lang_code"
            ]
          }
        },
        {
          "table": {
            "table_name": "gf",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "feature_id"
            ],
            "key_length": "3",
            "ref": [
              "webmarco.f.parent_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 53,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "53.90",
              "eval_cost": "10.78",
              "prefix_cost": "437.20",
              "data_read_per_join": "23K"
            },
            "used_columns": [
              "feature_id",
              "feature_type",
              "position"
            ],
            "attached_condition": "<if>(is_not_null_compl(gf), (`webmarco`.`gf`.`feature_type` = 'G'), true)"
          }
        }
      ]
    }
  }
}

Result

feature_id value value_int variant_id feature_type internal_name description prefix suffix variant parent_id position gposition display_on_header display_on_catalog display_on_product feature_code purpose
837 59777 M Abruzzo Provinces Abruzzo Provinces Chieti (CH) 740 4 0 N Y Y find_products
837 59780 M Abruzzo Provinces Abruzzo Provinces Teramo (TE) 740 4 0 N Y Y find_products
837 59779 M Abruzzo Provinces Abruzzo Provinces Pescara (PE) 740 4 0 N Y Y find_products
837 59778 M Abruzzo Provinces Abruzzo Provinces L'AQUILA (AQ) 740 4 0 N Y Y find_products
838 59832 M Basilicata Provinces Basilicata Provinces Matera 740 6 0 N Y Y find_products
838 59833 M Basilicata Provinces Basilicata Provinces Potenza 740 6 0 N Y Y find_products
839 59834 M Calabria Provinces Calabria Provinces Catanzaro 740 7 0 N Y Y find_products
839 59835 M Calabria Provinces Calabria Provinces Cosenza 740 7 0 N Y Y find_products
839 59836 M Calabria Provinces Calabria Provinces Crotone 740 7 0 N Y Y find_products
839 59837 M Calabria Provinces Calabria Provinces Reggio Calabria 740 7 0 N Y Y find_products
839 59838 M Calabria Provinces Calabria Provinces Vibo Valentia 740 7 0 N Y Y find_products
840 59842 M Campania Provinces Campania Provinces Avellino 740 9 0 N Y Y find_products
840 59843 M Campania Provinces Campania Provinces Benevento 740 9 0 N Y Y find_products
840 59844 M Campania Provinces Campania Provinces Caserta 740 9 0 N Y Y find_products
840 59845 M Campania Provinces Campania Provinces Napoli 740 9 0 N Y Y find_products
840 59846 M Campania Provinces Campania Provinces Salerno 740 9 0 N Y Y find_products
835 59704 M Country Country Italy 740 1 0 N Y Y find_products
841 59847 M Emilia-Romagna Provinces Emilia-Romagna Provinces Bologna 740 10 0 N Y Y find_products
841 59848 M Emilia-Romagna Provinces Emilia-Romagna Provinces Cesena 740 10 0 N Y Y find_products
841 59849 M Emilia-Romagna Provinces Emilia-Romagna Provinces Ferrara 740 10 0 N Y Y find_products
841 59850 M Emilia-Romagna Provinces Emilia-Romagna Provinces Forlì 740 10 0 N Y Y find_products
841 59851 M Emilia-Romagna Provinces Emilia-Romagna Provinces Modena 740 10 0 N Y Y find_products
841 59852 M Emilia-Romagna Provinces Emilia-Romagna Provinces Parma 740 10 0 N Y Y find_products
841 59853 M Emilia-Romagna Provinces Emilia-Romagna Provinces Piacenza 740 10 0 N Y Y find_products
841 59854 M Emilia-Romagna Provinces Emilia-Romagna Provinces Ravenna 740 10 0 N Y Y find_products
841 59855 M Emilia-Romagna Provinces Emilia-Romagna Provinces Reggio Emilia 740 10 0 N Y Y find_products
841 59856 M Emilia-Romagna Provinces Emilia-Romagna Provinces Rimini 740 10 0 N Y Y find_products
842 59857 M Friuli-Venezia Giulia Provinces Friuli-Venezia Giulia Provinces Gorizia 740 10 0 N Y Y find_products
842 59858 M Friuli-Venezia Giulia Provinces Friuli-Venezia Giulia Provinces Pordenone 740 10 0 N Y Y find_products
842 59859 M Friuli-Venezia Giulia Provinces Friuli-Venezia Giulia Provinces Trieste 740 10 0 N Y Y find_products
842 59860 M Friuli-Venezia Giulia Provinces Friuli-Venezia Giulia Provinces Udine 740 10 0 N Y Y find_products
843 59861 M Lazio Provinces Lazio Provinces Frosinone 740 11 0 N Y Y find_products
843 59862 M Lazio Provinces Lazio Provinces Latina 740 11 0 N Y Y find_products
843 59863 M Lazio Provinces Lazio Provinces Rieti 740 11 0 N Y Y find_products
843 59864 M Lazio Provinces Lazio Provinces ROMA 740 11 0 N Y Y find_products
843 59865 M Lazio Provinces Lazio Provinces Viterbo 740 11 0 N Y Y find_products
844 59866 M Liguria Provinces Liguria Provinces Genova 740 12 0 N Y Y find_products
844 59867 M Liguria Provinces Liguria Provinces Imperia 740 12 0 N Y Y find_products
844 59868 M Liguria Provinces Liguria Provinces La Spezia 740 12 0 N Y Y find_products
844 59869 M Liguria Provinces Liguria Provinces Savona 740 12 0 N Y Y find_products
845 59870 M Lombardia Provinces Lombardia Provinces Bergamo 740 14 0 N Y Y find_products
845 59871 M Lombardia Provinces Lombardia Provinces Brescia 740 14 0 N Y Y find_products
845 59872 M Lombardia Provinces Lombardia Provinces Como 740 14 0 N Y Y find_products
845 59873 M Lombardia Provinces Lombardia Provinces Cremona 740 14 0 N Y Y find_products
845 59874 M Lombardia Provinces Lombardia Provinces Lecco 740 14 0 N Y Y find_products
845 59875 M Lombardia Provinces Lombardia Provinces Lodi 740 14 0 N Y Y find_products
845 59876 M Lombardia Provinces Lombardia Provinces Mantova 740 14 0 N Y Y find_products
845 59877 M Lombardia Provinces Lombardia Provinces MILANO 740 14 0 N Y Y find_products
845 59878 M Lombardia Provinces Lombardia Provinces Monza 740 14 0 N Y Y find_products
845 59879 M Lombardia Provinces Lombardia Provinces Pavia 740 14 0 N Y Y find_products
845 59880 M Lombardia Provinces Lombardia Provinces Sondrio 740 14 0 N Y Y find_products
845 59881 M Lombardia Provinces Lombardia Provinces Varese 740 14 0 N Y Y find_products
846 59882 M Marche Provinces Marche Provinces Ancona 740 15 0 N Y Y find_products
846 59883 M Marche Provinces Marche Provinces Ascoli Piceno 740 15 0 N Y Y find_products
846 59884 M Marche Provinces Marche Provinces Fermo 740 15 0 N Y Y find_products
846 59885 M Marche Provinces Marche Provinces Macerata 740 15 0 N Y Y find_products
846 59886 M Marche Provinces Marche Provinces Pesaro 740 15 0 N Y Y find_products
846 59887 M Marche Provinces Marche Provinces Urbino 740 15 0 N Y Y find_products
847 59888 M Molise Provinces Molise Provinces Campobasso 740 15 0 N Y Y find_products
847 59889 M Molise Provinces Molise Provinces Isernia 740 15 0 N Y Y find_products
848 59890 M Piemonte Provinces Piemonte Provinces Alessandria 740 17 0 N Y Y find_products
848 59891 M Piemonte Provinces Piemonte Provinces Asti 740 17 0 N Y Y find_products
848 59892 M Piemonte Provinces Piemonte Provinces Biella 740 17 0 N Y Y find_products
848 59893 M Piemonte Provinces Piemonte Provinces Cuneo 740 17 0 N Y Y find_products
848 59894 M Piemonte Provinces Piemonte Provinces Novara 740 17 0 N Y Y find_products
848 59895 M Piemonte Provinces Piemonte Provinces Torino 740 17 0 N Y Y find_products
848 59896 M Piemonte Provinces Piemonte Provinces Verbania 740 17 0 N Y Y find_products
848 59897 M Piemonte Provinces Piemonte Provinces Vercelli 740 17 0 N Y Y find_products
849 59898 M Puglia Provinces Puglia Provinces Andria 740 18 0 N Y Y find_products
849 59899 M Puglia Provinces Puglia Provinces BARI 740 18 0 N Y Y find_products
849 59900 M Puglia Provinces Puglia Provinces Barletta 740 18 0 N Y Y find_products
849 59901 M Puglia Provinces Puglia Provinces Brindisi 740 18 0 N Y Y find_products
849 59902 M Puglia Provinces Puglia Provinces Foggia 740 18 0 N Y Y find_products
849 59903 M Puglia Provinces Puglia Provinces Lecce 740 18 0 N Y Y find_products
849 59904 M Puglia Provinces Puglia Provinces Taranto 740 18 0 N Y Y find_products
849 59905 M Puglia Provinces Puglia Provinces Trani 740 18 0 N Y Y find_products
834 59741 M Region / District Region / District Abruzzo 740 2 0 N Y Y find_products
834 59742 M Region / District Region / District Basilicata 740 2 0 N Y Y find_products
834 59743 M Region / District Region / District Calabria 740 2 0 N Y Y find_products
834 59744 M Region / District Region / District Campania 740 2 0 N Y Y find_products
834 59745 M Region / District Region / District Emilia-Romagna 740 2 0 N Y Y find_products
834 59746 M Region / District Region / District Friuli Venezia Giulia 740 2 0 N Y Y find_products
834 59747 M Region / District Region / District Lazio 740 2 0 N Y Y find_products
834 59748 M Region / District Region / District Liguria 740 2 0 N Y Y find_products
834 59749 M Region / District Region / District Lombardia 740 2 0 N Y Y find_products
834 59750 M Region / District Region / District Marche 740 2 0 N Y Y find_products
834 59751 M Region / District Region / District Molise 740 2 0 N Y Y find_products
834 59752 M Region / District Region / District Piemonte 740 2 0 N Y Y find_products
834 59753 M Region / District Region / District Puglia 740 2 0 N Y Y find_products
834 59754 M Region / District Region / District Sardegna 740 2 0 N Y Y find_products
834 59755 M Region / District Region / District Sicilia 740 2 0 N Y Y find_products
834 59756 M Region / District Region / District Toscana 740 2 0 N Y Y find_products
834 59757 M Region / District Region / District Trentino-Alto Adige 740 2 0 N Y Y find_products
834 59758 M Region / District Region / District Umbria 740 2 0 N Y Y find_products
834 59759 M Region / District Region / District Valle d'Aosta 740 2 0 N Y Y find_products
834 59760 M Region / District Region / District Veneto 740 2 0 N Y Y find_products
834 59763 M Region / District Region / District Roma 740 2 0 N Y Y find_products
850 59906 M Sardegna Provinces Sardegna Provinces Cagliari 740 20 0 N Y Y find_products
850 59907 M Sardegna Provinces Sardegna Provinces Carbonia 740 20 0 N Y Y find_products
850 59908 M Sardegna Provinces Sardegna Provinces Nuoro 740 20 0 N Y Y find_products
850 59909 M Sardegna Provinces Sardegna Provinces Oristano 740 20 0 N Y Y find_products
850 59910 M Sardegna Provinces Sardegna Provinces Sassari 740 20 0 N Y Y find_products
851 59911 M Sicilia Provinces Sicilia Provinces Agrigento 740 21 0 N Y Y find_products
851 59912 M Sicilia Provinces Sicilia Provinces Caltanissetta 740 21 0 N Y Y find_products
851 59913 M Sicilia Provinces Sicilia Provinces Catania 740 21 0 N Y Y find_products
851 59914 M Sicilia Provinces Sicilia Provinces Enna 740 21 0 N Y Y find_products
851 59915 M Sicilia Provinces Sicilia Provinces Messina 740 21 0 N Y Y find_products
851 59916 M Sicilia Provinces Sicilia Provinces Palermo 740 21 0 N Y Y find_products
851 59917 M Sicilia Provinces Sicilia Provinces Ragusa 740 21 0 N Y Y find_products
851 59918 M Sicilia Provinces Sicilia Provinces Siracusa 740 21 0 N Y Y find_products
851 59919 M Sicilia Provinces Sicilia Provinces Trapani 740 21 0 N Y Y find_products
853 61614 M Toscana Provinces Toscana Provinces Veneto 740 23 0 N Y Y find_products
853 59922 M Toscana Provinces Toscana Provinces Arezzo 740 23 0 N Y Y find_products
853 59923 M Toscana Provinces Toscana Provinces Firenze 740 23 0 N Y Y find_products
853 59924 M Toscana Provinces Toscana Provinces Grosseto 740 23 0 N Y Y find_products
853 59925 M Toscana Provinces Toscana Provinces Livorno 740 23 0 N Y Y find_products
853 59926 M Toscana Provinces Toscana Provinces Lucca 740 23 0 N Y Y find_products
853 59927 M Toscana Provinces Toscana Provinces Massa 740 23 0 N Y Y find_products
853 59928 M Toscana Provinces Toscana Provinces Pisa 740 23 0 N Y Y find_products
853 59929 M Toscana Provinces Toscana Provinces Pistoia 740 23 0 N Y Y find_products
853 59930 M Toscana Provinces Toscana Provinces Prato 740 23 0 N Y Y find_products
853 59931 M Toscana Provinces Toscana Provinces Siena 740 23 0 N Y Y find_products
852 59920 M Trentino-Alto Adige Provinces Trentino-Alto Adige Provinces Bolzano 740 22 0 N Y Y find_products
852 59921 M Trentino-Alto Adige Provinces Trentino-Alto Adige Provinces Trento 740 22 0 N Y Y find_products
741 38299 M Type of Service Type of Service Car Rental 740 0 0 N Y Y find_products
854 59932 M Umbria Provinces Umbria Provinces Perugia 740 24 0 N Y Y find_products
854 59933 M Umbria Provinces Umbria Provinces Terni 740 24 0 N Y Y find_products
855 59934 M Valle d'Aosta Provinces Valle d'Aosta Provinces Aosta 740 26 0 N Y Y 25 find_products
856 59935 M Veneto Provinces Veneto Provinces Belluno 740 27 0 N Y Y find_products
856 59936 M Veneto Provinces Veneto Provinces Padova 740 27 0 N Y Y find_products
856 59937 M Veneto Provinces Veneto Provinces Rovigo 740 27 0 N Y Y find_products
856 59938 M Veneto Provinces Veneto Provinces Treviso 740 27 0 N Y Y find_products
856 59939 M Veneto Provinces Veneto Provinces Venezia 740 27 0 N Y Y find_products
856 59940 M Veneto Provinces Veneto Provinces Verona 740 27 0 N Y Y find_products
856 59941 M Veneto Provinces Veneto Provinces Vicenza 740 27 0 N Y Y find_products