kiransabne.devHow do you write efficient pagination for millions of rows?Efficient pagination is absolutely critical when dealing with millions of rows in PostgreSQL — especially if you care about performance, index usage, and UX for APIs or UI pages. 1. OFFSET/LIMIT Pagination (a.k.a. “Skip-Limit”) SELECT * FROM orders O...Jan 9·3 min read
kiransabne.devPostgreSQL Parameter Tuning for 100M+ RowsWhen you’re running PostgreSQL with 100M+ rows, the difference between “it works” and “it flies” is all about tuning—but not the generic, copy-paste advice you get everywhere. Here’s the advanced, battle-tested checklist I’d give to serious DBAs and ...Jan 4·4 min read
kiransabne.devUnderstanding and Solving Cache Stampede: The Invisible Threat to DatabasesImagine this: Your high-traffic app is humming along smoothly. Most data requests are being served instantly from Redis or other, blazing-fast cache layer. But then — a cache key expires, and within milliseconds, 10,000 clients hit your backend at on...Jan 3·4 min read
databasedeveloper.devBuilding a Semantic Similarity Search API with FastAPI, Sentence-BERT, and PostgreSQL pgvectorIn this article, I share how I built a semantic similarity search API using FastAPI, Sentence-BERT (SBERT), and PostgreSQL with pgvector.The idea was to test whether we can achieve context-aware text search directly inside Postgres, without adding a ...Oct 21, 2025·1 min read
databasedeveloper.devPostgreSQL Indexing: When BRIN Beats B-TreeSummary: If you're dealing with huge tables and struggling with B-Tree index bloat or slow bulk inserts, it's time to look at BRIN (Block Range Indexes). This article explains: What BRIN indexes are and how they work internallyHow they compare to B-T...Oct 15, 2025·1 min read