Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7a8d874

Browse files
committed
Rename auto_explain.sample_ratio to sample_rate
Per suggestion from Tomas VondraAuthor: Julien Rouhaud
1 parenta1aa8b7 commit7a8d874

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

‎contrib/auto_explain/auto_explain.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static bool auto_explain_log_triggers = false;
2929
staticboolauto_explain_log_timing= true;
3030
staticintauto_explain_log_format=EXPLAIN_FORMAT_TEXT;
3131
staticboolauto_explain_log_nested_statements= false;
32-
staticdoubleauto_explain_sample_ratio=1;
32+
staticdoubleauto_explain_sample_rate=1;
3333

3434
staticconststructconfig_enum_entryformat_options[]= {
3535
{"text",EXPLAIN_FORMAT_TEXT, false},
@@ -163,10 +163,10 @@ _PG_init(void)
163163
NULL,
164164
NULL);
165165

166-
DefineCustomRealVariable("auto_explain.sample_ratio",
166+
DefineCustomRealVariable("auto_explain.sample_rate",
167167
"Fraction of queries to process.",
168168
NULL,
169-
&auto_explain_sample_ratio,
169+
&auto_explain_sample_rate,
170170
1.0,
171171
0.0,
172172
1.0,
@@ -209,11 +209,11 @@ static void
209209
explain_ExecutorStart(QueryDesc*queryDesc,inteflags)
210210
{
211211
/*
212-
* Forratio sampling, randomly choose top-level statement. Either
212+
* Forrate sampling, randomly choose top-level statement. Either
213213
* all nested statements will be explained or none will.
214214
*/
215215
if (auto_explain_log_min_duration >=0&&nesting_level==0)
216-
current_query_sampled= (random()<auto_explain_sample_ratio*
216+
current_query_sampled= (random()<auto_explain_sample_rate*
217217
MAX_RANDOM_VALUE);
218218

219219
if (auto_explain_enabled()&&current_query_sampled)

‎doc/src/sgml/auto-explain.sgml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,18 +206,17 @@ LOAD 'auto_explain';
206206

207207
<varlistentry>
208208
<term>
209-
<varname>auto_explain.sample_ratio</varname> (<type>real</type>)
209+
<varname>auto_explain.sample_rate</varname> (<type>real</type>)
210210
<indexterm>
211-
<primary><varname>auto_explain.sample_ratio</> configuration parameter</primary>
211+
<primary><varname>auto_explain.sample_rate</> configuration parameter</primary>
212212
</indexterm>
213213
</term>
214214
<listitem>
215215
<para>
216-
<varname>auto_explain.sample_ratio</varname> (<type>floating point</type>)
217-
causes auto_explain to only explain a fraction of the statements in each
218-
session. The default is 1, meaning explain all the queries. In case
219-
of nested statements, either all will be explained or none. Only
220-
superusers can change this setting.
216+
<varname>auto_explain.sample_rate</varname> causes auto_explain to only
217+
explain a fraction of the statements in each session. The default is 1,
218+
meaning explain all the queries. In case of nested statements, either all
219+
will be explained or none. Only superusers can change this setting.
221220
</para>
222221
</listitem>
223222
</varlistentry>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp