Functions
- aka stored procedures
- Avoid whenever possible - expense + looping troubles
- To use in an index, mark it immutable
- Stable (within a transaction) now()
- Volatile - default form, if it changes within a scan (or has side effects)
- Alternatives:
- Application
- Internal functions
- SQL commands
- Temporary tables
- Move to outer (e.g. left join)
Previous: Optimizer example
[Table of Contents]
Next: Indexes