EXPLAIN

Name

EXPLAIN  --  Shows statement execution details 文の実行についての詳細を示す。

Synopsis

EXPLAIN [ VERBOSE ] query        
  

入力

VERBOSE

Flag to show detailed query plan.

問い合わせ計画の詳細表示用のフラグ。

query

Any query.

任意の query

出力

NOTICE: QUERY PLAN: plan

Explicit query plan from the Postgres backend.

Postgres バックエンドからの明示的 な問い合わせ計画。

EXPLAIN

Flag sent after query plan is shown.

問い合わせ計画の表示の後に送られるフラグ。

説明

This command outputs details about the supplied query. The default output is the computed query cost. The cost value is only meaningful to the optimizer in comparing various query plans. VERBOSE displays the full query plan and cost to your screen, and pretty-prints the plan to the postmaster log file.

このコマンドの出力は与えられた問い合わせについての詳細を示し ます。デフォルトの出力は、計算された問い合わせコストです。コ ストの値は、オブティマイザが多数の問い合わせ計画を比較する場 合にのみ意味を持ちます。引数 VERBOSE は画面に全ての問い合わ せ計画とコストを表示し、postmaster のログファイルにその計画 を相当量出力します。

注意

There is only sparse documentation on the optimizer's use of cost information in Postgres. General information on cost estimation for query optimization can be found in database textbooks. Refer to the Programmer's Guide in the chapters on indexes and the genetic query optimizer for more information.

Postgres においてオブティマイザがどう コスト情報を使用するのかを示す文書はあまりありません。問い合わせ 最適化におけるコスト評価についての一般的な情報はデータベースの教 科書に記述されています。より詳細については プログラマ ガイド のインデックス、及び、遺伝的問い合わせオブテ ィマイザの章を参照して下さい。

使用法

To show a query plan for a simple query:

簡単な問い合わせに対する問い合わせ計画を表示します。

EXPLAIN select * from foo;
NOTICE:  QUERY PLAN:

Seq Scan on foo  (cost=0.00 rows=0 width=4)

EXPLAIN
   

互換性

SQL92

There is no EXPLAIN statement defined in SQL92.

SQL92 ではEXPLAIN 文は定義されていません。