SELECT 
  pfv.feature_id, 
  pfv.product_id, 
  pfv.variant_id, 
  gp.group_id 
FROM 
  cscart_product_features_values AS pfv 
  INNER JOIN cscart_product_variation_group_products AS gp ON pfv.product_id = gp.product_id 
  INNER JOIN cscart_product_variation_group_features AS gpf ON gpf.group_id = gp.group_id 
  AND gpf.feature_id = pfv.feature_id 
WHERE 
  pfv.lang_code = 'vi' 
  AND gp.group_id IN (
    12507, 15469, 16846, 16499, 13546, 12914, 
    13404, 13545, 12496, 16932, 15473, 
    15474, 12718, 12719, 12158, 12692, 
    13446, 13413, 12717
  )

Query time 0.01496

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "gp",
          "access_type": "range",
          "possible_keys": ["PRIMARY", "idx_group_id"],
          "key": "idx_group_id",
          "key_length": "3",
          "used_key_parts": ["group_id"],
          "rows": 82,
          "filtered": 100,
          "index_condition": "gp.group_id in (12507,15469,16846,16499,13546,12914,13404,13545,12496,16932,15473,15474,12718,12719,12158,12692,13446,13413,12717)"
        }
      },
      {
        "table": {
          "table_name": "gpf",
          "access_type": "ref",
          "possible_keys": ["PRIMARY", "idx_group_id"],
          "key": "idx_group_id",
          "key_length": "3",
          "used_key_parts": ["group_id"],
          "ref": ["dev_db.gp.group_id"],
          "rows": 1,
          "filtered": 100
        }
      },
      {
        "table": {
          "table_name": "pfv",
          "access_type": "ref",
          "possible_keys": [
            "PRIMARY",
            "fl",
            "lang_code",
            "product_id",
            "fpl",
            "idx_product_feature_variant_id"
          ],
          "key": "idx_product_feature_variant_id",
          "key_length": "12",
          "used_key_parts": ["product_id", "feature_id", "lang_code"],
          "ref": ["dev_db.gp.product_id", "dev_db.gpf.feature_id", "const"],
          "rows": 1,
          "filtered": 100,
          "attached_condition": "pfv.lang_code = 'vi'",
          "using_index": true
        }
      }
    ]
  }
}

Result

feature_id product_id variant_id group_id
19627 14825 68244 12158
19627 14824 68243 12158
19627 14823 68242 12158
19627 14822 68241 12158
19627 6578 68245 12158
19995 16579 69892 12496
19995 16577 69891 12496
19995 16576 69890 12496
19995 5569 69890 12496
20008 50076 69928 12507
20008 50077 69929 12507
20008 5549 69930 12507
20234 18201 70814 12692
20234 4578 70813 12692
20259 18255 70892 12717
20259 18254 70891 12717
20259 18253 70890 12717
20259 18252 70889 12717
20259 4441 70893 12717
20260 18257 70895 12718
20260 18256 70894 12718
20260 4440 70896 12718
20261 18259 70898 12719
20261 18258 70897 12719
20261 4439 70899 12719
20464 18770 71581 12914
20464 18769 71579 12914
20464 3874 71580 12914
21012 21014 73411 13404
21012 21013 73412 13404
21012 2514 73410 13404
21021 21032 73438 13413
21021 21031 73439 13413
21021 2505 73437 13413
21054 21081 73521 13446
21054 2461 73520 13446
21159 21549 74005 13545
21159 2287 74004 13545
21160 21550 74006 13546
21160 2278 74007 13546
23353 32603 81017 15469
23354 32603 81023 15469
23353 27863 81017 15469
23354 27863 81022 15469
23353 32604 81018 15469
23354 32604 81022 15469
23353 32605 81018 15469
23354 32605 81023 15469
23353 32606 81019 15469
23354 32606 81022 15469
23353 32607 81019 15469
23354 32607 81023 15469
23353 32608 81020 15469
23354 32608 81022 15469
23353 32609 81020 15469
23354 32609 81023 15469
23353 32610 81021 15469
23354 32610 81022 15469
23353 32611 81021 15469
23354 32611 81023 15469
23357 32620 81033 15473
23357 6059 81032 15473
23357 32621 81034 15473
23357 32622 81033 15474
23357 6060 81032 15474
23357 32623 81034 15474
24241 389 84471 16499
24241 41611 84472 16499
24621 45507 85931 16846
24621 45532 85932 16846
24705 46761 86169 16932
24706 46761 86173 16932
24705 46759 86169 16932
24706 46759 86171 16932
24705 46758 86169 16932
24706 46758 86170 16932
24705 46756 86168 16932
24706 46756 86176 16932
24705 46760 86169 16932
24706 46760 86172 16932
24705 46757 86168 16932
24706 46757 86177 16932
24705 46753 86168 16932
24706 46753 86173 16932
24705 46754 86168 16932
24706 46754 86174 16932
24705 46752 86168 16932
24706 46752 86172 16932
24705 46755 86168 16932
24706 46755 86175 16932
24705 46751 86168 16932
24706 46751 86171 16932
24705 46738 86168 16932
24706 46738 86170 16932
24705 46765 86169 16932
24706 46765 86177 16932
24705 46764 86169 16932
24706 46764 86176 16932
24705 46763 86169 16932
24706 46763 86175 16932
24705 46762 86169 16932
24706 46762 86174 16932