rogerwelin

A PostgreSQL extension that can enforce optimal column alignment to minimize row padding waste.

18
1
100% credibility
Found May 02, 2026 at 18 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
PLpgSQL
AI Summary

A PostgreSQL extension that analyzes table column order for alignment waste, warns or blocks suboptimal new tables, audits existing ones, and suggests optimized rewrites.

How It Works

1
🔍 Hear about table waste

You learn that jumbled data fields in your tables add hidden empty space to every row, wasting storage and slowing things down.

2
📥 Add the optimizer

Follow the simple guide to load this smart organizer into your database so it can watch your tables.

3
⚙️ Pick your style

Choose gentle tips for everyday use or strict rules for important projects to catch issues right away.

4
🧐 Scan a table

Point the tool at one of your data tables and instantly see how much space is being wasted per row.

5
💡 Get fix ideas

Receive a clear picture of the perfect arrangement and even a ready-to-use plan to rearrange without hassle.

6
🔧 Rearrange safely

Apply the suggested changes to make your table compact and efficient, saving space across all your data.

7
📊 Watch new tables

Turn on automatic checks so every new table you make is perfectly organized from the start.

🎉 Leaner database

Your data storage now uses every byte wisely, cutting costs and making everything faster and smoother.

Sign up to see the full architecture

6 more

Sign Up Free

Star Growth

See how this repo grew from 18 to 18 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is pg_column_tetris?

pg_column_tetris is a PLpgSQL PostgreSQL extension that enforces optimal column ordering in tables to cut row padding waste from misalignment. PostgreSQL adds invisible padding bytes for CPU-efficient reads, but poor column sequences—like boolean before bigint—waste 7+ bytes per row; this tool warns or blocks bad CREATE TABLE statements during dev or CI. It also audits existing tables with functions like padding_wasted() for per-row or total waste, check() for layouts, and suggest_rewrite() for migration scripts—installs via SQL on any Postgres 14+ like RDS, Supabase, or Docker setups.

Why is it gaining traction?

Unlike manual alignment guesswork or generic postgresql extensions like pg_trgm, postgis, timescaledb, unaccent, or uuid-ossp, it automates a hidden perf win: zero-runtime storage savings scaling to GBs on big tables. Modes toggle from warn (dev-friendly notices) to strict (CI enforcement), plus exclusions for legacy schemas—fits github postgresql actions or terraform postgresql extension workflows. Devs hook it for instant feedback, like HINTs with fixed DDL.

Who should use this?

Backend engineers crafting high-volume tables in apps with millions of rows, DBAs auditing postgres github repos for storage bloat, or teams on managed services optimizing before scaling. Ideal for CI pipelines blocking sloppy schemas, or VS Code users via postgresql extension for visual studio code spotting waste early.

Verdict

Worth a spin for Postgres-heavy projects chasing free disk/IO gains, with solid docs and pure-SQL ease trumping compiled extensions like vector. But 18 stars and 1.0% credibility signal early maturity—test thoroughly in non-prod before migrations.

(198 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.