From the course: Advanced SQL for Data Scientists
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Function volatility
From the course: Advanced SQL for Data Scientists
Function volatility
- [Instructor] Function volatility is something we need to consider with regards to optimizing the performance of our functions. Now, functions have a volatility classification and basically this classification is essentially like a promise or an indication of what kind of behaviors the function performs, or more practically, the kinds of things it won't do. This allows the optimizer to make certain assumptions about what optimizations are safe for that particular function. Now, there are three classifications: volatile, stable, and immutable. If you don't specify a classification, volatile is the default classification. A volatile function can perform any operation, including making changes to the database. So you can insert, you can update, you can delete. And this is because the optimizer doesn't make any assumptions about the function in terms of optimizing the way the code might run. And this is something to keep in…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Extending SQL with user-defined functions3m 6s
-
(Locked)
SQL query functions8m 40s
-
(Locked)
Function overloading5m 41s
-
(Locked)
Function volatility4m 2s
-
(Locked)
PL/Python functions3m 44s
-
(Locked)
Challenge: Write a user-defined function34s
-
(Locked)
Solution: Write a user-defined function1m 35s
-
(Locked)
-
-