[blf@Logging /~]:

February 12, 2008

PostgreSQL: work_mem tuning and log_temp_files

Filed under: database, PostgreSQL — blowfisher @ 6:48 pm

work_mem 优化及 log_temp_files

work_mem is used for sorts, aggregates, and a few other operations. This is non-shared memory, which is allocated per-operation (one to several times per query); the setting is used to put a limit on the amount of RAM any single operation can grab before being forced to disk through temp files. If it is been forced to the disk that can cause a bad execution time

With PostgreSQL 8.3 a new variable got added names as “log_temp_files” that enables/disables whether temporary files are logged when deleted. These temp files can be created for sorts, hashes, and temporary query results.

log_temp_files can be used to better tune the values for work_mem after analyzing the usage of temp files (from the db server logs) for a certain query so that you can minimize or nullify the temp file usage by raising the values for work_mem.

-Shoaib (shoaibmir[@]gmail.com)

相关参考: PostgreSQL Blog’s 8.3 Feature Round-Up

1 Comment »

  1. To be honest with you, I have never written any comments or posts in the Internet. This is my first time. Why did I decide to post? The answer is simple – all information here is so amazing and interesting that it’s hard to imagine someone wouldn’t comment it.

    Comment by rudy1133 — April 11, 2008 @ 3:21 pm

RSS feed for comments on this post.

Leave a comment

You must be logged in to post a comment.

www.blowfisher.net  |  Powered by WP