I haven't checked if this works in mysql, but in postgres I would certainly reach for an index on the computed values, which it supports.
Index the thing you're querying on...
Index the thing you're querying on...
> The optimal indexing strategy always depends on the application, but in general, it's best to have indexes on the conditions you are frequently querying against. [...] This makes redundant conditions useful for queries that are only sometimes run or where indexes can't be easily added to the main conditions.