MySQL function result reuse in expressions?
Posted by jpluimers on 2024/07/18
I love how Kris answers with these concise bits of SQL query results, this time about the sleep function and expression reuse of function results:
- [Wayback/Archive] Kris on Twitter: “libera/#mysql: “Hello! Does mysql reuse the result of expression evaluation during query execution?…”
mysql> select sleep(1)+sleep(1) as s; +---+ | s | +---+ | 0 | +---+ 1 row in set (2.00 sec) - [Wayback/Archive] Kris on Twitter: “… suggests an index on
sleep“
Reference: [Wayback/Archive] MySQL :: MySQL 8.0 Reference Manual :: 12.24 Miscellaneous Functions
–jeroen






Leave a comment