PG Phriday: Fancy Partitioning

6 min read

This week we’ll be covering another method of Postgres partitioning. This is a technique I personally prefer and try to use and advocate at every opportunity. It’s designed to straddle the line between traditional partitioning and standard monolithic table structure by using table inheritance as a convenience factor. The assumption here is that end-user applications either:

PG Phriday: Basic Partitioning

8 min read

Most Postgres (PostgreSQL) users who are familiar with partitioning use the method described in the partitioning documentation. This architecture comes in a fairly standard stack:

  • One empty base table for structure.
  • At least one child table that inherits the base design.
  • A trigger to redirect inserts based on the partitioning scheme.
  • A constraint on each child table to enforce the partition scheme, and help the planner exclude child partitions from inapplicable queries.

It looks simple, but there’s a lot of SQL involved. Let’s take the sensor_log table we introduced a couple weeks ago and turn it into a partitioned structure.

PG Phriday: Partitioning Candidates

7 min read

What’s a good table to partition? It’s not always a question with an obvious answer. Most often, size and volume determine whether or not a table should be broken into several chunks. However, there’s also cases where business or architecture considerations might use partitioning to preserve a shared table structure, or drive aggregate analysis over a common core. In Postgres (PostgreSQL), this is even more relevant because of how partitioning is handled through inheritance.

Just Call Me Peter

2 min read

I just realized I am a victim of the Peter Principle.

Ever since I can remember, I’ve been a very quiet and withdrawn person. When people see that, they need to assign a cause. Well, if someone isn’t talking, they must be listening or thinking. If they think a lot, they must be smart. So every adult I ever met when I was a child always treated that way. Of course, I am then pressured to push myself—to fulfill their expectations.

There Will Never Be World Peace

2 min read

Humanity simply doesn’t have a brain capable of it.

People can only mentally relate to a certain number of people or ideals. Anything else becomes foreign. Our animal brains see foreign things as potential threats, and puts up guards. Suddenly, a person starts to wonder: why don’t those other people do it the way we do? The ‘it’ here can be anything: Religion, politics, pick any subject. That question evolves into a disagreement, then an argument, then a schism, and so on.