Dev Tools · 1h ago
Inline JSONB Under 2KB Can Kill PostgreSQL Performance
PostgreSQL stores JSONB data inline when it's under 2KB, bloating row sizes and reducing rows per page from ~100 to 20-40. Even with indexes, more pages must be fetched, increasing I/O and slowing queries. Developers can force TOAST storage by padding JSONB to exceed 2KB or split JSONB into a separate table.
Meridian48 take
This is a well-known PostgreSQL pitfall, but the article's benchmark and practical fix make it a useful reminder for developers optimizing database performance.
postgresqljsonb-performance