1

READS SQL DATA means the routine contains statements that read data (for example, SELECT), but not statements that write data.

I understand what it means, but what is the advantage to the user? Does the function execute faster if declared?

I also use "DETERMINISTIC" with "READS SQL DATA" as "DETERMINISTIC" is for caching purposes. I can only assume that after the function is called, if you declare "READS SQL DATA" it does not update the buffer pool regarding the results of the function if called again.

Justin Levene
  • 1,630
  • 19
  • 17
  • 1
    Does this answer your question? [DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled](https://stackoverflow.com/questions/26015160/deterministic-no-sql-or-reads-sql-data-in-its-declaration-and-binary-logging-i) – Luuk Apr 26 '22 at 15:48
  • 1
    DETERMINISTIC does not do any caching. See my answer to https://stackoverflow.com/a/71452325/20860 – Bill Karwin Apr 26 '22 at 15:50
  • "A routine is considered “deterministic” if it always produces the same result for the same input parameters" which means it temporarily caches the result – Justin Levene Apr 28 '22 at 20:12

0 Answers0