SELECT 
  f.feature_id, 
  f.purpose, 
  p.product_id, 
  p.parent_product_id, 
  g.id, 
  g.code 
FROM 
  cscart_product_variation_group_features AS f 
  INNER JOIN cscart_product_variation_groups AS g ON f.group_id = g.id 
  INNER JOIN cscart_product_variation_group_products AS p ON f.group_id = p.group_id 
WHERE 
  p.product_id IN (
    396008, 395983, 309587, 395989, 414436, 
    414408, 414393, 431514, 396058, 414329, 
    396078, 396044, 431590, 414422, 431659, 
    359772, 309590, 359805, 431542, 309585, 
    396002, 414335, 359762, 414429, 414468, 
    431767, 414459, 359808, 414401, 414360, 
    309561, 431605, 396027, 414415, 431734, 
    359744, 396052, 309550, 392230, 392210, 
    392231, 392229, 359752, 392232, 396018, 
    431506, 392255, 392253, 396074, 392252, 
    392254, 359758, 431615, 309576, 366904, 
    389637, 414316, 414488, 414323, 414443, 
    414507, 395996, 431579, 396037, 359478, 
    415577, 391690, 414326, 309567, 414351, 
    396065, 359747, 431667, 415550, 387078, 
    414342, 381626, 309571, 396013, 359779, 
    414534, 387080, 393018, 387083, 430340, 
    359751, 391691, 414541, 391704, 427476, 
    427477, 414525, 387082, 414322, 415554, 
    372040, 393020, 393026, 381634, 393022
  )

Query time 0.00364

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "430.18"
    },
    "nested_loop": [
      {
        "table": {
          "table_name": "p",
          "access_type": "range",
          "possible_keys": [
            "PRIMARY",
            "idx_group_id"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "product_id"
          ],
          "key_length": "3",
          "rows_examined_per_scan": 100,
          "rows_produced_per_join": 100,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "120.12",
            "eval_cost": "20.00",
            "prefix_cost": "140.12",
            "data_read_per_join": "1K"
          },
          "used_columns": [
            "product_id",
            "parent_product_id",
            "group_id"
          ],
          "attached_condition": "(`webmarco`.`p`.`product_id` in (396008,395983,309587,395989,414436,414408,414393,431514,396058,414329,396078,396044,431590,414422,431659,359772,309590,359805,431542,309585,396002,414335,359762,414429,414468,431767,414459,359808,414401,414360,309561,431605,396027,414415,431734,359744,396052,309550,392230,392210,392231,392229,359752,392232,396018,431506,392255,392253,396074,392252,392254,359758,431615,309576,366904,389637,414316,414488,414323,414443,414507,395996,431579,396037,359478,415577,391690,414326,309567,414351,396065,359747,431667,415550,387078,414342,381626,309571,396013,359779,414534,387080,393018,387083,430340,359751,391691,414541,391704,427476,427477,414525,387082,414322,415554,372040,393020,393026,381634,393022))"
        }
      },
      {
        "table": {
          "table_name": "g",
          "access_type": "eq_ref",
          "possible_keys": [
            "PRIMARY"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "id"
          ],
          "key_length": "3",
          "ref": [
            "webmarco.p.group_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 100,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "100.00",
            "eval_cost": "20.00",
            "prefix_cost": "260.12",
            "data_read_per_join": "39K"
          },
          "used_columns": [
            "id",
            "code"
          ]
        }
      },
      {
        "table": {
          "table_name": "f",
          "access_type": "ref",
          "possible_keys": [
            "idx_group_id"
          ],
          "key": "idx_group_id",
          "used_key_parts": [
            "group_id"
          ],
          "key_length": "3",
          "ref": [
            "webmarco.p.group_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 141,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "141.72",
            "eval_cost": "28.34",
            "prefix_cost": "430.18",
            "data_read_per_join": "14K"
          },
          "used_columns": [
            "feature_id",
            "purpose",
            "group_id"
          ]
        }
      }
    ]
  }
}

Result

