Skip to Content
Course content

Before a query is planned, it passes through the rewriter. This chapter explores how PostgreSQL implements views and rules by transforming parse trees into query trees. We will analyze the differences between the rule system and triggers, and how the rewriter flattens views for optimization.

Outside Reading

  • Official Docs: Chapter 41: The Rule System. (Mandatory reading on how views are purely logical ON SELECT DO INSTEAD rules).
  • GitHub Source: src/backend/rewrite/rewriteHandler.c. Focus on the QueryRewrite() function block comments explaining how parse trees are flattened.
Rating
0 0

There are no comments for now.

to be the first to leave a comment.

Additional Resources
Join this Course to access resources