<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/all-your-gucs-in-a-row-hash-mem-multiplier-sgmqwzot9" -->

---
title: All Your GUCs in a Row: hash_mem_multiplier | daily.dev
description: PostgreSQL's `hash_mem_multiplier` GUC (default 2.0) lets hash-based operations use a multiple of `work_mem` while sort-based operations use plain `work_mem`....
canonical: https://daily.dev/posts/all-your-gucs-in-a-row-hash-mem-multiplier-sgmqwzot9
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: All Your GUCs in a Row: hash_mem_multiplier | daily.dev
og:description: PostgreSQL's `hash_mem_multiplier` GUC (default 2.0) lets hash-based operations use a multiple of `work_mem` while sort-based operations use plain `work_mem`....
og:url: https://daily.dev/posts/all-your-gucs-in-a-row-hash-mem-multiplier-sgmqwzot9
og:image: https://api.daily.dev/og/posts/SGMqwzot9.png
og:image:alt: All Your GUCs in a Row: hash_mem_multiplier
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# All Your GUCs in a Row: hash_mem_multiplier

**[Planet PostgreSQL](https://daily.dev/sources/planet-postgresql)** · 6 min read · 0 upvotes · 0 comments

## Summary

PostgreSQL's `hash_mem_multiplier` GUC (default 2.0) lets hash-based operations use a multiple of `work_mem` while sort-based operations use plain `work_mem`. This separation exists because hashes and sorts have fundamentally different memory relationships: sorts barely benefit from extra memory once past a low threshold, while hash operations see dramatic performance degradation when they spill to disk. The parameter was introduced in PostgreSQL 13 alongside disk-based hash aggregation to prevent regressions, and its default was raised to 2.0 in PostgreSQL 15. Practical guidance: use `EXPLAIN (ANALYZE)` to detect hash spills (Batches > 1 or disk usage on HashAggregate nodes), then raise the multiplier per session or role rather than globally raising `work_mem`. Values up to 8.0 or beyond are reasonable when `work_mem` is already at 40MB+, but beware the per-node, per-connection nature of the allowance which can multiply memory usage rapidly under concurrent load.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://postgr.es/p/9qH>

## Similar posts on daily.dev

- [All Your GUCs in a Row: enable\_parallel\_hash](https://daily.dev/posts/all-your-gucs-in-a-row-enable-parallel-hash-xmfdenbk2) · Planet PostgreSQL · 0 upvotes · 0 comments
- [All Your GUCs in a Row: enable\_hashagg](https://daily.dev/posts/all-your-gucs-in-a-row-enable-hashagg-pueutpiuu) · Planet PostgreSQL · 0 upvotes · 0 comments
- [All Your GUCs in a Row: enable\_hashjoin](https://daily.dev/posts/all-your-gucs-in-a-row-enable-hashjoin-wdnjt9mms) · Planet PostgreSQL · 0 upvotes · 0 comments
- [Don't give Postgres too much memory](https://daily.dev/posts/don-t-give-postgres-too-much-memory-xluq2yiti) · Lobsters · 1 upvotes · 0 comments
- [All Your GUCs in a Row: maintenance\_work\_mem](https://daily.dev/posts/all-your-gucs-in-a-row-maintenance-work-mem-zcr07vjsd) · Planet PostgreSQL · 0 upvotes · 0 comments

---

Tags: [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/all-your-gucs-in-a-row-hash-mem-multiplier-sgmqwzot9)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"All Your GUCs in a Row: hash_mem_multiplier","url":"https://daily.dev/posts/all-your-gucs-in-a-row-hash-mem-multiplier-sgmqwzot9","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/all-your-gucs-in-a-row-hash-mem-multiplier-sgmqwzot9"},"datePublished":"2026-07-29T01:03:19.612Z","dateModified":"2026-07-29T04:17:22.619Z","description":"PostgreSQL's `hash_mem_multiplier` GUC (default 2.0) lets hash-based operations use a multiple of `work_mem` while sort-based operations use plain `work_mem`....","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/433001c76f69f0977542ba42521f4bd4?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/433001c76f69f0977542ba42521f4bd4?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Planet PostgreSQL","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Planet PostgreSQL","logo":"https://media.daily.dev/image/upload/logos/placeholder.jpg","url":"https://daily.dev/sources/planet-postgresql"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/all-your-gucs-in-a-row-hash-mem-multiplier-sgmqwzot9","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"postgresql","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Planet PostgreSQL","item":"https://daily.dev/sources/planet-postgresql"},{"@type":"ListItem","position":3,"name":"All Your GUCs in a Row: hash_mem_multiplier"}]}
```

