SQL Beyond SELECT: Window Functions, CTEs, and Query Optimization
Member only
Learning Objectives
By the end of this chapter, you will be able to:
- Write window functions that rank, compare, and aggregate rows without collapsing your result set
- Understand the difference between
ROWSandRANGEframe modes and know exactly when each one changes your results - Write both non-recursive and recursive CTEs, including safe traversal of hierarchical and graph data
- Read a PostgreSQL query plan produced by
EXPLAIN ANALYZEand identify the specific operation causing a slow query - Decide when an index will help a query and when it will silently make writes slower for
Become a member to read this article, and all of LyncMe.
This article is behind our membership paywall. It's only available with a Pro membership, which comes with a host of benefits:
Access all member-only learning resources on LyncMe
Read everything on LyncMe, including member-only articles
Unlimited services, links, and advanced features
Priority support and no commission on payments
Already a member? Sign in
