From the online books:
We have some functions that look things up in the database, and seem to work correctly. So I would be really surprised if this is true. asked 10 Dec '09, 20:25 Jon Greisz Zote |
Yes, Jon, they do. Unless the function is declared as answered 11 Dec '09, 03:06 Glenn Paulley The phrase "free to cache" does not mean the server will re-use the results, just that it can, correct? So if you are expecting NOT DETERMINISTIC behavior, but the function is declared or defaulted to DETERMINISTIC, you may or may not get function caching / result re-use... correct? Interesting, I'll need to have someone check our functions and add the not deterministic. Thanks, Jon |
As Breck indicated, "free to cache" means that the server may (or may not) re-execute the UDF when another invocation of the function is made with the same parameters. The server maintains an LRU cache of function parameters and the function's result, and will perform a look-aside into the cache before it goes to the effort of creating a new procedure context and re-executing the procedure. If you label a UDF as answered 11 Dec '09, 15:42 Glenn Paulley |