HAVING works *AFTER* all records have been selected, so it is much much less efficient than using WHERE, even with the re-calculation.
You should *not* assume that MySQL will actually *do* the re-calculation. The query optimizer may well realize you are using the same expression in both the SELECT and the WHERE and cache the result obtained when doing the WHERE for use by the SELECT. Certainly SQL Server will do this, though let's face it: MySQL is not in the same class as SQL Server.
But in any case, why do you think that such a simple math operation will be "expensive" in terms of performance? Almost surely, even a LIKE condition will cost much much more CPU time. That is, doing
Code:
SELECT ... FROM table WHERE field LIKE '%something%'
is probably one of *the* most expensive things you can do. Because MySQL *WILL* examine EACH AND EVERY RECORD in the entire table. It can not use an index with that kind of LIKE (it can use an index with LIKE 'xxx%' where the % is only on the end). On top of that, any kind of string comparison operation has to be done all in software, whereas your math operation can be done by the hardware (assuming, that is, that your numbers are *NOT* DECIMAL or NUMBER and are instead either INT or REAL/FLOAT).
In your own query, if all three of your columns are indexed, it *probably* can do the WHERE clause using only the indexes. (Maybe not; MySQL isn't very clever about index usage. But it would be worth a try.)
In any case, learn to use MySQL's
EXPLAIN capability: This will tell you when MySQL is using indexes and when it can't.