MySQL CTE function call duplicated
I expected the function call "expensive" to be called only once, but it appears to be called for every row in "children". Can the CTE/query be tweaked to only call the function once and have that value returned for every…