· 3 min read

Everything you know about setting `work_mem` is wrong.

If you google around for how to set work_mem in PostgreSQL, you’ll probably find something like:

To set work_mem, take the number of connections, add 32, divide by your astrological sign expressed as a number (Aquarius is 1), convert it to base 7, and then read that number in decimal megabytes.

So, I am here to

1 comment

· 1 min read

Upcoming Live Presentations

1 comment

· 3 min read

Workers of the World, Unite!

Over the course of the last few versions, PostgreSQL has introduces all kinds of background worker processes, including workers to do various kinds of things in parallel. There are enough now that it’s getting kind of confusing. Let’s sort them all out.

You can think of each setting as creating a pool of potential workers. Each setting draws its

0 comments

· 1 min read

ALTER TABLE … SET WITHOUT OIDS big gotcha

Normally, when you drop a column from PostgreSQL, it doesn’t have to do anything to the data in the table. It just marks the column as no longer alive in the system catalogs, and gets on with business.

There is, however, a big exception to this: ALTER TABLE … SET WITHOUT OIDS. This pops up when using pg_upgrade

0 comments

· 3 min read

UUIDs vs serials for keys

This topic pops up very frequently: “Should we use UUIDs or bigints as primary keys?”

One of the reasons that the question gets so many conflicting answers is that there are really two different questions being asked:

  • “Should our keys be random or sequential?”
  • “Should our keys be 64 bits, or larger?”

3 comments

· 1 min read

"Database Patterns and How to Find Them" at SCaLE 2023

I’ll be speaking on Database Antipatterns and How to Find Them at SCaLE 2023, March 9-12, 2023 in Pasadena, CA.

0 comments

· 1 min read

"Extreme PostgreSQL" at PgDay/MED

I’m very happy that I’ll be presenting “Extreme PostgreSQL” at PgDay/MED in Malta (yay, Malta!) on 13 April 2023.

0 comments

· 1 min read

Xtreme PostgreSQL!

The slides from my talk at the February 2023 SFPUG Meeting are now available.

0 comments

· 1 min read

Nordic PgDay 2023

I’m very pleased to be talking about real-life logical replication at Nordic PgDay 2023, in beautiful Stockholm.

0 comments

· 2 min read

A foreign key pathology to avoid

There’s a particular anti-pattern in database design that PostgreSQL handles… not very well.

For example, let’s say you are building something like Twitch. (The real Twitch doesn’t work this way! At least, not as far as I know!) So, you have streams, and you have users, and users watch streams. So, let’s do a schema!

1

0 comments