Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
7a8d8748
Commit
7a8d8748
authored
Mar 13, 2016
by
Magnus Hagander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename auto_explain.sample_ratio to sample_rate
Per suggestion from Tomas Vondra Author: Julien Rouhaud
parent
a1aa8b7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
contrib/auto_explain/auto_explain.c
contrib/auto_explain/auto_explain.c
+5
-5
doc/src/sgml/auto-explain.sgml
doc/src/sgml/auto-explain.sgml
+6
-7
No files found.
contrib/auto_explain/auto_explain.c
View file @
7a8d8748
...
...
@@ -29,7 +29,7 @@ static bool auto_explain_log_triggers = false;
static
bool
auto_explain_log_timing
=
true
;
static
int
auto_explain_log_format
=
EXPLAIN_FORMAT_TEXT
;
static
bool
auto_explain_log_nested_statements
=
false
;
static
double
auto_explain_sample_rat
io
=
1
;
static
double
auto_explain_sample_rat
e
=
1
;
static
const
struct
config_enum_entry
format_options
[]
=
{
{
"text"
,
EXPLAIN_FORMAT_TEXT
,
false
},
...
...
@@ -163,10 +163,10 @@ _PG_init(void)
NULL
,
NULL
);
DefineCustomRealVariable
(
"auto_explain.sample_rat
io
"
,
DefineCustomRealVariable
(
"auto_explain.sample_rat
e
"
,
"Fraction of queries to process."
,
NULL
,
&
auto_explain_sample_rat
io
,
&
auto_explain_sample_rat
e
,
1
.
0
,
0
.
0
,
1
.
0
,
...
...
@@ -209,11 +209,11 @@ static void
explain_ExecutorStart
(
QueryDesc
*
queryDesc
,
int
eflags
)
{
/*
* For rat
io
sampling, randomly choose top-level statement. Either
* For rat
e
sampling, randomly choose top-level statement. Either
* all nested statements will be explained or none will.
*/
if
(
auto_explain_log_min_duration
>=
0
&&
nesting_level
==
0
)
current_query_sampled
=
(
random
()
<
auto_explain_sample_rat
io
*
current_query_sampled
=
(
random
()
<
auto_explain_sample_rat
e
*
MAX_RANDOM_VALUE
);
if
(
auto_explain_enabled
()
&&
current_query_sampled
)
...
...
doc/src/sgml/auto-explain.sgml
View file @
7a8d8748
...
...
@@ -206,18 +206,17 @@ LOAD 'auto_explain';
<varlistentry>
<term>
<varname>auto_explain.sample_rat
io
</varname> (<type>real</type>)
<varname>auto_explain.sample_rat
e
</varname> (<type>real</type>)
<indexterm>
<primary><varname>auto_explain.sample_rat
io
</> configuration parameter</primary>
<primary><varname>auto_explain.sample_rat
e
</> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
<varname>auto_explain.sample_ratio</varname> (<type>floating point</type>)
causes auto_explain to only explain a fraction of the statements in each
session. The default is 1, meaning explain all the queries. In case
of nested statements, either all will be explained or none. Only
superusers can change this setting.
<varname>auto_explain.sample_rate</varname> causes auto_explain to only
explain a fraction of the statements in each session. The default is 1,
meaning explain all the queries. In case of nested statements, either all
will be explained or none. Only superusers can change this setting.
</para>
</listitem>
</varlistentry>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment