3 ms·
Repeat after me: set work_mem to 'XXXGB'; set maintenance_work_mem to 'YYYGB'; swing away!
by mistermcgruff 13y ago
Repeat after me:
set work_mem to 'XXXGB';
set maintenance_work_mem to 'YYYGB';
swing away!
- kibibu 13y agoThis annoys me so much about PostgreSQL. Why not have useful defaults?!
- ilikepi 13y agoThe 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.
- rgbrenner 13y agowork_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_Server http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Serve...
- wfn 13y agoMore like, "set shared_buffers", "set effective_cache_size".. Also, seconding rgbrenner re: "Tuning your PostgreSQL server" article.