Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9VZ3-0004by-B0 for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Mar 2019 13:59:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h9VZ1-0004ZE-SC for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Mar 2019 13:59:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9VZ1-0004Z7-8v for pgsql-hackers@lists.postgresql.org; Thu, 28 Mar 2019 13:59:27 +0000 Received: from mail-it1-x141.google.com ([2607:f8b0:4864:20::141]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h9VYx-0001A6-IJ for pgsql-hackers@postgresql.org; Thu, 28 Mar 2019 13:59:25 +0000 Received: by mail-it1-x141.google.com with SMTP id h9so6182813itl.1 for ; Thu, 28 Mar 2019 06:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=N2l8+AjIxpBzLx2XoZ5HCIMl5JESf4po7MLPpu/3y7w=; b=IiXmsEOnRgWwt0zidYNs1p3azg12wvxGnE3m1Ppfbjyrh0egHwOQJLskGYn/lxgR4r pQ24IEllFIaMLvPvN2WOoTmgOMbXpvzy7yKa/6EWeUCRGVMZlwnQOvR2S6w2JuAPonaJ TZK0bjN62OXziRsiS5rzIPAd7VGKeOzSjgUCA4UNRtSgqAhcs09dQ5x0b1xSfimWlnXr fq/+QNhsFhPsMnICJS7Y8KTTDayj+eFxfGEBC2xZs0IeYeQZl0cfqZk4KP3fGSBUk2V4 rgNCsYSrlRf91BXgp/1XBIppMRqdMP7xVO7gNKjDMU6V+qgio6E32X6ikNnMOKM+8W0S w6+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=N2l8+AjIxpBzLx2XoZ5HCIMl5JESf4po7MLPpu/3y7w=; b=C/znYCRefXjfyQpUH0ig04Xqj9Hf09/o+OIBi3WD+VDjL8fTpsTHEL3y7qFHUINpgI sGja3Iq4kqXNT5pfY/VJYyA0nbz+heHNutGRMAr6DXkZ4ejZffp8RPqzzTI8lpur5j+9 XvhF0LKdVQf5Lx1NST+IqYcfQTGhEIkmtG5SSWvIYDS58lc/CyUaOiK86iNHkKiPlYRE VEkOXIyaRIr8va9eeB2obqhOluMSpGrKVbSw/kEYmbn62v4B63/GPdP0GAJ5Y3GR53Eq HLKO+mJI0iPcjGxQVKBxrH8WaJgu3sAGIlh2CeLefJ95xNy2EAuGrJNLessyYMi7Qzbs X3Aw== X-Gm-Message-State: APjAAAVoMDn8SmTu2vwddbVh+Iu13b7Tv8Nn5QhjFTkEDomN5Mqm1ywn +jhrhrZ4JepIMZM/Xm06XVQBHuEh3Zo= X-Google-Smtp-Source: APXvYqyrkbA97hC6Vttr7EjC/IoUYxysfJQnw+jWFCXkSOvS3dq+cB/rc3f5WxUF5u8BdnoO8cBOVw== X-Received: by 2002:a24:424a:: with SMTP id i71mr83750itb.135.1553781562591; Thu, 28 Mar 2019 06:59:22 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id 136sm1891379itu.35.2019.03.28.06.59.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 06:59:20 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id D2CA4801117; Thu, 28 Mar 2019 08:59:18 -0500 (CDT) Date: Thu, 28 Mar 2019 08:59:18 -0500 From: Justin Pryzby To: pgsql-hackers@postgresql.org Cc: Alvaro Herrera , Adrien NAYRAT , Christoph Berg Subject: clean up docs for log_statement_sample_rate Message-ID: <20190328135918.GA27808@telsasoft.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="PEIAKu/WMn1b1Hv9" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Following the dicussion here, https://www.postgresql.org/message-id/flat/CAD21AoB9%2By8N4%2BFan-ne-_7J5yTybPttxeVKfwUocKp4zT1vNQ%40mail.gmail.com#90a8316b1e643532e1cdb352c91c22a7 I'm proposing these changes to clean up docs for previous (more or less unrelated) commit. From 15d42c5a8f2f811a7add3e4179edcc1f7cd291f7 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Thu, 28 Mar 2019 08:53:26 -0500 Subject: [PATCH v1] Clean up docs for log_statement_sample_rate.. ..which was added at commit 88bdbd3f746049834ae3cc972e6e650586ec3c9d --- doc/src/sgml/config.sgml | 18 +++++++++--------- src/backend/utils/misc/guc.c | 4 ++-- src/backend/utils/misc/postgresql.conf.sample | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index d383de2..4019a31 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -5786,9 +5786,9 @@ local0.* /var/log/postgresql Causes the duration of each completed statement to be logged if the statement ran for at least the specified number of milliseconds, modulated by log_statement_sample_rate. - Setting this to zero prints all statement durations. Minus-one (the default) - disables logging statement durations. For example, if you set it to - 250ms then all SQL statements that run 250ms or longer + Setting this to zero prints all statement durations. -1 (the default) + disables logging statements due to exceeding duration threshold. For example, if you set it to + 250ms, then all SQL statements that run 250ms or longer will be logged. Enabling this parameter can be helpful in tracking down unoptimized queries in your applications. Only superusers can change this setting. @@ -5824,13 +5824,13 @@ local0.* /var/log/postgresql - Determines the fraction of the statements that exceed - which to log. - The default is 1, meaning log to all such + Determines the fraction of statements that exceed + to be logged. + The default is 1, meaning log all such statements. - Setting this to zero disables logging, same as setting + Setting this to zero disables logging by duration, same as setting log_min_duration_statement - to minus-one. log_statement_sample_rate + to -1. log_statement_sample_rate is helpful when the traffic is too high to log all queries. @@ -6083,7 +6083,7 @@ local0.* /var/log/postgresql - The difference between setting this option and setting + The difference between enabling log_duration and setting to zero is that exceeding log_min_duration_statement forces the text of the query to be logged, but this option doesn't. Thus, if diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index aa564d1..415cd78 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -3357,8 +3357,8 @@ static struct config_real ConfigureNamesReal[] = { {"log_statement_sample_rate", PGC_SUSET, LOGGING_WHEN, - gettext_noop("Fraction of statements over log_min_duration_statement to log."), - gettext_noop("If you only want a sample, use a value between 0 (never " + gettext_noop("Fraction of statements exceeding log_min_duration_statement to be logged."), + gettext_noop("If you only want a sample, use a value between 0.0 (never " "log) and 1.0 (always log).") }, &log_statement_sample_rate, diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index cccb5f1..684f5e7 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -489,9 +489,9 @@ # 0 logs all statement, > 0 logs only statements running at # least this number of milliseconds. -#log_statement_sample_rate = 1 # Fraction of logged statements over - # log_min_duration_statement. 1.0 logs all statements, - # 0 never logs. +#log_statement_sample_rate = 1.0 # Fraction of logged statements exceeding + # log_min_duration_statement to be logged + # 1.0 logs all statements, 0.0 never logs # - What to Log - --PEIAKu/WMn1b1Hv9 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v1-0001-Clean-up-docs-for-log_statement_sample_rate.patch" From 15d42c5a8f2f811a7add3e4179edcc1f7cd291f7 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Thu, 28 Mar 2019 08:53:26 -0500 Subject: [PATCH v1] Clean up docs for log_statement_sample_rate.. ..which was added at commit 88bdbd3f746049834ae3cc972e6e650586ec3c9d --- doc/src/sgml/config.sgml | 18 +++++++++--------- src/backend/utils/misc/guc.c | 4 ++-- src/backend/utils/misc/postgresql.conf.sample | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index d383de2..4019a31 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -5786,9 +5786,9 @@ local0.* /var/log/postgresql Causes the duration of each completed statement to be logged if the statement ran for at least the specified number of milliseconds, modulated by log_statement_sample_rate. - Setting this to zero prints all statement durations. Minus-one (the default) - disables logging statement durations. For example, if you set it to - 250ms then all SQL statements that run 250ms or longer + Setting this to zero prints all statement durations. -1 (the default) + disables logging statements due to exceeding duration threshold. For example, if you set it to + 250ms, then all SQL statements that run 250ms or longer will be logged. Enabling this parameter can be helpful in tracking down unoptimized queries in your applications. Only superusers can change this setting. @@ -5824,13 +5824,13 @@ local0.* /var/log/postgresql - Determines the fraction of the statements that exceed - which to log. - The default is 1, meaning log to all such + Determines the fraction of statements that exceed + to be logged. + The default is 1, meaning log all such statements. - Setting this to zero disables logging, same as setting + Setting this to zero disables logging by duration, same as setting log_min_duration_statement - to minus-one. log_statement_sample_rate + to -1. log_statement_sample_rate is helpful when the traffic is too high to log all queries. @@ -6083,7 +6083,7 @@ local0.* /var/log/postgresql - The difference between setting this option and setting + The difference between enabling log_duration and setting to zero is that exceeding log_min_duration_statement forces the text of the query to be logged, but this option doesn't. Thus, if diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index aa564d1..415cd78 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -3357,8 +3357,8 @@ static struct config_real ConfigureNamesReal[] = { {"log_statement_sample_rate", PGC_SUSET, LOGGING_WHEN, - gettext_noop("Fraction of statements over log_min_duration_statement to log."), - gettext_noop("If you only want a sample, use a value between 0 (never " + gettext_noop("Fraction of statements exceeding log_min_duration_statement to be logged."), + gettext_noop("If you only want a sample, use a value between 0.0 (never " "log) and 1.0 (always log).") }, &log_statement_sample_rate, diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index cccb5f1..684f5e7 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -489,9 +489,9 @@ # 0 logs all statement, > 0 logs only statements running at # least this number of milliseconds. -#log_statement_sample_rate = 1 # Fraction of logged statements over - # log_min_duration_statement. 1.0 logs all statements, - # 0 never logs. +#log_statement_sample_rate = 1.0 # Fraction of logged statements exceeding + # log_min_duration_statement to be logged + # 1.0 logs all statements, 0.0 never logs # - What to Log - -- 2.1.4 --PEIAKu/WMn1b1Hv9--