Riscrivi e verifica quale funziona più velocemente:
SELECT *, storedfunc(param, table.column) AS f
FROM table
WHERE storedfunc(param, table.column) < value
ORDER BY f ;
SELECT *
FROM
( SELECT *, storedfunc(param, table.column) AS f
FROM table
) AS tmp
WHERE f < value
ORDER BY f ;
In MySQL, puoi persino scrivere in questo modo (avviso:SQL non standard sintassi):
SELECT *, storedfunc(param, table.column) AS f
FROM table
HAVING f < value
ORDER BY f ;