The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Email Subscription

    Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 719 other subscribers

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:

  1. [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)
  2. [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