Angva wrote: > We found that the kernel setting SHMALL was set ridiculously high - > 1024g!. Someone noticed this when running "ipcs -lm" - seemed just a > tad off. :) That's not a problem because it's just a limit. It won't cause out of memory or anything. The problem with work_mem is that the system may request that much memory for every Sort step. Each query may have more than one of those, and each backend can be serving more than one query at a time. So those 200000 you have quickly turn into the gigabytes and consume the whole of your RAM. If a Sort step requires more than work_mem for its work, it will go to disk -- but in a much faster way than what the kernel is able to do with swap. So whenever you are trading work_mem for swap, you are losing big time. You should decrease that figure. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.