Обсуждение: analyzing debugging sentences.
Hello,
I set on for following items in postgresql.conf
debug_print_parse
debug_print_rewritten
debug_print_plan
debug_print_pretty
now, I can see something in PGAdmin query tool when I execute a query.
can I get some idea how I can read comprehend the output?
-- Executing query: select 0.4 * 0.5; DEBUG: parse tree: DETAIL: {QUERY :commandType 1 :querySource 0 :canSetTag true :utilityStmt <> :resultRelation 0 :into <> :hasAggs false :hasSubLinks false :rtable <> :jointree {FROMEXPR :fromlist <> :quals <> } :rowMarks <> :forUpdate false :rowNoWait false :targetList ( {TARGETENTRY :expr {OPEXPR :opno 1760 :opfuncid 0 :opresulttype 1700 :opretset false :args ( {CONST :consttype 1700 :constlen -1 :constbyval false :constisnull false :constvalue 10 [ 10 0 0 0 -1 -1 1 0 -96 15 ] } {CONST :consttype 1700 :constlen -1 :constbyval false :constisnull false :constvalue 10 [ 10 0 0 0 -1 -1 1 0 -120 19 ] } ) } :resno 1 :resname ?column? :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } ) :groupClause <> :havingQual <> :distinctClause <> :sortClause <> :limitOffset <> :limitCount <> :setOperations <> :resultRelations <> } DEBUG: rewritten parse tree: DETAIL: ( {QUERY :commandType 1 :querySource 0 :canSetTag true :utilityStmt <> :resultRelation 0 :into <> :hasAggs false :hasSubLinks false :rtable <> :jointree {FROMEXPR :fromlist <> :quals <> } :rowMarks <> :forUpdate false :rowNoWait false :targetList ( {TARGETENTRY :expr {OPEXPR :opno 1760 :opfuncid 0 :opresulttype 1700 :opretset false :args ( {CONST :consttype 1700 :constlen -1 :constbyval false :constisnull false :constvalue 10 [ 10 0 0 0 -1 -1 1 0 -96 15 ] } {CONST :consttype 1700 :constlen -1 :constbyval false :constisnull false :constvalue 10 [ 10 0 0 0 -1 -1 1 0 -120 19 ] } ) } :resno 1 :resname ?column? :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } ) :groupClause <> :havingQual <> :distinctClause <> :sortClause <> :limitOffset <> :limitCount <> :setOperations <> :resultRelations <> } ) DEBUG: plan: DETAIL: {RESULT :startup_cost 0.00 :total_cost 0.01 :plan_rows 1 :plan_width 0 :targetlist ( {TARGETENTRY :expr {OPEXPR :opno 1760 :opfuncid 1726 :opresulttype 1700 :opretset false :args ( {CONST :consttype 1700 :constlen -1 :constbyval false :constisnull false :constvalue 10 [ 10 0 0 0 -1 -1 1 0 -96 15 ] } {CONST :consttype 1700 :constlen -1 :constbyval false :constisnull false :constvalue 10 [ 10 0 0 0 -1 -1 1 0 -120 19 ] } ) } :resno 1 :resname ?column? :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } ) :qual <> :lefttree <> :righttree <> :initPlan <> :extParam (b) :allParam (b) :nParamExec 0 :resconstantqual <> }
--
Jungmin Shin
jungmin shin wrote: > > Hello, > > I set on for following items in postgresql.conf > > debug_print_parse > debug_print_rewritten > debug_print_plan > debug_print_pretty > > now, I can see something in PGAdmin query tool when I execute a query. > can I get some idea how I can read comprehend the output? > Please ask your question on the right list - this list is only for discussion about development of postgres itself, not about how to use it. You probably want pgsql-general. cheers andrew
On Wed, Oct 18, 2006 at 02:11:53PM -0400, jungmin shin wrote: > Hello, > > I set on for following items in postgresql.conf > > debug_print_parse > debug_print_rewritten > debug_print_plan > debug_print_pretty > > now, I can see something in PGAdmin query tool when I execute a query. > can I get some idea how I can read comprehend the output? <snip> It's almost (with a few exceptions) an exact repesentation of the in memory structures. If you look in readfuncs.c and outfuncs.c you can see the code that generates it. CONST is a ConstNode OPEXPR is an OpExprNode etc... So you'll have to read the header files to understand what they mean. Hope this helps, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to litigate.