The <filename>pg_overexplain</filename> module extends <command>EXPLAIN</command>
with new options that provide additional output. It is mostly intended to
assist with debugging of and development of the planner, rather than for
general use. Since this module displays internal details of planner data
structures, it may be necessary to refer to the source code to make sense
of the output. Furthermore, the output is likely to change whenever (and as
often as) those data structures change.
pg_overexplainモジュールは、EXPLAINを拡張して追加の情報を出力する新しいオプションを提供します。
これは主にプランナのデバッグと開発を支援することを目的としており、一般的な使用を目的としたものではありません。
このモジュールはプランナのデータ構造の内部詳細を表示するため、出力を理解するにはソースコードを参照する必要があるかもしれません。
さらに、これらのデータ構造が変更されるたびに(そして頻繁に)出力が変化する可能性があります。
To use it, simply load it into the server. You can load it into an individual session: 使用するには、サーバにロードするだけです。 個々のセッションにロードすることができます。
LOAD 'pg_overexplain';
You can also preload it into some or all sessions by including
<literal>pg_overexplain</literal> in
<xref linkend="guc-session-preload-libraries"/> or
<xref linkend="guc-shared-preload-libraries"/> in
<filename>postgresql.conf</filename>.
また、postgresql.confのsession_preload_librariesまたはshared_preload_librariesにpg_overexplainを含めることで、一部またはすべてのセッションで事前にロードすることもできます。
The <literal>DEBUG</literal> option displays miscellaneous information from
the plan tree that is not normally shown because it is not expected to be
of general interest. For each individual plan node, it will display the
following fields. See <literal>Plan</literal> in
<literal>nodes/plannodes.h</literal> for additional documentation of these
fields.
DEBUGオプションを使用すると、一般的には必要ないと想定されるために通常は表示されないさまざまなプランツリーの情報が表示されます。
個々のプランノードに対して、次のフィールドを表示します。
これらのフィールドの詳細については、nodes/plannodes.hのPlanを参照してください。
<literal>Disabled Nodes</literal>. Normal <command>EXPLAIN</command>
determines whether a node is disabled by checking whether the node's
count of disabled nodes is larger than the sum of the counts for the
underlying nodes. This option shows the raw counter value.
Disabled Nodes。
通常のEXPLAINは、ノードが無効化されているかどうかを判断するために、そのノードにおける無効化されたノードのカウンタが、その子ノードにおける無効化されたノードのカウンタの合計よりも多いかどうかを確認します。
このオプションでは、カウンタの値をそのまま表示します。
<literal>Parallel Safe</literal>. Indicates whether it would be safe for
a plan tree node to appear beneath a <literal>Gather</literal> or
<literal>Gather Merge</literal> node, regardless of whether it is
actually below such a node.
Parallel Safe。
プランツリーノードがGatherノードまたはGather Mergeノードの下に現れても安全かどうかを示します。
実際にこれらのノードの下にあるかどうかは関係ありません。
<literal>Plan Node ID</literal>. An internal ID number that should be
unique for every node in the plan tree. It is used to coordinate parallel
query activity.
Plan Node ID。
プランツリー内の各ノードで一意である内部ID番号。
パラレルクエリの活動を調整するために使用されます。
<literal>extParam</literal> and <literal>allParam</literal>. Information
about which numbered parameters affect this plan node or its children. In
text mode, these fields are only displayed if they are non-empty sets.
extParamおよびallParam。
このプランノードまたはその子ノードに影響する番号付きパラメータに関する情報。
テキストモードでは、これらのフィールドが空の集合ではない場合にのみ表示されます。
Once per query, the <literal>DEBUG</literal> option will display the
following fields. See <literal>PlannedStmt</literal> in
<literal>nodes/plannodes.h</literal> for additional detail.
問い合わせごとに1回、DEBUGオプションは次のフィールドを表示します。
詳細についてはnodes/plannodes.hのPlannedStmtを参照してください。
<literal>Command Type</literal>. For example, <literal>select</literal>
or <literal>update</literal>.
Command Type。
たとえば、selectやupdateです。
<literal>Flags</literal>. A comma-separated list of Boolean structure
member names from the <literal>PlannedStmt</literal> that are set to
<literal>true</literal>. It covers the following structure members:
<literal>hasReturning</literal>, <literal>hasModifyingCTE</literal>,
<literal>canSetTag</literal>, <literal>transientPlan</literal>,
<literal>dependsOnRole</literal>, <literal>parallelModeNeeded</literal>.
Flags。
PlannedStmt構造体の論理値型メンバのうち、trueに設定されているメンバ名をカンマで区切ったリスト。
対象となる構造体のメンバは、hasReturning、hasModifyingCTE、canSetTag、transientPlan、dependsOnRole、およびparallelModeNeededです。
<literal>Subplans Needing Rewind</literal>. Integer IDs of subplans that
may need to be rewound by the executor.
Subplans Needing Rewind。
エグゼキュータによる巻き戻しが必要なサブプランの整数値ID。
<literal>Relation OIDs</literal>. OIDs of relations upon which this plan
depends.
Relation OIDs。
このプランに関わるリレーションのOID。
<literal>Executor Parameter Types</literal>. Type OID for each executor parameter
(e.g. when a nested loop is chosen and a parameter is used to pass a value down
to an inner index scan). Does not include parameters supplied to a prepared
statement by the user.
Executor Parameter Types。
各エグゼキュータパラメータの型OID(たとえば、ネステッドループが選択されて内側のインデックススキャンに値を渡すためにパラメータが使用される場合)。
ユーザがプリペアドステートメントに提供するパラメータは含まれません。
<literal>Parse Location</literal>. Location within the query string
supplied to the planner where this query's text can be found. May be
<literal>Unknown</literal> in some contexts. Otherwise, may be
<literal>NNN to end</literal> for some integer <literal>NNN</literal> or
<literal>NNN for MMM bytes</literal> for some integers
<literal>NNN</literal> and <literal>MMM</literal>.
Parse Location。
プランナに渡された問い合わせ文字列内で、この問い合わせテキストが見つかる位置。
場合によってはUnknownになることがあります。
それ以外の場合、整数値NNNに対してNNN to end、または整数値NNNとMMMに対してNNN for MMM bytesになることがあります。
The <literal>RANGE_TABLE</literal> option displays information from the
plan tree specifically concerning the query's range table. Range table
entries correspond roughly to items appearing in the query's
<literal>FROM</literal> clause, but with numerous exceptions. For example,
subqueries that are proved unnecessary may be deleted from the range table
entirely, while inheritance expansion adds range table entries for child
tables that are not named directly in the query.
RANGE_TABLEオプションは、特に問い合わせの範囲テーブルに関するプランツリーの情報を表示します。
範囲テーブルの項目は問い合わせのFROM句に含まれる項目とほぼ一致しますが、多くの例外があります。
たとえば、不要であることが判明した副問い合わせは範囲テーブルから完全に削除される場合がある一方で、継承を展開するときには問い合わせで直接名前が付けられていない子テーブルに対して範囲テーブルの項目が追加されます。
Range table entries are generally referenced within the query plan by a
range table index, or RTI. Plan nodes that reference one or more RTIs will
be labelled accordingly, using one of the following fields: <literal>Scan
RTI</literal>, <literal>Nominal RTI</literal>, <literal>Exclude Relation
RTI</literal>, <literal>Append RTIs</literal>.
範囲テーブルの項目は通常、範囲テーブルインデックス(RTI)によって問い合わせ計画内で参照されます。
1つ以上のRTIを参照するプランノードは、Scan RTI、Nominal RTI、Exclude Relation RTI、およびAppend RTIsのフィールドのいずれかを使用し、それに応じてラベルが付けられます。
In addition, the query as a whole may maintain lists of range table indexes
that are needed for various purposes. These lists will be displayed once
per query, labelled as appropriate as <literal>Unprunable RTIs</literal> or
<literal>Result RTIs</literal>. In text mode, these fields are only
displayed if they are non-empty sets.
さらに、問い合わせ全体では、さまざまな目的に必要な範囲テーブルインデックスのリストが保持される場合があります。
これらのリストは問い合わせごとに1回表示され、必要に応じてUnprunable RTIsまたはResult RTIsというラベルが付けられます。
テキストモードでは、これらのフィールドが空の集合ではない場合にのみ表示されます。
Finally, but most importantly, the <literal>RANGE_TABLE</literal> option
will display a dump of the query's entire range table. Each range table
entry is labelled with the appropriate range table index, the kind of range
table entry (e.g. <literal>relation</literal>,
<literal>subquery</literal>, or <literal>join</literal>), followed by the
contents of various range table entry fields that are not normally part of
<literal>EXPLAIN</literal> output. Some of these fields are only displayed
for certain kinds of range table entries. For example,
<literal>Eref</literal> is displayed for all types of range table entries,
but <literal>CTE Name</literal> is displayed only for range table entries
of type <literal>cte</literal>.
最後に、最も重要なのは、RANGE_TABLEオプションは問い合わせの範囲テーブル全体のダンプを表示するということです。
各範囲テーブルの項目には、適切な範囲テーブルインデックス、範囲テーブルの項目の種類(例えば、relation、subquery、またはjoinなど)のラベルが付けられ、その後に通常のEXPLAINによる出力には含まれない範囲テーブルの項目のフィールドに関する様々な内容が表示されます。
これらのフィールドの一部は、特定種類の範囲テーブルの項目でのみ表示されます。
たとえば、Erefはすべての種類の範囲テーブルの項目で表示されますが、CTE Nameはcteの範囲テーブルの項目でのみ表示されます。
For more information about range table entries, see the definition of
<literal>RangeTblEntry</literal> in <literal>nodes/plannodes.h</literal>.
範囲テーブルの項目の詳細については、nodes/plannodes.hのRangeTblEntryの定義を参照してください。