TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Practical Guide to PostgreSQL Optimizations

124 点作者 omarish超过 8 年前

5 条评论

sbuttgereit超过 8 年前
The work_mem section is incorrect. The article says the configuration is per worker, but it&#x27;s actually per operation which requires work_mem... any given worker can have multiple operations running in parallel. So actually getting a good, but safe, value is more sensitive than the article suggests.<p><a href="https:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;9.5&#x2F;static&#x2F;runtime-config-resource.html#GUC-WORK-MEM" rel="nofollow">https:&#x2F;&#x2F;www.postgresql.org&#x2F;docs&#x2F;9.5&#x2F;static&#x2F;runtime-config-re...</a><p><i>work_mem (integer)<p>Specifies the amount of memory to be used by internal sort operations and hash tables before writing to temporary disk files. The value defaults to four megabytes (4MB). Note that for a complex query, several sort or hash operations might be running in parallel; each operation will be allowed to use as much memory as this value specifies before it starts to write data into temporary files. Also, several running sessions could be doing such operations concurrently. Therefore, the total memory used could be many times the value of work_mem; it is necessary to keep this fact in mind when choosing the value. Sort operations are used for ORDER BY, DISTINCT, and merge joins. Hash tables are used in hash joins, hash-based aggregation, and hash-based processing of IN subqueries.</i>
评论 #12353601 未加载
评论 #12354085 未加载
ceyhunkazel超过 8 年前
I recommend following Christophe Pettus - PostgreSQL Proficiency for Python People - PyCon 2016 video for postgresql basics and optimization<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=knUitQQnpJo" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=knUitQQnpJo</a>
评论 #12353965 未加载
pella超过 8 年前
simple tool: <a href="http:&#x2F;&#x2F;pgtune.leopard.in.ua&#x2F;" rel="nofollow">http:&#x2F;&#x2F;pgtune.leopard.in.ua&#x2F;</a>
评论 #12354354 未加载
评论 #12354345 未加载
评论 #12354439 未加载
DrJokepu超过 8 年前
SHMMAX basically stopped being an important factor in PostgreSQL 9.3 (released almost 3 years ago) and later.
olalonde超过 8 年前
I&#x27;m currently reading &quot;Designing Data-Intensive Applications&quot; by Martin Kleppman and it has an interesting chapter on database storage engines, including PostgreSQL (e.g. B-trees chapter). I would definitely recommend if you&#x27;d like a high level overview of how things work under the hood (it&#x27;s a good mix of theory and practice). It also helps understanding why and when optimisations work.