analyzing debugging sentences.

Started by jungmin shinabout 19 years ago3 messages
#1jungmin shin
jungmin.shin@gmail.com

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

#2Andrew Dunstan
andrew@dunslane.net
In reply to: jungmin shin (#1)
Re: analyzing debugging sentences.

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

#3Martijn van Oosterhout
kleptog@svana.org
In reply to: jungmin shin (#1)
Re: analyzing debugging sentences.

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/

Show quoted text

From each according to his ability. To each according to his ability to litigate.