From the course: Advanced SQL for Data Scientists

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Function volatility

Function volatility

From the course: Advanced SQL for Data Scientists

Start my 1-month free trial

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…

Contents