PostgreSQL Batch UPSERT with CTE: From 90 Seconds to 5
An email sync process with audit history was rewritten from separate queries into a single PostgreSQL CTE, cutting 100k-row processing time from 90 seconds to 5.
postgresqlsqlgodatabase-performance