Interview Q&A · questions with model answers
PostgreSQL Interview Questions
Part of the study plan for: Data Engineer
Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.
-
Most asked Why are long-running and 'idle in transaction' sessions harmful in PostgreSQL?
An open transaction holds back the oldest snapshot horizon, so VACUUM cannot remove dead tuples created after it started anywhere in the database: tables and indexes bloat, and queries slow down. It…
-
Why is count(*) slow on large PostgreSQL tables, and what can you do?
Because of MVCC, the visible row count depends on the snapshot, so PostgreSQL must scan the table or an index (index-only scans help when the visibility map is up to date). There is no cached exact…
-
Why can an operating-system upgrade corrupt PostgreSQL indexes, and how do you avoid it?
Text indexes are ordered by the collation, which PostgreSQL usually takes from the C library (glibc). A glibc upgrade that changes collation rules (glibc 2.28 did, significantly) makes existing…