1. What is the primary benefit of using PostgreSQL's FILTER clause for conditional aggregates?
- It allows queries to run faster on full table scans.
- It is standard standard SQL, cleaner, and more optimized than CASE WHEN statements inside aggregates.
- It automatically creates partial indexes.
- It bypasses the GROUP BY requirement.
Hint: The FILTER clause (e.g. SUM(amount) FILTER (WHERE active = true)) is standard SQL, executes cleaner than CASE statements, and is easy to read.