Re:PostgreSQL Basics by Example
by mistermcgruff on Sunday August 18, 2013 @09:26PM
(#6235091)
Repeat after me:
set work_mem to 'XXXGB';
set maintenance_work_mem to 'YYYGB';
swing away!
[ Parent
| on HN ]
work_mem is a per-sort setting. So if you have 20 users connected, running a single query with 4 sorts each, that's 80 x work_mem. If it's set to GB anything, that's going to get out of hand very fast.
I recommend this guide.. it's a good start: http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Serve...
More like, "set shared_buffers", "set effective_cache_size"..
Also, seconding rgbrenner re: "Tuning your PostgreSQL server" article.
This annoys me so much about PostgreSQL. Why not have useful defaults?!
The defaults are useful in that they reflect a configuration that is appropriate to get the system running on a large variety of hardware. It's not really the responsibility of the Pg developers to guess at the "best" settings for any specific environment, because environments and configurations vary greatly.
I agree to a point, but it would be nice if there were some provided default configs for various classes of machines.
Especially defaults for the most popular EC2 instance types.