In this chapter, a number of query optimizations were discussed. You have learned about the optimizer and about various internal optimizations, such as constant folding, view inlining, joins, and a lot more. All of these optimizations contribute to good performance and help speed things up considerably.
Now that we've covered this introduction to optimizations, Chapter 7, Writing Stored Procedures, will be about stored procedures. You will see the options PostgreSQL has available to handle user-defined code.