I've got a query which does a join like this:

```
LEFT JOIN history ON history.item_id=item.id AND history.date=(SELECT MAX(date) FROM history WHERE item_id=item.id)

```

Is MySQL smart enough to execute the `SELECT MAX...` subquery only once?

---

**Edit:** Sorry, I should have mentioned the `WHERE` on the overall `SELECT` specifies a singular item id:

```
WHERE item.id=XXX

```