To increase a big query's performance (~2 seconds), I cache the result in another table (~0.016 milliseconds), but the result is not always present, so I tried this:
SELECT
IFNULL(
(Query_with_cached_values),
(Big_Slow_Query_with_live_values)
) AS My_cool_result
I tried it on workbench, and while it works, the duration for the cached query is about 1 second, like if it tries both at the same time and aborts the second query. What is the right way to do it, executing just the first, and only if necessary the second?