Why is SELECT COUNT(*) so slow in PostgreSQL?
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
In this article we will learn about the basic concepts of DBMS.
General · 4 min read
Articles
page 1 / 15
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
Every UPDATE in PostgreSQL leaves a dead row behind. Here's how MVCC works under the hood, what VACUUM cleans up, and how to keep autovacuum ahead of your workload.
#concurrency#internals#maintenance
Error 1205 again? Pull the deadlock graph from the system_health session, read it like a DBA and fix the access pattern that causes it.
#concurrency#locking#troubleshooting
The single most important physical design decision in SQL Server, explained from first principles — with the queries to prove it.
#indexing#performance#schema-design
What each isolation level protects you from, what it costs, and why so many teams switch on READ_COMMITTED_SNAPSHOT.
#concurrency#locking#transactions
Learn to read PostgreSQL query plans node by node — estimates vs. actuals, loops, buffers — and turn them into index and query fixes.
#execution-plans#indexing#performance
In MySQL's InnoDB, the table is the primary key index. That single fact shapes insert speed, index size and how you should pick primary keys.
#indexing#internals#schema-design
The core modeling decision in MongoDB, with simple rules of thumb for one-to-few, one-to-many and many-to-many relationships.
#data-modeling#nosql#schema-design
Put Redis in front of your database the right way — choose a caching pattern, set sane TTLs, and avoid stampedes and stale data.
#caching#nosql#performance
SQLite can serve real production traffic. Here's how WAL mode changes concurrency, which PRAGMAs to set, and where the limits are.
#concurrency#internals#performance