feature_id purpose product_id parent_product_id id code
860 group_variation_catalog_item 309567 0 7560 PV-76FA2A4F2
860 group_variation_catalog_item 309571 0 7562 PV-28D9DF80C
860 group_variation_catalog_item 309585 0 7567 PV-074F6C61A
860 group_variation_catalog_item 309587 0 7568 PV-B8210268A
860 group_variation_catalog_item 309590 0 7569 PV-5CE76358C
860 group_variation_catalog_item 359478 0 7571 PV-65D409299
548 group_variation_catalog_item 359744 0 7598 PV-B5A8DD285
548 group_variation_catalog_item 359752 0 7600 PV-599A6C7DD
860 group_variation_catalog_item 359758 0 7602 PV-D9B8C456D
860 group_variation_catalog_item 359772 0 7607 PV-FD06EB8A2
548 group_variation_catalog_item 359805 0 7579 PV-B61B324FA
860 group_variation_catalog_item 359805 0 7579 PV-B61B324FA
860 group_variation_catalog_item 359808 0 7559 PV-B2CAA150C
548 group_variation_catalog_item 372040 0 8349 PV-6127F5C21
860 group_variation_catalog_item 372040 0 8349 PV-6127F5C21
860 group_variation_catalog_item 381634 0 8382 PV-8AA4E8C01
548 group_variation_catalog_item 387082 0 8412 PV-C90DAC4E1
626 group_variation_catalog_item 395983 0 9233 PV-DDBD1B6D6
626 group_variation_catalog_item 395989 0 9234 PV-5738168A9
626 group_variation_catalog_item 395996 0 9235 PV-9CF3E7CA7
626 group_variation_catalog_item 396002 0 9236 PV-8F8EDC9C3
626 group_variation_catalog_item 396008 0 9237 PV-72183CD0A
626 group_variation_catalog_item 396013 0 9238 PV-DAE49FF02
626 group_variation_catalog_item 396018 0 9239 PV-45E8E7A30
626 group_variation_catalog_item 396027 0 9240 PV-0A40698C9
626 group_variation_catalog_item 396037 0 9241 PV-4E2566CED
626 group_variation_catalog_item 396044 0 9242 PV-5044AFA95
626 group_variation_catalog_item 396052 0 9243 PV-8FFBD33F4
626 group_variation_catalog_item 396058 0 9244 PV-3E152018F
626 group_variation_catalog_item 396065 0 9245 PV-05DBC6C3B
626 group_variation_catalog_item 396074 0 9247 PV-6088AE5E2
626 group_variation_catalog_item 396078 0 9248 PV-363B8DF86
626 group_variation_catalog_item 414316 0 9786 PV-3547D3A26
626 group_variation_catalog_item 414323 0 9787 PV-D68AC18DE
626 group_variation_catalog_item 414326 0 9788 PV-0ED7C06EF
626 group_variation_catalog_item 414329 0 9789 PV-685D9D679
626 group_variation_catalog_item 414335 0 9790 PV-91E0E7D5C
626 group_variation_catalog_item 414342 0 9791 PV-AF7504623
626 group_variation_catalog_item 414351 0 9792 PV-5DAC33F01
626 group_variation_catalog_item 414360 0 9793 PV-D02234E4B
626 group_variation_catalog_item 414393 0 9797 PV-96F3B6C18
626 group_variation_catalog_item 414401 0 9798 PV-7ECFE6049
626 group_variation_catalog_item 414408 0 9799 PV-8C832FAA1
626 group_variation_catalog_item 414415 0 9800 PV-5D1E40BEB
626 group_variation_catalog_item 414422 0 9801 PV-5D3B7511E
626 group_variation_catalog_item 414429 0 9802 PV-F8A614AFB
626 group_variation_catalog_item 414436 0 9803 PV-4102C17CD
626 group_variation_catalog_item 414443 0 9804 PV-386F0AE72
626 group_variation_catalog_item 414459 0 9806 PV-0726AB9BC
626 group_variation_catalog_item 414468 0 9807 PV-CCEF7BA55
626 group_variation_catalog_item 414488 0 9809 PV-831A64777
626 group_variation_catalog_item 414507 0 9811 PV-DBF4BF096
626 group_variation_catalog_item 414525 0 9815 PV-331648947
626 group_variation_catalog_item 414534 0 9816 PV-3C5B452F1
626 group_variation_catalog_item 414541 0 9817 PV-528FC0668
626 group_variation_catalog_item 431506 0 10686 PV-349CAC8CE
626 group_variation_catalog_item 431514 0 10687 PV-07FF3A2B2
860 group_variation_catalog_item 431514 0 10687 PV-07FF3A2B2
626 group_variation_catalog_item 431542 0 10688 PV-0D41DA79C
860 group_variation_catalog_item 431542 0 10688 PV-0D41DA79C
626 group_variation_catalog_item 431579 0 10692 PV-BAF09A5AD
860 group_variation_catalog_item 431579 0 10692 PV-BAF09A5AD
626 group_variation_catalog_item 431590 0 10690 PV-FAD0AC8E7
860 group_variation_catalog_item 431590 0 10690 PV-FAD0AC8E7
626 group_variation_catalog_item 431605 0 10693 PV-0B19E020D
860 group_variation_catalog_item 431605 0 10693 PV-0B19E020D
626 group_variation_catalog_item 431615 0 10694 PV-6D060D9A9
860 group_variation_catalog_item 431615 0 10694 PV-6D060D9A9
626 group_variation_catalog_item 431659 0 10695 PV-2BEE344E9
860 group_variation_catalog_item 431659 0 10695 PV-2BEE344E9
626 group_variation_catalog_item 431667 0 10696 PV-290E25B55
860 group_variation_catalog_item 431667 0 10696 PV-290E25B55
626 group_variation_catalog_item 431734 0 10700 PV-AB7DA91F3
626 group_variation_catalog_item 431767 0 10703 PV-009E63C5E