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 (
    387039, 339692, 339737, 339535, 339534, 
    339573, 339496, 339617, 339620, 339621, 
    339742, 339611, 339533, 339710, 81689, 
    339587, 339683, 339444, 170248, 387094, 
    339722, 387042, 339570, 339610, 81674, 
    339584, 339771, 170250, 435270, 339638, 
    159865, 339625, 339706, 339529, 339751, 
    387037, 339736, 173787, 339618, 254333, 
    265275, 387092, 339569, 339581, 339615, 
    159861, 339770, 387040, 339705, 339608, 
    205885, 339619, 254332, 258305, 339783, 
    339693, 391684, 339732, 339779, 339759, 
    339607, 170249, 339572, 159863, 254325, 
    159864, 339775, 170247, 339476, 339589, 
    339652, 339571, 254327, 339778, 391687, 
    387089, 170216, 387056, 173789, 391688, 
    387096, 387093, 170251, 387041, 173763, 
    339738, 339456, 339686, 339550, 391689, 
    387098, 339780, 339739, 387045, 339644, 
    339747, 339586, 339630, 391800, 387044
  )

Query time 0.00126

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 (387039,339692,339737,339535,339534,339573,339496,339617,339620,339621,339742,339611,339533,339710,81689,339587,339683,339444,170248,387094,339722,387042,339570,339610,81674,339584,339771,170250,435270,339638,159865,339625,339706,339529,339751,387037,339736,173787,339618,254333,265275,387092,339569,339581,339615,159861,339770,387040,339705,339608,205885,339619,254332,258305,339783,339693,391684,339732,339779,339759,339607,170249,339572,159863,254325,159864,339775,170247,339476,339589,339652,339571,254327,339778,391687,387089,170216,387056,173789,391688,387096,387093,170251,387041,173763,339738,339456,339686,339550,391689,387098,339780,339739,387045,339644,339747,339586,339630,391800,387044))"
        }
      },
      {
        "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
897 group_variation_catalog_item 258305 0 6471 PV-2A8A17131