Why does OFFSET pagination get slower on every page?
Page 1 takes 5 ms and page 5,000 takes 4 seconds. OFFSET reads and throws away every skipped row. Switch to keyset (cursor) pagination for constant-time pages.
#indexing#pagination#performance
Topic
Page 1 takes 5 ms and page 5,000 takes 4 seconds. OFFSET reads and throws away every skipped row. Switch to keyset (cursor) pagination for constant-time pages.
#indexing#pagination#performance
Raising max_connections to 1000 usually makes things worse. Learn why Postgres connections are expensive, where they're leaking and how PgBouncer fixes it for good.
#configuration#performance#troubleshooting
The index exists, but the plan still shows a scan. Nine common reasons the optimizer can't (or shouldn't) use your index, and how to fix each one.
#execution-plans#indexing#performance
Same proc, same code, suddenly 100× slower, and fast again when you run it in SSMS. Here's how parameter sniffing causes it, how to prove it and the fixes that actually hold.
#execution-plans#performance#troubleshooting
The 100 MB blocking-sort limit means your index doesn't provide the sort order. Build compound indexes with the ESR rule, order pipeline stages correctly, and know when allowDiskUse is fine.
#indexing#nosql#performance
Stale reads and 2 a.m. lag spikes usually come down to single-threaded apply, tables without primary keys and giant transactions. Diagnose and fix each one.
#performance#replication#troubleshooting
It's caching by design, not a leak, but the default limit is 'everything'. How to set max server memory and tell real memory pressure from a full buffer pool.
#configuration#internals#performance
MVCC means Postgres doesn't store a row count. Make exact counts cheaper, get instant estimates from the planner, and keep exact counters when you really need them.
#internals#mvcc#performance
The N+1 query problem: each query takes 1 ms, but there are 301 of them. How to spot it, fix it with eager loading and avoid the cartesian-explosion overcorrection.
#orm#performance#troubleshooting
Execution plans tell you exactly how SQL Server ran your query. Learn which operators matter, how to spot bad estimates and what the warnings really mean.
#execution-plans#performance#t-sql
The single most important physical design decision in SQL Server, explained from first principles — with the queries to prove it.
#indexing#performance#schema-design