AWS re:Invent Day 1
Software Engineer
In this post you will be presented with 2 truths and a lie related to PostgreSQL and Ruby on Rails.
We just upgraded to 3.0 of PgHero (Check the CHANGELOG.md). I learned about the availability of the new version from the Postgres.fm 🎧 podcast.
This past week I had the privilege of presenting at and attending RailsConf 2022 Conference in Portland, OR. My presentation was titled Puny to Powerful PostgreSQL Rails Apps. This post will focus mainly on my presentation experience.
Recently I had the opportunity to travel to NYC to present at PGConf NYC 2021.
In the StaffEng book, there is a section called Work on What Matters.
Duplicate rows can happen when a database unique constraint is missing. Once found, finding and deleting duplicates in a fast way is necessary before the constraint can be added.
By using UNLOGGED tables, we can insert rows at a higher rate when compared with a logged table (the default). But there’s a trade-off.
Over time our indexes became bloated, meaning invisible rows were still present in the index. This is inefficient and can be addressed by rebuilding the index.
This tip is a recipe for how to recover from a Rails migration that failed to apply in production. This process could work for any SQL migration. The example below is for an index added to a table.