Re: [HACKERS] Anyone for prettyprinted EXPLAIN VERBOSE?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Anyone for prettyprinted EXPLAIN VERBOSE?
Date: 1999-12-18 00:33:20
Message-ID: 199912180033.TAA19425@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I remember Jan saying he liked the compressed one.

> 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
>
> ************
>

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vince Vielhaber 1999-12-18 01:19:08 RE: [HACKERS] Mail list archive search busted?
Previous Message Bruce Momjian 1999-12-18 00:28:57 Re: [HACKERS] psql/sql_help.h