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 (
    12498, 3317, 3314, 3319, 3316, 3320, 
    3318, 3315, 3321, 3322, 3298, 3299, 
    3329, 3330, 3306, 3305, 3304, 3325, 
    3289, 3287, 3283, 3284, 3285, 3286, 
    3292, 3291, 3300, 3301, 3302, 3326, 
    3295, 3294, 3327, 3297, 3307, 3309, 
    3308, 3293, 3288, 3290, 3303, 3310, 
    3324, 3323, 13136, 15904, 3442, 3441, 
    877, 3500, 3501, 3502, 3504, 3505, 883, 
    884, 3503, 3328, 3311, 3312, 3313, 3515, 
    885, 3519, 3517, 3518, 3520, 3507, 3506, 
    17126, 887, 879, 878, 886, 874, 872, 
    875, 873, 12500, 12499, 15495, 3331
  )

Query time 0.00103

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "114.81"
    },
    "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": 82,
          "rows_produced_per_join": 82,
          "filtered": "100.00",
          "index_condition": "(`dev_yourmart_co_bw`.`p`.`product_id` in (12498,3317,3314,3319,3316,3320,3318,3315,3321,3322,3298,3299,3329,3330,3306,3305,3304,3325,3289,3287,3283,3284,3285,3286,3292,3291,3300,3301,3302,3326,3295,3294,3327,3297,3307,3309,3308,3293,3288,3290,3303,3310,3324,3323,13136,15904,3442,3441,877,3500,3501,3502,3504,3505,883,884,3503,3328,3311,3312,3313,3515,885,3519,3517,3518,3520,3507,3506,17126,887,879,878,886,874,872,875,873,12500,12499,15495,3331))",
          "cost_info": {
            "read_cost": "49.21",
            "eval_cost": "8.20",
            "prefix_cost": "57.41",
            "data_read_per_join": "1K"
          },
          "used_columns": [
            "product_id",
            "parent_product_id",
            "group_id"
          ]
        }
      },
      {
        "table": {
          "table_name": "g",
          "access_type": "eq_ref",
          "possible_keys": [
            "PRIMARY"
          ],
          "key": "PRIMARY",
          "used_key_parts": [
            "id"
          ],
          "key_length": "3",
          "ref": [
            "dev_yourmart_co_bw.p.group_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 82,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "20.50",
            "eval_cost": "8.20",
            "prefix_cost": "86.11",
            "data_read_per_join": "32K"
          },
          "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": [
            "dev_yourmart_co_bw.p.group_id"
          ],
          "rows_examined_per_scan": 1,
          "rows_produced_per_join": 82,
          "filtered": "100.00",
          "cost_info": {
            "read_cost": "20.50",
            "eval_cost": "8.20",
            "prefix_cost": "114.81",
            "data_read_per_join": "8K"
          },
          "used_columns": [
            "feature_id",
            "purpose",
            "group_id"
          ]
        }
      }
    ]
  }
}