Skip to content
duc zk

Databases

Notes on how relational databases store, index and clean up data.

Updated

On this page

Working notes on database internals and operations. Most of them start from a production question: why is this query slow, why is this table so large, why did this migration lock.

How these notes are organised

Each engine has its own folder. A note covers one mechanism and ends with the checks I run when that mechanism is the suspect. The PostgreSQL notes are written in Vietnamese as interview preparation: each has an interactive demo and a list of common interview questions.

Conventions

  • SQL examples target PostgreSQL unless the note says otherwise.
  • Numbers such as page sizes and thresholds are defaults; check the running configuration.

In this section