SELECT 
  f.feature_id, 
  f.purpose, 
  p.product_id, 
  p.parent_product_id, 
  g.id, 
  g.code 
FROM 
  q_product_variation_group_features AS f 
  INNER JOIN q_product_variation_groups AS g ON f.group_id = g.id 
  INNER JOIN q_product_variation_group_products AS p ON f.group_id = p.group_id 
WHERE 
  p.product_id IN (
    47678, 
    47679, 
    47680, 
    47681, 
    47682, 
    47683, 
    47684, 
    47685, 
    47686, 
    47688, 
    47690, 
    47691, 
    47692, 
    47693, 
    47694, 
    47695, 
    47696, 
    47697, 
    47698, 
    47699, 
    47700, 
    47701, 
    47702, 
    47703, 
    47705, 
    47706, 
    47707, 
    47708, 
    47709, 
    47710, 
    47711, 
    47712, 
    47714, 
    47719, 
    47720, 
    47721, 
    47722, 
    47725, 
    47730, 
    47731, 
    47732, 
    47733, 
    47734, 
    47735, 
    47736, 
    47737, 
    47738, 
    47739, 
    47740, 
    47741, 
    47742, 
    47743, 
    47744, 
    47745, 
    47746, 
    47747, 
    47748, 
    47749, 
    47750, 
    47751, 
    47752, 
    47753, 
    47754, 
    47755, 
    47756, 
    47757, 
    47758, 
    47760, 
    47761, 
    47762, 
    47763, 
    47764, 
    47765, 
    47766, 
    47767, 
    47768, 
    47769, 
    47770, 
    47771, 
    47772, 
    47773, 
    47774, 
    45784, 
    45785, 
    45786, 
    45787, 
    45788, 
    45789, 
    45790, 
    45791, 
    45792, 
    45793, 
    45794, 
    45795, 
    45796, 
    45797, 
    45798, 
    45799, 
    45800, 
    45801, 
    45802, 
    45803, 
    45804, 
    45805, 
    45806, 
    45807, 
    45808, 
    45809, 
    45810, 
    45811, 
    45812, 
    45813, 
    45814, 
    45815, 
    45816, 
    45817, 
    45818, 
    45819, 
    45820, 
    45821, 
    45822, 
    45823, 
    45824, 
    45825, 
    45826, 
    45827, 
    45828, 
    45829
  )

Query time 0.00090

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "498.50"
    },
    "nested_loop": [
      {
        "table": {
          "table_name": "p",
          "access_type": "ALL",
          "possible_keys": [
            "PRIMARY",
            "idx_group_id"
          ],
          "rows_examined_per_scan": 922,
          "rows_produced_per_join": 128,
          "filtered": "13.88",
          "cost_info": {
            "read_cost": "165.70",
            "eval_cost": "25.60",
            "prefix_cost": "191.30",
            "data_read_per_join": "2K"
          },
          "used_columns": [
            "product_id",
            "parent_product_id",
            "group_id"
          ],
          "attached_condition": "(`portal`.`p`.`product_id` in (47678,47679,47680,47681,47682,47683,47684,47685,47686,47688,47690,47691,47692,47693,47694,47695,47696,47697,47698,47699,47700,47701,47702,47703,47705,47706,47707,47708,47709,47710,47711,47712,47714,47719,47720,47721,47722,47725,47730,47731,47732,47733,47734,47735,47736,47737,47738,47739,47740,47741,47742,47743,47744,47745,47746,47747,47748,47749,47750,47751,47752,47753,47754,47755,47756,47757,47758,47760,47761,47762,47763,47764,47765,47766,47767,47768,47769,47770,47771,47772,47773,47774,45784,45785,45786,45787,45788,45789,45790,45791,45792,45793,45794,45795,45796,45797,45798,45799,45800,45801,45802,45803,45804,45805,45806,45807,45808,45809,45810,45811,45812,45813,45814,45815,45816,45817,45818,45819,45820,45821,45822,45823,45824,45825,45826,45827,45828,45829))"
        }
      },
      {
        "table": {
          "table_name": "g",
          "access_type": "eq_ref",
          "possible_keys": [
            "PRIMARY"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "id"
          ],
          "key_length": "4",
          "ref": [
            "portal.p.group_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 128,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "128.00",
            "eval_cost": "25.60",
            "prefix_cost": "344.90",
            "data_read_per_join": "98K"
          },
          "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": "4",
          "ref": [
            "portal.p.group_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 128,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "128.00",
            "eval_cost": "25.60",
            "prefix_cost": "498.50",
            "data_read_per_join": "14K"
          },
          "used_columns": [
            "feature_id",
            "purpose",
            "group_id"
          ]
        }
      }
    ]
  }
}