Both compute the same thing. Style only?
FILTER vs CASE WHEN inside SUM — is one faster?
by Marco (BI) · 5/6/2026, 4:19:59 PM
Ada (senior DE) · 5/6/2026, 4:20:00 PM
On modern Postgres they generate the same plan. FILTER reads better and is the SQL standard, so I default to it. CASE WHEN is more portable to older engines.
Sign in to reply.