Anyone for prettyprinted EXPLAIN VERBOSE?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Anyone for prettyprinted EXPLAIN VERBOSE?
Date: 1999-12-17 23:34:25
Message-ID: 11821.945473665@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

When you do an EXPLAIN VERBOSE, two different representations of the
query plan are produced. The client sees something like this:

regression=> explain verbose select sum(f1) from int4_tbl;
NOTICE: QUERY DUMP:

{ AGG :cost 1.165 :size 5 :width 4 :state <> :qptargetlist ({ TARGETENTRY :resdom { RESDOM :resno 1 :restype 23 :restypmod -1 :resname "sum" :reskey 0 :reskeyop 0 :ressortgroupref 0 :resjunk false } :expr { AGGREG :aggname sum :basetype 23 :aggtype 23 :target { VAR :varno 0 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 1 :varoattno 1} :usenulls false }}) :qpqual <> :lefttree { SEQSCAN :cost 1.165 :size 5 :width 4 :state <> :qptargetlist ({ TARGETENTRY :resdom { RESDOM :resno 1 :restype 23 :restypmod -1 :resname "<>" :reskey 0 :reskeyop 0 :ressortgroupref 0 :resjunk false } :expr { VAR :varno 1 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 1 :varoattno 1}}) :qpqual <> :lefttree <> :righttree <> :extprm () :locprm () :initplan <> :nprm 0 :scanrelid 1 } :righttree <> :extprm () :locprm () :initplan <> :nprm 0 }

but in the postmaster log we format it like this:

NOTICE: QUERY PLAN:

Aggregate (cost=1.16 rows=5 width=4)
-> Seq Scan on int4_tbl (cost=1.16 rows=5 width=4)

{ AGG
:cost 1.165
:size 5
:width 4
:state <>
:qptargetlist (
{ TARGETENTRY
:resdom
{ RESDOM
:resno 1
:restype 23
:restypmod -1
:resname "sum"
:reskey 0
:reskeyop 0
:ressortgroupref 0
:resjunk false
}

:expr
{ AGGREG
:aggname sum
:basetype 23
:aggtype 23
:target
{ VAR
:varno 0
:varattno 1
:vartype 23
:vartypmod -1
:varlevelsup 0
:varnoold 1
:varoattno 1
}

:usenulls false
}
}
)

:qpqual <>
:lefttree
{ SEQSCAN
:cost 1.165
:size 5
:width 4
:state <>
:qptargetlist (
{ TARGETENTRY
:resdom
{ RESDOM
:resno 1
:restype 23
:restypmod -1
:resname "<>"
:reskey 0
:reskeyop 0
:ressortgroupref 0
:resjunk false
}

:expr
{ VAR
:varno 1
:varattno 1
:vartype 23
:vartypmod -1
:varlevelsup 0
:varnoold 1
:varoattno 1
}
}
)

:qpqual <>
:lefttree <>
:righttree <>
:extprm ()

:locprm ()

:initplan <>
:nprm 0
:scanrelid 1
}

:righttree <>
:extprm ()

:locprm ()

:initplan <>
:nprm 0
}

Does anyone think that the first form has any conceivable use? I would
like to get rid of it and deliver the prettyprinted format to both log
and client. I think it may have been done this way because old versions
of the backend didn't cope very gracefully with sending long NOTICE
messages to the client, but that constraint is history...

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-12-17 23:37:19 Re: [HACKERS] NOTICE: LockRelease: locktable lookup failed, no lock
Previous Message Hiroshi Inoue 1999-12-17 23:30:54 RE: [HACKERS] NOTICE: LockRelease: locktable lookup failed, no lock