Ниже приведены результаты, полученные при
Ниже приведены результаты, полученные при выполнении команды EXPLAIN для запроса к таблице books базы данных booktown.
booktown=# EXPLAIN SELECT * FROM books AS b (book_id)
booktown-* NATURAL INNER JOIN editions;
NOTICE: QUERY PLAN:
Merge Join (cost=71.27..83.96 rows=150 width=64)
-> Sort (cost=1.44..1.44 rows=15 width=24)
-> Seq Scan on books b (cost=0.00..1.15 rows=15 width=24)
-> Sort (cost=69.83..69.83 rows=1000 width=40)
-> Seq Scan on editions (cost=0.00..20.00 rows=1000 width=40)
EXPLAIN
В следующем примере приведен расширенный вывод для более простого запроса с ключевым словом VERBOSE.
booktown=# EXPLAIN VERBOSE SELECT * FROM books;
NOTICE: QUERY DUMP:
{ SEQSCAN :startup_cost 0.00 :total_cost 1.15 :rows 15 :width 24 :qptargetlist
({ TARGETENTRY :resdom { RESDOM :resno 1 :restype 23 :restypmod -1 :resname id
:reskey 0 :reskeyop 0 :ressortgroupref 0 :resjunk false } :expr { VAR :varno 1
:varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 1 :varoattno 1}}
{ TARGETENTRY :resdom { RESDOM :resno 2 :restype 25 :restypmod -1 :resname title :reskey 0
:reskeyop 0 :ressortgroupref 0 :resjunk false } :expr { VAR :varno 1
:varattno 2 :vartype 25 :vartypmod -1 :varlevelsup 0 :varnoold 1 :varoattno 2}}
{ TARGETENTRY :resdom { RESDOM :resno 3 :restype 23 :restypmod -1 :resname
authoMd :reskey 0 :reskeyop 0 :ressortgroupref 0 :resjunk false } :expr
{ VAR :varno 1 :varattno 3 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold
1 :varoattno 3}} { TARGETENTRY :resdom { RESDOM :resno 4 :restype 23 :restypmod
-1 :resname subject_id :reskey 0 :reskeyop 0 :ressortgroupref 0 :resjunk false }
:expr { VAR :varno 1 :varattno 4 :vartype 23 :vartypmod -1 :varlevelsup 0
:varnoold 1 :varoattno 4}}) :qpqual <> :lefttree <> :righttree <> :extprm
0 :locprm 0 :initplan <> :nprm 0 :scanrelid 1 }
NOTICE: QUERY PLAN:
Seq Scan on books (cost=0.00..1.15 rows=15 width=24)
EXPLAIN