#​543 — February 21, 2024

Web Version

Together with  Hasura

Postgres Weekly

SQL Query Optimization: A Comprehensive Developer's Guide — A bumper packed post digging into the optimization of SELECT, INSERT, and DELETE queries, covering areas like using indexes, paginating results, avoiding joins, and how window functions can help (or not). It’s not Postgres-only but clearly written with Postgres in mind.

Francesco Tisiot / Aiven

What's Faster? COUNT(*) or COUNT(*) with LIMIT — SQL guru Lukas Eder looks at the execution plans and runs benchmarks to see if using a LIMIT clause is useful when checking for existence of N values in SQL. Spoiler: Yes.

Lukas Eder

Instant Realtime GraphQL APIs on PostgreSQL with Hasura — Connect Hasura to your PostgreSQL database and get a secure and highly performant GraphQL API. Query tables and views with filtering, sorting, pagination, aggregations and more. Instantly pull any real-time changes to your data with subscriptions.

Hasura sponsor

A Story of a Spectacular Success in Migrating to AWS RDS — Being based on EC2 already, this isn’t your typical on-prem to cloud migration story, but it’s interesting to see what moving five clusters covering 54 applications with terabytes of live data over to RDS entailed.

Karol Galanciak (BookingSync SAS)

IN BRIEF:

Creating 'Last Updated' Columns in Postgres — If you want an automatically updated updated_at timestamp column in your table, you don’t have to use a trigger (though you probably should..)

Gunnar Morling

Deciphering Postgres Encryption: A Beginner's Guide — A (very) casual look at six levels of encryption that can be used with Postgres, from basic things like passwords being hashed through to disk-level encryption and encrypting the data within the database itself.

Tristen Raab

Fan-Out from Postgres with Change Data Capture using Debezium and Upstash Redis
Evan Shortiss (Neon)

Amazon Aurora vs. RDS: Understanding the Difference
Carlo Mencarelli (Timescale)

📰 Classifieds

📢 Free Distributed Postgres DB with 3 node cluster and 1-click provisioning across 3 regions from pgEdge Cloud. Sign up and get a cool t-shirt.


⚡Learn how to use prepared statements on PgBouncer 1.22.0 to increase throughput and optimize your queries in Postgres using Neon.


📢 Using Redis as a Postgres cache? Readyset Cloud makes query caching easier without query optimization or app rewrites. Try for free today.

🛠 Code and Tools

PostgreSQL Anonymizer: Data Masking for Postgres — Rather than simply anonymizing dumps, say, this extension takes anonymization directly to your database by having you declare masking rules directly against your schema. (Git repo.)

Dalibo

libpqxx 7.9: The Official C++ Client API for Postgres — It’s a pretty big release, says the maintainer, and the last one to support C++17 with libpqxx 8.0 set to demand C++20. Main repo.

Jeroen Vermeulen

Schemalint 1.1: A Linter for Postgres Schemas — A linter that lets you raise errors on issues like casing or column types (so think more like ESLint than a basic formatter).

Kristian Dupont

pgexporter 0.5: Prometheus Exporter for Postgres — As of v0.5, it’s targeting Postgres 12 and higher and now supports client certificates for TLS.

Red Hat

  • pgmoneta 0.9 – The backup/restore tool gets an update to improve TLS support, as with pgexporter above.

  • ruby-pg 1.5.5 – The Postgres client library for Ruby.