All Questions
Postgresql hard

The `work_mem` parameter is applied 'per operation' within a query. If a complex query involves 4 Hash Joins and 2 Sorts, and `work_mem = 64MB`, what is the risk?

  1. A The query will be restricted to a single CPU core to prevent memory fragmentation in the heap.
  2. B The query can allocate up to 384MB of RAM, potentially leading to an OOM (Out of Memory) crash.
  3. C The database will automatically switch all operations to disk-based temporary files to save memory.
  4. D The shared buffer pool will be locked for the duration of the query, blocking other client requests.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions