{"id":24354,"date":"2019-12-14T08:00:15","date_gmt":"2019-12-13T23:00:15","guid":{"rendered":"https:\/\/www.techscore.com\/blog\/?p=24354"},"modified":"2019-12-16T17:01:47","modified_gmt":"2019-12-16T08:01:47","slug":"postgresql-performance-tips","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2019\/12\/14\/postgresql-performance-tips\/","title":{"rendered":"PostgreSQL\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u5c0f\u30cd\u30bf\u96c6"},"content":{"rendered":"<p>\u3053\u308c\u306f <a href=\"https:\/\/www.techscore.com\/blog\/2019\/11\/21\/techscore-advent-calendar-2019\/\">\ud83d\ude3aTECHSCORE Advent Calendar 2019\ud83d\ude3a<\/a>\u306e14\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306fPostgreSQL\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u95a2\u3059\u308b\u5c0f\u30cd\u30bf\u3092\u3042\u3064\u3081\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u77e5\u3063\u3066\u308b\u3088\uff01\u3068\u3044\u3046\u3082\u306e\u304c\u591a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u3069\u308c\u304b\u4e00\u3064\u3067\u3082\u53c2\u8003\u306b\u306a\u308c\u3070\u5e78\u3044\u3067\u3059o(\u30c4)9<\/p>\n<h2>\u30c7\u30fc\u30bf\u6295\u5165(COPY)\u3092\u9ad8\u901f\u5316<\/h2>\n<p>\u30ec\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u30aa\u30d5\u306e\u5834\u5408\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u5185\u3067TRUNCATE\u5f8c\u306bCOPY\u3092\u5b9f\u884c\u3059\u308b\u3068WAL\u304c\u7701\u7565\u3055\u308c\u308b\u305f\u3081\u3001\u901a\u5e38\u306b\u6bd4\u3079\u304b\u306a\u308a\u9ad8\u901f\u306b\u30c7\u30fc\u30bf\u3092\u6295\u5165\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002PostgreSQL\u306e\u8a2d\u5b9a\u306f\u4ee5\u4e0b\u306e\u72b6\u614b\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n<strong><br \/>\n\u3000wal_level -> minimal<br \/>\n\u3000archive_mode -> off<br \/>\n\u3000max_wal_senders -> 0<br \/>\n<\/strong><br \/>\n\u3053\u306e\u72b6\u614b\u3067\u3001<\/p>\n<pre class=\"lang:sh decode:true \">\nbegin;\ntruncate foo;\n\\copy foo from test.csv csv;\ncommit;\n<\/pre>\n<p>\u3068\u3059\u308b\u3068\u3001\u9ad8\u901f\u306bCOPY\u304c\u53ef\u80fd\u3067\u3059\u3002COPY\u4ee5\u5916\u306b\u3082 CREATE TABLE AS SELECT \u306b\u3082\u6709\u52b9\u3067\u3059\u3002<\/p>\n<h2>Spring JDBC \u30d1\u30e9\u30e1\u30fc\u30bf\u578b\u60c5\u5831\u53d6\u5f97\u3092\u3084\u3081\u308b<\/h2>\n<p>Spring JDBC\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u578b\u6307\u5b9a\u306a\u3057\u3067null\u5024\u3092\u6e21\u3059\u3068\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u578b\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u30af\u30a8\u30ea\u304cnull\u5024\u306e\u6570\u3060\u3051\u4f59\u5206\u306b\u767a\u884c\u3055\u308c\u307e\u3059\u3002<br \/>\n\u601d\u3044\u304c\u3051\u306a\u3044\u3068\u3053\u308d\u3067\u4f55\u500d\u306b\u3082\u30af\u30a8\u30ea\u3092\u767a\u884c\u3057\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>\n\u5e38\u306b\u6b63\u3057\u304f\u578b\u3092\u6307\u5b9a\u3059\u308b\u3088\u3046\u5b9f\u88c5\u3059\u308b\u304b\u3001\u3053\u306e\u6a5f\u80fd\u3092\u30aa\u30d5\u306b\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u3087\u3046\u3002<br \/>\n\u30aa\u30d5\u306b\u3059\u308b\u306b\u306fJava\u8d77\u52d5\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u4ee5\u4e0b\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>-Dspring.jdbc.getParameterType.ignore=true<\/p>\n<h2>\u30ab\u30fc\u30bd\u30eb\u3092\u4f7f\u308f\u306a\u3044\uff08\u5fc5\u8981\u306a\u6642\u3060\u3051\u306b\u9650\u5b9a\u3059\u308b\uff09<\/h2>\n<p>PostgreSQL9.6\u4ee5\u964d\u3067\u642d\u8f09\u3055\u308c\u305f\u30d1\u30e9\u30ec\u30eb\u30af\u30a8\u30ea\u306f\u975e\u5e38\u306b\u5f37\u529b\u3067\u3059\u304c\u3001\u30ab\u30fc\u30bd\u30eb\u3092\u4f7f\u3046(JDBC\u3067setFetchSize()\u3092\u6307\u5b9a\u3059\u308b\uff09\u3068\u30d1\u30e9\u30ec\u30eb\u30af\u30a8\u30ea\u306f\u6a5f\u80fd\u305b\u305a\u3001\u5f93\u6765\u901a\u308a\u30b7\u30f3\u30b0\u30eb\u30d7\u30ed\u30bb\u30b9\u3067\u51e6\u7406\u3055\u308c\u307e\u3059\u3002<br \/>\n\u3053\u308c\u304c\u307e\u305f\u610f\u5916\u306b\u306f\u307e\u308a\u3069\u3053\u308d\u3067\u3001\u30b3\u30f3\u30bd\u30fc\u30eb\u304b\u3089psql\u3067SQL\u3092\u5b9f\u884c\u3057\u3001\u5b9f\u884c\u8a08\u753b\u3092\u307f\u308b\u3068\u30d1\u30e9\u30ec\u30eb\u306b\u306a\u3063\u3066\u3044\u308b\u306b\u3082\u95a2\u308f\u3089\u305a\u3001\u306a\u305c\u304b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u52d5\u304b\u3057\u3066\u307f\u308b\u3068\u9045\u3044\uff01\u3068\u3044\u3046\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\nsetFetchSize()\u306f\u5b9f\u884c\u3059\u308b\u30af\u30a8\u30ea\u304c\u53d6\u5f97\u3059\u308b\u30c7\u30fc\u30bf\u91cf\u30fb\u30e1\u30e2\u30ea\u642d\u8f09\u91cf\u3092\u8e0f\u307e\u3048\u305f\u3046\u3048\u3067\u614e\u91cd\u306b\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>effective_io_concurrency\u30920\u306b\u3057\u3066\u307f\u308b<\/h2>\n<p>\u4ee5\u524d\u306b\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"lhdc26Sk9U\"><p><a href=\"https:\/\/www.techscore.com\/blog\/2019\/09\/20\/postgresql-%e3%80%8ceffective_io_concurrency%e3%80%8d%e3%81%ae%e8%a8%ad%e5%ae%9a%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/\">PostgreSQL \u300ceffective_io_concurrency\u300d\u306e\u8a2d\u5b9a\u306b\u3064\u3044\u3066<\/a><\/p><\/blockquote>\n<p><iframe title=\"&#8220;PostgreSQL \u300ceffective_io_concurrency\u300d\u306e\u8a2d\u5b9a\u306b\u3064\u3044\u3066&#8221; &#8212; TECHSCORE BLOG\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"https:\/\/www.techscore.com\/blog\/2019\/09\/20\/postgresql-%e3%80%8ceffective_io_concurrency%e3%80%8d%e3%81%ae%e8%a8%ad%e5%ae%9a%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/embed\/#?secret=lhdc26Sk9U\" data-secret=\"lhdc26Sk9U\" width=\"530\" height=\"299\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5168\u4f53\u8a2d\u5b9a\u30670\u306b\u3057\u3066\u3057\u307e\u3046\u306e\u306f\u3084\u308a\u3059\u304e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u7279\u5b9a\u306e\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3060\u3051SET\u53e5\u3067\u5909\u66f4\u3059\u308b\u3001\u7279\u5b9a\u306e\u30c6\u30fc\u30d6\u30eb\u30b9\u30da\u30fc\u30b9\u3060\u3051\u306b\u9069\u7528\u3059\u308b\u3068\u3044\u3046\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h2>\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u308a\u306a\u304a\u3059<\/h2>\n<p>\u8ffd\u52a0\u30fb\u66f4\u65b0\u30fb\u524a\u9664\u64cd\u4f5c\u304c\u767a\u751f\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u3092\u9577\u304f\u904b\u7528\u3059\u308b\u3068\u3001\u904b\u7528\u521d\u671f\u3068\u6bd4\u3079\u30c7\u30fc\u30bf\u7269\u7406\u4f4d\u7f6e\u304c\u5927\u304d\u304f\u5909\u308f\u308a\u3001\u30af\u30a8\u30ea\u5b9f\u884c\u6642\u306b\u30b9\u30c8\u30ec\u30fc\u30b8\u30a2\u30af\u30bb\u30b9\u3067\u30e9\u30f3\u30c0\u30e0\u30a2\u30af\u30bb\u30b9\u304c\u5897\u52a0\u3057\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u60aa\u5316\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3092\u6539\u5584\u3059\u308b\u306b\u306fCLUSTER\u307e\u305f\u306fVACUUM FULL\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u6709\u52b9\u3067\u3059\u3002\u3069\u3061\u3089\u306e\u30b3\u30de\u30f3\u30c9\u3082\u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u306b\u30c7\u30fc\u30bf\u3092\u8a70\u3081\u306a\u304a\u3057\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3057\u3001\u30c6\u30fc\u30d6\u30eb\u30b5\u30a4\u30ba\u306b\u3088\u3063\u3066\u306f\u9577\u6642\u9593\u30c6\u30fc\u30d6\u30eb\u3092\u30ed\u30c3\u30af\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>\n\u904b\u7528\u3057\u3066\u3044\u308b\u30b7\u30b9\u30c6\u30e0\u3067\u53c2\u7167\u3057\u304b\u884c\u308f\u306a\u3044\u6642\u9593\u5e2f\u3092\u8abf\u6574\u53ef\u80fd\u306a\u5834\u5408\u3001CREATE TABLE AS SELECT\u3067\u5225\u540d\u30c6\u30fc\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u3092\u8a70\u3081\u306a\u304a\u3057\u3001\u65b0\u30fb\u65e7\u30c6\u30fc\u30d6\u30eb\u3092\u30ea\u30cd\u30fc\u30e0\u3059\u308b\u3053\u3068\u3067\u30c6\u30fc\u30d6\u30eb\u3092\u5165\u308c\u66ff\u3048\u308b\u624b\u6bb5\u3082\u6709\u52b9\u3067\u3059\u3002<br \/>\n\u30ea\u30cd\u30fc\u30e0\u64cd\u4f5c\u3092\u30ef\u30f3\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306b\u3059\u308b\u3053\u3068\u3067\u30b7\u30b9\u30c6\u30e0\u7121\u505c\u6b62\u3067\u5bfe\u5fdc\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>synchronous_commit\u3092\u30aa\u30d5\u306b<\/h2>\n<p>\u6bd4\u8f03\u7684\u5c0f\u3055\u3044\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u304c\u591a\u304f\u767a\u751f\u3059\u308b\u30b7\u30b9\u30c6\u30e0\u306e\u5834\u5408\u3001synchronous_commit\u3092\u30aa\u30d5\u306b\u3059\u308b\u3053\u3068\u3067\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\u304c\u5411\u4e0a\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\nsynchronous_commit\u3092\u30aa\u30d5\u306b\u3059\u308b\u3068\u3001\u30b3\u30df\u30c3\u30c8\u6642\u306b\u30b9\u30c8\u30ec\u30fc\u30b8\u3078\u306e\u66f8\u304d\u8fbc\u307f\u5b8c\u4e86\u3092\u5f85\u305f\u305a\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u5fdc\u7b54\u3092\u8fd4\u3059\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\nsynchronous_commit\u3092\u30aa\u30d5\u306b\u3059\u308b\u3053\u3068\u306b\u3088\u308b\u30ea\u30b9\u30af\u306f\u3001PostgreSQL\u306e\u30af\u30e9\u30c3\u30b7\u30e5\uff0fimmediate\u30e2\u30fc\u30c9\u3067\u306e\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306b\u3001\u76f4\u8fd1\u306e\u30b3\u30df\u30c3\u30c8\u5206\u3067\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u66f8\u304d\u8fbc\u307f\u304c\u5b8c\u4e86\u3057\u3066\u3044\u306a\u304b\u3063\u305f\u30c7\u30fc\u30bf\u3092\u30ed\u30b9\u30c8\u3059\u308b\u3053\u3068\u3067\u3059\u3002<br \/>\n\u6b21\u56de\u8d77\u52d5\u6642\u3001\u30ed\u30b9\u30c8\u76f4\u524d\u306e\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u307e\u3067\u6b63\u5e38\u306b\u30ea\u30ab\u30d0\u30ea\u3055\u308c\u308b\u305f\u3081\u3001\u30c7\u30fc\u30bf\u7834\u58ca\u306e\u30ea\u30b9\u30af\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u4f3c\u305f\u96f0\u56f2\u6c17\u3092\u611f\u3058\u308b\u8a2d\u5b9a\u5024\u306bfsync\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u3061\u3089\u306f\u30aa\u30d5\u306b\u3057\u3066\u3057\u307e\u3046\u3068\u30c7\u30fc\u30bf\u7834\u58ca\u306e\u30ea\u30b9\u30af\u304c\u3042\u308a\u3001PostgreSQL\u3092\u8d77\u52d5\u3067\u304d\u306a\u304f\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\u306e\u3067\u30aa\u30d5\u306b\u3057\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<h2>shared_buffers\u304c\u5927\u304d\u3044\u5834\u5408\u306fhugepages\u3092\u4f7f\u3046<\/h2>\n<p>shared_buffers\u306b32 - 64GB\u4ee5\u4e0a\u3092\u5272\u308a\u5f53\u3066\u308b\u3088\u3046\u306a\u5834\u5408\u3001hugepages\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u5411\u4e0a\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f huge_pages=try \u3067\u3001OS\u306e\u8a2d\u5b9a\u3067hugepages\u304c\u6e96\u5099\u3055\u308c\u3066\u3044\u306a\u3051\u308c\u3070\u5229\u7528\u3057\u307e\u305b\u3093\u3002<br \/>\nhugepages\u3092\u5229\u7528\u3059\u308b\u524d\u63d0\u306e\u5834\u5408\u306f huge_pages=on \u3068\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>wal\u9818\u57df\u3001\u4e00\u6642\u30d5\u30a1\u30a4\u30eb\u9818\u57df\u3092\u9ad8\u901f\u306a\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u304a\u304f<\/h2>\n<p>\u30b9\u30c8\u30ec\u30fc\u30b8\u88c5\u7f6e\u304c\u9ad8\u901f\u3067\u3042\u308c\u3070\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u3044\u3044\u306e\u306f\u5f53\u7136\u3067\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3059\u3079\u3066\u3092\u9ad8\u901f\u306a\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u306e\u305b\u308b\u306e\u306f\u4e88\u7b97\u7684\u306b\u56f0\u96e3\u306a\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<br \/>\nwal\u9818\u57df\u3068\u4e00\u6642\u30d5\u30a1\u30a4\u30eb\u9818\u57df\u3060\u3051\u306b\u7d5e\u308b\u3068\u305d\u308c\u307b\u3069\u5927\u304d\u306a\u30b5\u30a4\u30ba\u3068\u306f\u306a\u308a\u307e\u305b\u3093\u3002\u3053\u308c\u3089\u306e\u9818\u57df\u3060\u3051\u5225\u3067\u9ad8\u901f\u306a\u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u8abf\u9054\u3059\u308b\u3068\u3044\u3046\u306e\u3082\u52b9\u679c\u7684\u3067\u3059\u3002<br \/>\nwal\u9818\u57df\u3092\u9ad8\u901f\u306a\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u306e\u305b\u308b\u3053\u3068\u3067\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u30b9\u30eb\u30fc\u30d7\u30c3\u30c8\uff0f\u30ec\u30b9\u30dd\u30f3\u30b9\u30bf\u30a4\u30e0\u306e\u6539\u5584\u304c\u898b\u8fbc\u3081\u307e\u3059\u3002<br \/>\n\u4e00\u6642\u30d5\u30a1\u30a4\u30eb\u9818\u57df\u306fwork_mem\u306b\u4e57\u308a\u5207\u3089\u306a\u3044\u30af\u30a8\u30ea\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6539\u5584\u3092\u671f\u5f85\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u9593\u9694\u306e\u8abf\u6574\u3067\u66f8\u304d\u8fbc\u307f\uff29\uff2f\u8ca0\u8377\u3092\u5206\u6563<\/h2>\n<p>\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u5909\u66f4\u5185\u5bb9\u3092\u5b9a\u671f\u7684\u306b\u30c6\u30fc\u30d6\u30eb\u306e\u5b9f\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u3080\u51e6\u7406\u3067\u3059\u3002<br \/>\n\u3053\u3053\u306e\u8a2d\u5b9a\u304c\u9069\u5207\u3067\u306a\u304b\u3063\u305f\u5834\u5408\u3001\u5b9a\u671f\u7684\u306b\u66f8\u304d\u8fbc\u307f\uff29\uff2f\u304c\u96c6\u4e2d\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u3001<br \/>\n\u300c\u3042\u308c\uff1f\u306a\u3093\u304b\u305f\u307e\u306b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5fdc\u7b54\u304c\u60aa\u3044\u306a\u3041\u3002\u3002\u300d<br \/>\n\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u95a2\u9023\u3059\u308b\u4e3b\u306a\u8a2d\u5b9a\u5024\u306f\u4ee5\u4e0b\u306e3\u3064\u3067\u3059\u3002<br \/>\n<strong><br \/>\n\u3000checkpoint_timeout -> \u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u9593\u9694(\u79d2)<br \/>\n\u3000checkpoint_completion_target -> \u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u51e6\u7406\u5b8c\u4e86\u76ee\u6a19<br \/>\n\u3000max_wal_size -> \u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u9593\u3067\u306e\u6700\u5927WAL\u30b5\u30a4\u30ba<br \/>\n<\/strong><br \/>\ncheckpoint_timeout\u306f\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u306e\u9593\u9694\u3067\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306e300\u306e\u5834\u5408\u30015\u5206\u304a\u304d\u306b\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u51e6\u7406\u304c\u884c\u308f\u308c\u307e\u3059\u3002<br \/>\ncheckpoint_completion_target\u306f\u3001\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u306e\u9593\u9694\u306b\u5bfe\u3057\u3066\u3069\u308c\u304f\u3089\u3044\u306e\u901f\u3055\u3067\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u51e6\u7406\u3092\u884c\u3046\u304b\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8a2d\u5b9a\u306f0.5\u3067\u3001checkpoint_timeout\u304c300\u306e\u5834\u5408\u3001150\u79d2\u3092\u671f\u9650\u3068\u3057\u3066\u7de9\u3084\u304b\u306b\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u51e6\u7406\u3092\u884c\u3044\u307e\u3059\u3002<br \/>\nmax_wal_size\u306f\u8a31\u5bb9\u3059\u308b\u6700\u5927WAL\u30b5\u30a4\u30ba\u3067\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f1GB\u3067\u3059\u3002<\/p>\n<p>\uff13\u3064\u306e\u8a2d\u5b9a\u304c\u3059\u3079\u3066\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u5834\u5408\u3001<\/p>\n<p><strong>\u300c5\u5206\u3054\u3068\u306b\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u51e6\u7406\u3092\u958b\u59cb\u3057\u3001150\u79d2\u304b\u3051\u3066\u7de9\u3084\u304b\u306b\u66f8\u304d\u8fbc\u307f\u884c\u3046\u3002\u305f\u3060\u3057\u30011GB\u4ee5\u4e0aWAL\u304c\u9032\u884c\u3057\u305f\u5834\u5408\u306f\u5373\u5ea7\u306b\u66f8\u304d\u8fbc\u3080\u3002\u300d<\/strong><\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u591a\u304f\u306e\u30b7\u30b9\u30c6\u30e0\u3067\u3053\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306f\u5168\u4f53\u7684\u306b\u4f4e\u3059\u304e\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u3067\u3059\u3002<br \/>\n\u30c1\u30a7\u30c3\u30af\u30dd\u30a4\u30f3\u30c8\u3067\u306e\u66f8\u304d\u8fbc\u307fI\/O\u304c\u3088\u308a\u5206\u6563\u3059\u308b\u3088\u3046\u3001\u8abf\u6574\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\ncheckpoint_completion_target\u306f\u6700\u5927\u30670.9\u3067\u3042\u308b\u3079\u304d\u3068\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u307e\u305f\u3001\u5168\u4f53\u7684\u306b\u8a2d\u5b9a\u5024\u3092\u5927\u304d\u304f\u3057\u305f\u5834\u5408\u3001\u672a\u53cd\u6620\u306eWAL\u304c\u5897\u3048\u308b\u3053\u3068\u306b\u306a\u308b\u305f\u3081\u3001\u30af\u30e9\u30c3\u30b7\u30e5\u6642\u306e\u30ea\u30ab\u30d0\u30ea\u51e6\u7406\u304c\u9577\u304f\u306a\u308b\u3053\u3068\u306b\u7559\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\uff08\u30ea\u30ab\u30d0\u30ea\u3067\u304d\u306a\u304f\u306a\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u308c\u306f \ud83d\ude3aTECHSCORE Advent Calendar 2019\ud83d\ude3a\u306e14\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306fPostgreSQL\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u95a2\u3059\u308b\u5c0f\u30cd\u30bf\u3092\u3042\u3064\u3081\u3066\u307f\u307e\u3057\u305f\u3002<br \/><a href=\"https:\/\/www.techscore.com\/blog\/2019\/12\/14\/postgresql-performance-tips\/\">\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[332,62,18],"tags":[141,57,23,206],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/24354"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=24354"}],"version-history":[{"count":8,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/24354\/revisions"}],"predecessor-version":[{"id":24637,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/24354\/revisions\/24637"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=24354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=24354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=24354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}