Reads Causing Writes in Postgres(jesipow.com) It is good practice to regularly inspect the statements running in the hot path of your Postgres instance. One way to do this is to examine the pg_stat_statements view, which shows various statistics about the SQL statements executed by the Postgres server.
224 points by thunderbong 27 days ago | 28 comments
Shrinking a Postgres Table(johnnunemaker.com) Ok folks, this is kind of a weird one. I'm going to put it in the "you won't ever need this, but if you do, you are going to be glad I wrote this up for ya" category.
Running Durable Workflows in Postgres Using DBOS(supabase.com) Michael Stonebraker is the inventor of Postgres and a Turing Award winner. His latest venture is DBOS, a three-year joint research project between Stanford and MIT. The DBOS team have built a Durable Workflow engine using Postgres. It's one of the of the more elegant designs I've seen, leveraging the features of Postgres to keep it lightweight and fast.
185 points by kiwicopple 38 days ago | 67 comments
Show HN: Performing a zero downtime major version upgrade on RDS Aurora Postgres(medplum.com) Medplum is built on Postgres. Until recently, our hosted Medplum service was using an Amazon Web Services (AWS) RDS Aurora Postgres cluster running version 12.16. Since v12 is rather outdated and nearing the end of its standard support window on RDS, it was time to plan our upgrade to the newest version available on RDS, v16.4.
Keyset cursors, not offsets, for Postgres pagination(sequinstream.com) We're building Sequin, a Postgres CDC tool to streams and queues like Kafka, SQS, HTTP endpoints, and more. Efficient, correct pagination is paramount for our backfill process, so we use keyset cursors extensively.
Shrinking a Postgres Table(johnnunemaker.com) Ok folks, this is kind of a weird one. I'm going to put it in the "you won't ever need this, but if you do, you are going to be glad I wrote this up for ya" category.
487 points by todsacerdoti 67 days ago | 191 comments
Show HN: BemiDB – Postgres read replica optimized for analytics(github.com/BemiHQ) BemiDB is a Postgres read replica optimized for analytics, It consists of a single binary that seamlessly connects to a Postgres database, replicates the data in a compressed columnar format, and allows you to run complex queries using its Postgres-compatible analytical query engine.
6 points by learning_elixir 99 days ago | 0 comments
Putting a full power search engine in Ecto(moosie.us) ParadeDB is a set of extensions that add pretty amazing search and analytics features to Postgres. In particular, ParadeDB embeds Tantivy as an extension via pgrx.
144 points by philippemnoel 100 days ago | 25 comments
Optimizing Postgres table layout for maximum efficiency(r.ena.to) When modeling a Postgres database, you probably don’t give much thought to the order of columns in your tables. After all, it seems like the kind of thing that wouldn’t affect storage or performance. But what if I told you that simply reordering your columns could reduce the size of your tables and indexes by 20%? This isn’t some obscure database trick — it’s a direct result of how Postgres aligns data on disk.
204 points by napsterbr 104 days ago | 68 comments
Deep Dive into Postgres Write-Ahead Logs(artie.com) Write-ahead logs are one of four components required for logical replication. They are used to ensure data durability, meaning your data is consistent and protected against data loss. Even if a server machine fails, write-ahead logs ensure your changes persist.
A few secure, random bytes without `pgcrypto`(brandur.org) In Postgres it’s common to see the SQL random() function used to generate a random number, but it’s a pseudo-random number generator, and not suitable for cases where real randomness is required critical. Postgres also provides a way of getting secure random numbers as well, but only through the use of the pgcrypto extension, which makes gen_random_bytes available.
4 points by craigkerstiens 116 days ago | 0 comments
Why avoid where id in with variable number of bind parameters on Postgres(kaveland.no) In my post about batch operations, I used the where id = any(:ids) pattern, with ids bound to a JDBC array. I’ve gotten questions about that afterwards, asking why I do it like that, instead of using in (:id1, :id2, ...). Many libraries can take care of the dynamic SQL generation for you, so often you can just write in (:ids), just like the array example.
Building RAG with Postgres(anyblockers.com) Postgres is a powerful tool for implementing Retrieval-Augmented Generation (RAG) systems. Its versatility and robustness make it an excellent choice for this task. By diving deep into a technology you’re already familiar with, you can experience a significant productivity boost. As the saying goes, “stick with the tools you know.” Using Postgres for RAG allows you to reason about the system more easily, cutting through the hype and focusing on building something great.
YugabyteDB with Enhanced Postgres Compatibility(yugabyte.com) We are thrilled to announce powerful new capabilities and architectural enhancements — collectively called enhanced Postgres compatibility — that allow a broader range of Postgres apps to run on YugabyteDB.
12 points by 3littlefish 121 days ago | 1 comments
Building RAG with Postgres(anyblockers.com) Postgres is a powerful tool for implementing Retrieval-Augmented Generation (RAG) systems. Its versatility and robustness make it an excellent choice for this task. By diving deep into a technology you’re already familiar with, you can experience a significant productivity boost. As the saying goes, “stick with the tools you know.” Using Postgres for RAG allows you to reason about the system more easily, cutting through the hype and focusing on building something great.
Window Functions for Data Analysis with Postgres(crunchydata.com) SQL makes sense when it's working on a single row, or even when it's aggregating across multiple rows. But what happens when you want to compare between rows of something you've already calculated? Or make groups of data and query those? Enter window functions.
ClickHouse Data Modeling for Postgres Users(clickhouse.com) Last month, we acquired PeerDB, a company that specializes in Postgres CDC. PeerDB makes it fast and simple to replicate data from Postgres to ClickHouse. A common question from PeerDB users is how to model their data in ClickHouse after the replication process to maximize the benefits of ClickHouse.