SELECT 
  name as review_username, 
  comment as review_comment, 
  last_review_timestamp 
FROM 
  cscart_product_last_review 
WHERE 
  product_id = 29949

Query time 0.03928

JSON explain

{
  "query_block": {
    "select_id": 1,
    "nested_loop": [
      {
        "table": {
          "table_name": "cscart_product_reviews",
          "access_type": "ref",
          "possible_keys": ["PRIMARY", "idx_product_id"],
          "key": "idx_product_id",
          "key_length": "3",
          "used_key_parts": ["product_id"],
          "ref": ["const"],
          "rows": 2,
          "filtered": 100
        }
      },
      {
        "table": {
          "table_name": "<subquery3>",
          "access_type": "eq_ref",
          "possible_keys": ["distinct_key"],
          "key": "distinct_key",
          "key_length": "3",
          "used_key_parts": ["list_review_id"],
          "ref": ["dev_db.cscart_product_reviews.product_review_id"],
          "rows": 1,
          "filtered": 100,
          "materialized": {
            "unique": 1,
            "query_block": {
              "select_id": 3,
              "temporary_table": {
                "nested_loop": [
                  {
                    "table": {
                      "table_name": "p",
                      "access_type": "ALL",
                      "rows": 25675,
                      "filtered": 100,
                      "attached_condition": "p.`status` = 'A'"
                    }
                  }
                ]
              }
            }
          }
        }
      }
    ]
  }
}

Result

review_username review_comment last_review_timestamp
Hoai Tran ôi đã sử dụng Dầu Gội Gừng Tươi Thuần Mộc cho tóc dầu trong một thời gian và tôi rất hài lòng với kết quả. Đầu tiên, mùi của dầu gội rất thơm và tươi mát, mang lại cảm giác sảng khoái sau khi sử dụng. Dầu gội này có thành phần tự nhiên, đặc biệt là gừng tươi, giúp làm sạch da đầu và tóc một cách nhẹ nhàng. Nó không chỉ loại bỏ dầu thừa mà còn giúp cân bằng dầu tự nhiên trên da đầu, giảm tình trạng tóc dầu và bết dính. 1691564067