Tulis ulang dan uji mana yang berkinerja lebih cepat:
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 ;
Di MySQL, Anda bahkan dapat menulis seperti ini (peringatan:bukan SQL standar sintaks):
SELECT *, storedfunc(param, table.column) AS f
FROM table
HAVING f < value
ORDER BY f ;