{"id":6449,"date":"2023-01-13T16:10:17","date_gmt":"2023-01-13T07:10:17","guid":{"rendered":"https:\/\/www.lancard.com\/blog\/?p=6449"},"modified":"2025-03-12T11:25:24","modified_gmt":"2025-03-12T02:25:24","slug":"postgresql-statement_timeout-peruser","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2023\/01\/13\/postgresql-statement_timeout-peruser\/","title":{"rendered":"PostgreSQL\u306estatement_timeout\u3092\u6307\u5b9a\u30e6\u30fc\u30b6\u306b\u3060\u3051\u8a2d\u5b9a\u3059\u308b"},"content":{"rendered":"\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n\u901a\u5e38\u4f7f\u3046\u30e6\u30fc\u30b6\u306e\u884c\u3046pg_dump\u3084vacuumdb\u306b\u306f\u5f71\u97ff\u3055\u305b\u305f\u304f\u306a\u3044\u306e\u3067\u3001\u30e6\u30fc\u30b6A\u304c\u5b9f\u884c\u3057\u3066\u3044\u308b\u6642\u3060\u305130\u79d2\u3067statement_timeout\u3055\u305b\u305f\u3044\u3002\n<\/div>\n<\/div>\n\n\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n\u3068\u8a00\u3063\u305f\u6642\u306b\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u3054\u3068\u306b SET statement_timeout \u3092\u3084\u308b\u306e\u3082\u9762\u5012\u3060\u3057\u5165\u529b\u6f0f\u308c\u304c\u51fa\u308b\u306e\u3067\u3001\u30e6\u30fc\u30b6A\u3060\u3051\u30c7\u30d5\u30a9\u30eb\u30c8\u306730\u79d2\u306b\u51fa\u6765\u308c\u3070\u697d\u3067\u3059\u3002\n<\/div>\n<\/div>\n\n\n\n\n<!--more-->\n\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n\n\u305d\u3093\u306a\u308f\u3051\u3067\u3001\u30e6\u30fc\u30b6\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\n\n\n\n\n<pre class=\"wp-block-code\"><code>ALTER ROLE &#91;\u30e6\u30fc\u30b6A] SET statement_timeout TO 30000; -- 30sec\nSHOW statement_timeout; -- \u30bb\u30c3\u30b7\u30e7\u30f3\u4e2d\u306f\u4ee5\u524d\u306e\u8a2d\u5b9a\u306e\u307e\u307e\u5909\u308f\u3089\u305a\uff1f<\/code><\/pre>\n\n\n\n\n\u30bb\u30c3\u30b7\u30e7\u30f3\u7d42\u4e86\u5f8c\u306b\u6709\u52b9\u306b\u306a\u308b\u3088\u3046\u3067\u3059\u306e\u3067\u3001\u4e00\u65e6\u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u7d42\u4e86\u3055\u305b\u518d\u5ea6\u30bb\u30c3\u30b7\u30e7\u30f3\u306b\u5165\u3063\u3066\u78ba\u8a8d\u3057\u307e\u3059\u3002\n\n\n\n\n<pre class=\"wp-block-code\"><code>SHOW statement_timeout; -- 30000 \u3067\u51fa\u529b<\/code><\/pre>\n\n\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<ul class=\"wp-block-list\">\n<li>\u3053\u306e\u5f8c\u3001\u30ea\u30b9\u30bf\u30fc\u30c8\u3057\u3066\u3082\u5024\u306f\u4fdd\u6301\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/li>\n\n\n\n<li>\u4ed6\u306e\u672a\u8a2d\u5b9a\u30e6\u30fc\u30b6\u3067\u898b\u308b\u3068\u3001\u521d\u671f\u5024\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\uff08postgresql.conf\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306f0\uff09\u3002<\/li>\n\n\n\n<li>\u307e\u305f\u30e6\u30fc\u30b6\u8a2d\u5b9a\u3057\u3066\u3044\u3066\u3082\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u5185\u306eSET statement_timeout\u3067\u30bb\u30c3\u30b7\u30e7\u30f3\u4e2d\u306e\u307f\u4e0a\u66f8\u304d\u53ef\u80fd\u3067\u3059\u3002<\/li>\n<\/ul>\n<\/div>\n<\/div>\n\n\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n\u3061\u306a\u307f\u306b\u30011\uff081\u30df\u30ea\u79d2\uff09\u306b\u8a2d\u5b9a\u3059\u308b\u3068\\d\u3059\u3089\u5931\u6557\u3057\u307e\u3059\uff08\u3067\u3082SET\u3067\u4e0a\u66f8\u304d\u306f\u51fa\u6765\u307e\u3057\u305f\uff09\u3002<br>\u305d\u3046\u8a00\u3046\u30e6\u30fc\u30b6\u4f5c\u308b\u30e1\u30ea\u30c3\u30c8\u6709\u308b\u304b\u306f\u7591\u554f\u3067\u3059\u304c\u3002\n<\/div>\n<\/div>\n\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F6449&amp;t=PostgreSQL%E3%81%AEstatement_timeout%E3%82%92%E6%8C%87%E5%AE%9A%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%AB%E3%81%A0%E3%81%91%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B&amp;s=100&amp;p[url]=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F6449&amp;p[images][0]=&amp;p[title]=PostgreSQL%E3%81%AEstatement_timeout%E3%82%92%E6%8C%87%E5%AE%9A%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%AB%E3%81%A0%E3%81%91%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F6449&amp;text=PostgreSQL%E3%81%AEstatement_timeout%E3%82%92%E6%8C%87%E5%AE%9A%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%AB%E3%81%A0%E3%81%91%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&amp;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F6449&amp;title=PostgreSQL%E3%81%AEstatement_timeout%E3%82%92%E6%8C%87%E5%AE%9A%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%AB%E3%81%A0%E3%81%91%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&amp;v=3&amp;t=PostgreSQL%E3%81%AEstatement_timeout%E3%82%92%E6%8C%87%E5%AE%9A%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%AB%E3%81%A0%E3%81%91%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B&amp;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F6449\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=PostgreSQL%E3%81%AEstatement_timeout%E3%82%92%E6%8C%87%E5%AE%9A%E3%83%A6%E3%83%BC%E3%82%B6%E3%81%AB%E3%81%A0%E3%81%91%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B&amp;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F6449\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>\u901a\u5e38\u4f7f\u3046\u30e6\u30fc\u30b6\u306e\u884c\u3046pg_dump\u3084vacuumdb\u306b\u306f\u5f71\u97ff\u3055\u305b\u305f\u304f\u306a\u3044\u306e\u3067\u3001\u30e6\u30fc\u30b6A\u304c\u5b9f\u884c\u3057\u3066\u3044\u308b\u6642\u3060\u305130\u79d2\u3067statement_timeout\u3055\u305b\u305f\u3044\u3002 \u3068\u8a00\u3063\u305f\u6642\u306b\u3001\u30bb\u30c3\u30b7\u30e7\u30f3\u3054\u3068\u306b SET statement_ [&hellip;]<\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6449","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/6449","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=6449"}],"version-history":[{"count":40,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/6449\/revisions"}],"predecessor-version":[{"id":6489,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/6449\/revisions\/6489"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=6449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=6449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=6449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}