---
title: "A top cause of slow Postgres queries"
publication: "Postgres Weekly"
issue: 583
published_at: "2025-01-09"
canonical_url: "https://postgresweekly.com/issues/583"
---

Plus a big release for PostgreSQL Anonymizer. |        

#​583 — January 9, 2025 

[Web Version](https://postgresweekly.com/issues/583)   

Happy New Year! In case you missed [our previous issue](https://postgresweekly.com/issues/582), we've moved _Postgres Weekly_ to Thursdays to better catch the latest Postgres news (a lot of big releases were happening on Wednesdays), so we're now back with you every Thursday till spring :-)
__
_Peter Cooper_  

Together with [![Microsoft logo\](https://res.cloudinary.com/cpress/image/upload/c_fill,g_auto,w_280,h_60/e_make_transparent/co_white,e_outline:7/om9hjsmudy5lsvba59eb.png)](https://posetteconf.com/2025/cfp/)   

Postgres Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/jeyrzliod836uatrt6rp.jpg)](https://www.postgresql.org/about/news/announce-pig-the-postgres-extension-wizard-2988/)  

[PIG: A New Package Manager for Postgres](https://www.postgresql.org/about/news/announce-pig-the-postgres-extension-wizard-2988/) — _Postgres Install Genius_ is a new package manager built to make it easier to get [hundreds of Postgres extensions](https://ext.pigsty.io/#/list) up and running on [a mainstream Linux-based](https://github.com/pgsty/pig?tab=readme-ov-file#compatibility) Postgres install. It’s from the [Pigsty](https://pigsty.cc/) folks, but doesn’t require using their specialized Postgres distribution. Note that this is just one of a variety of similar efforts and is not an _official_ solution. 

Pigsty   

[How to Fix a Common Cause of Slow Queries in Postgres](https://render.com/blog/postgresql-top-cause-slow-queries) — A database engineer at the _Render_ cloud platform shows off a commonly encountered, but trivially fixed, performance issue caused by missing indexes on foreign keys. 

Eric Fritz   [![\](https://res.cloudinary.com/cpress/image/upload/c_limit,w_480,h_480,q_auto/copm/6ede97eb.png)](https://posetteconf.com/2025/cfp/) 

[POSETTE 2025: Call for Proposals (CFP) is Open!](https://posetteconf.com/2025/cfp/) — [POSETTE: An Event for Postgres](https://posetteconf.com/2025), a free & virtual developer event organized by the Postgres team at Microsoft, is happening June 10-12. The CFP is open **until February 9**. New and experienced speakers are encouraged to submit! [Get the details](https://posetteconf.com/2025/cfp/). 

Microsoft sponsor   

**QUICK BITS:** 

- 🎧 The CEO of Hydra and an engineer from MotherDuck [went on the Postgres FM podcast to discuss pg_duckdb,](https://postgres.fm/episodes/pg_duckdb) and the benefits of bringing DuckDB into Postgres.
- Crunchy Data's Elizabeth Christensen reflects [on the myriad of uses for the term 'vector'](https://www.crunchydata.com/blog/name-collision-of-the-year-vector), not least in the database space.
- 🇺🇸 PGDay Chicago is taking place this April 25 and [its CFP is open](https://2025.pgdaychicago.org/callforpapers/) until January 20 if you'd like to speak.
- ⚡ Abhishek Chanda looks at how you could [measure the _power usage_ of Postgres queries.](https://achanda.dev/posts/pg_power_basic_setup/)   

[Postgres 18 to Get Backend-Level Statistics](https://bdrouvot.github.io/2025/01/07/postgres-backend-statistics-part-1/) — Barring any unforeseen problems, Postgres 18 (likely due late in 2025) will be gaining some improved backend statistics, including a new `pg_stat_get_backend_io` function to see the I/O activity in each server backend. 

Bertrand Drouvot   

📄 [The Challenges of Postgres Containers](https://ardentperf.com/2024/12/31/challenges-of-postgres-containers/) – _“Combined with a good Kubernetes operator, Postgres containers are production ready today.”_ Jeremy Schneider 

📄 [Running an Async Web Query Queue with Procedures and `pg_cron`](https://www.crunchydata.com/blog/running-an-async-web-query-queue-with-procedures-and-pg_cron) Paul Ramsey 

📄 [Waiting for Postgres 18: Add UUID Version 7 Generation Function](https://www.depesz.com/2024/12/31/waiting-for-postgresql-18-add-uuid-version-7-generation-function/) Hubert depesz Lubaczewski 

📄 [Why We Ditched `etcd` for Postgres for Storing Metadata](https://risingwave.com/blog/risingwave-replaces-etcd-postgres/) RisingWave Labs 

📄 [Why Isn’t My Query Benefiting from Partition Pruning?](https://stborden.wordpress.com/2024/12/18/why-isnt-my-query-benefiting-from-partition-pruning/) Shane Borden 

📄 [How to Tell What Port Postgres is Running On](https://www.timescale.com/blog/how-to-tell-what-port-postgresql-is-running-on) Semab Tariq    

🛠 Code and Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60,q_auto/wzyrlqjeiover3nktqpo.jpg)](https://postgresql-anonymizer.readthedocs.io/en/stable/)  

[PostgreSQL Anonymizer 2.0: Data Masking for Postgres](https://postgresql-anonymizer.readthedocs.io/en/stable/) — Rather than simply anonymizing dumps, this extension takes anonymization directly to your database by having you declare [masking rules](https://postgresql-anonymizer.readthedocs.io/en/stable/declare_masking_rules/) directly against your schema. [Version 2.0](https://www.postgresql.org/about/news/postgresql-anonymizer-20-better-faster-safer-2993/) is a complete rewrite using Rust and PGRX and features improved fake data generation, role-based transparent dynamic masking, anonymized exports with `pg_dump`, and more. 

Dalibo   

[pgspot 0.9: Spot Vulnerabilities in Postgres Extension Scripts](https://github.com/timescale/pgspot) — Created by a Timescale engineer for finding vulnerabilities in TimescaleDB, this is an analysis tool for SQL scripts that checks for vulnerabilities and best practices. v0.9 bumps it up to the Postgres 17 parser and fixes some bugs. 

Sven Klemm (Timescale)   

[SQLite Foreign Data Wrapper for Postgres v2.5](https://github.com/pgspider/sqlite_fdw) — Requires a Linux or POSIX-compliant system, but now supports Postgres 17 as well as some extra data types like `uuid`, `bit` and `varbit`. 

PGSpider   

[Sqitch 1.5: Database Change Management Tool](https://github.com/sqitchers/sqitch) — A database and framework independent (Postgres 8.4+ is supported) system for managing database and schema changes via SQL scripts. Here’s [how it works with Postgres.](https://github.com/sqitchers/sqitch/blob/develop/lib/sqitchtutorial.pod) 

Sqitch   

- [libpqxx 7.10.0](https://github.com/jtv/libpqxx/releases/tag/7.10.0) – A notable release for the official C++ client API for Postgres.
- [River 0.15](https://github.com/riverqueue/river) – Fast and reliable Postgres-powered background jobs for Go.
- [pgxmock 4.4](https://github.com/pashagolub/pgxmock) – Mock driver to test Postgres interactions in Go.
- [Postgres NIO 1.23.0](https://github.com/vapor/postgres-nio/releases/tag/1.23.0) – Non-blocking, event-driven client for Swift.
- [Bytebase 3.2](https://github.com/bytebase/bytebase/releases/tag/3.2.0) – Database devops and CI/CD system for teams.
- [pg_timetable 5.10.0](https://github.com/cybertec-postgresql/pg_timetable/releases/tag/v5.10.0) – Advanced scheduling extension.
- [DoltgreSQL 0.16](https://github.com/dolthub/doltgresql) – Version-controlled Postgres-a-like.
- [Hasql 1.9](https://github.com/nikita-volkov/hasql/blob/master/CHANGELOG.md#19) – High-perf Postgres driver for Haskell.
- [pg_partman 5.2.4](https://www.postgresql.org/about/news/pg_partman-524-released-2995/)    

**Got a new email?** You can [change your address here](https://postgresweekly.com/edit_subscription/*|UID|*). 

--- 

**Bored of us?** [Click here to stop getting Postgres Weekly](https://postgresweekly.com/leave/*|UID|*). 

--- 

**Got a link for us?** Reply and tell us. We can't include everything but we'll look at anything you send. _Thanks!_ 

--- 

Published by Cooper Press Ltd.
Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom 

Postgres, PostgreSQL and the Slonik Logo are trademarks or registered trademarks of the PostgreSQL Community Association of Canada. 

[Stop getting this newsletter](https://postgresweekly.com/leave/*|UID|*).
