---
title: "How 'RETURNING' yielded a 9x performance improvement"
publication: "Postgres Weekly"
issue: 360
published_at: "2020-06-17"
canonical_url: "https://postgresweekly.com/issues/360"
---

This week's Postgres news, views, and tools.       

#360 — June 17, 2020 

[Read on the Web](https://postgresweekly.com/issues/360)   

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/v1592353852/fcvz8isytnc7mmlufysc.png)](http://jepsen.io/analyses/postgresql-12.3)  

[Jepsen Finds a Bug in Postgres 12.3](http://jepsen.io/analyses/postgresql-12.3) — The name ‘Jepsen’ is sure to stir emotions in any database server creator as their analyses of distributed systems (such as databases!) often reveal all sorts of edge cases and flaws. And so it goes with Postgres with a bug in serializable isolation being found. This is technical stuff, but it’s great to see systems like Postgres placed under such rigorous analysis. 

Kyle Kingsbury   

[How One Word in Postgres Unlocked a 9x Performance Improvement](https://jlongster.com/how-one-word-postgresql-performance) — The creator of a personal finance tool experienced a user whose data caused a flood of `INSERT`s large enough to cause a problem. Here’s the tale of how a simple `RETURNING` clause enabled a huge optimization in the process. 

James Long   [![\](https://copm.s3.amazonaws.com/5c464be5.jpg)](https://www.cockroachlabs.com/webinars/distributed-sql-a-modern-cloud-native-postgresql?utm_campaign=cooperpress-2020-Q2&utm_source=postgresweekly&utm_medium=newsletter&utm_content=postgressweekly-primary-scaling-postgres-webinar) 

[Webinar | Distributed SQL: A Modern, Cloud-Native PostgreSQL](https://www.cockroachlabs.com/webinars/distributed-sql-a-modern-cloud-native-postgresql?utm_campaign=cooperpress-2020-Q2&utm_source=postgresweekly&utm_medium=newsletter&utm_content=postgressweekly-primary-scaling-postgres-webinar) — Hitting challenges scaling PostgreSQL, deploying it in the cloud, or using it with microservice architecture? A Distributed SQL database might be a better fit for your workload. Tune in tomorrow, June 18, for an architecture review and live demo. 

COCKROACH LABS sponsor   

[Citus 9.3 Released: The Postgres Horizontal Scaling Extension](https://www.citusdata.com/blog/2020/06/13/citus-9-3-release-notes/) — Citus is the now Microsoft-owned Postgres extension that turns Postgres into a _distributed_ database that can be more powerfully used across multiple servers. 9.3 improves the distributed SQL support, now with full support for window functions. 

citusdata   

[XgeneCloud: Instant REST and GraphQL APIs on any Database](https://github.com/xgenecloud/xgenecloud) — Where ‘any’ includes Postgres, naturally :-) There’s quite a lot of pieces to this and they seem to be forming [a company](https://xgenecloud.com/) around the tech, but it’s open source nonetheless. 

xgenecloud   

[Understanding User Management in PgBouncer](https://www.2ndquadrant.com/en/blog/understanding-user-management-in-pgbouncer/) — [PgBouncer](https://www.pgbouncer.org/) is a popular connection proxy and pooler for Postgres, but it doesn’t _just_ pass things straight through to Postgres, it can handle authentication directly itself. This article clears up how that works. 

Peter Eisentraut   

[Controlling Runaway Queries with Statement Timeouts](https://info.crunchydata.com/blog/control-runaway-postgres-queries-with-statement-timeout) — A well tuned database on good hardware is easily capable of many thousands of queries per second but long lived queries can quickly cause things to back up. Here’s one defense against queries that want to live forever. 

Craig Kerstiens   

[A Free, Multi-Node, Petabyte Scale, Time-Series Database on Postgres](https://tsdb.co/multi-node-announcement) — [Read more about Timescale’s multi-node time-series database](https://tsdb.co/multi-node-announcement) and why they’re making it available for free. 

Timescale sponsor   

[Controlling Server Variables at Connection Time](https://momjian.us/main/blogs/pgblog/2020.html#June_15_2020) — A brief tip, this. For example: `psql 'options=-cwork_mem=100MB dbname=test'` 

Bruce Momjian   

[Composite Data Type Performance Issues in Postgres](https://www.cybertec-postgresql.com/en/composite-type-performance-issues-in-postgresql/) 

Hans-Jürgen Schönig   

[Running `pgbackrest` on FreeBSD](https://fluca1978.github.io/2020/06/12/pgbackrestOnFreeBSD.html) — [pgbackrest](https://pgbackrest.org/index.html) is a backup and restore system for Postgres. 

Luca Ferrari   

[pq: The Pure Go(lang) Postgres Driver for `database/sql`](https://github.com/lib/pq) — Now supports GSS authentication. 

Blake Mizerany and contributors     

🗓**Upcoming Online Events** 

- [Postgres Vision 2020](https://www.postgresvision.com/) on June 23-24. A full attempt at an online Postgres conference across multiple days with multiple tracks.
- [Postgres Pulse](https://www.enterprisedb.com/postgres-pulse) - Zoom-based sessions with folks like Bruce Momjian, Vibhor Kumar, and other people at EnterpriseDB. Now running every other week at 11am ET on Mondays. The next is on June 29.          

Curated by [Cooperpress](https://cooperpress.com/), [Peter Cooper](https://twitter.com/peterc), and [Craig Kerstiens](https://twitter.com/craigkerstiens). 

[Change your email address](https://postgresweekly.com/edit_subscription/*|UID|*) or[Stop getting this newsletter](https://postgresweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
