Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

A postgres session (or postgresql.conf file) accepts the parameter 'debug_print_plan' [1]: if set to 'on' (or 1) postgresql will write planner details to the logfile:

$ psql psql (9.3devel) Type "help" for help. testdb=# set debug_print_plan=1; SET testdb=# select 42; ?column? ---------- 42 (1 row) testdb=# \q 2012-10-30 23:57:03.757 CET 21837 LOG: plan: 2012-10-30 23:57:03.757 CET 21837 DETAIL: {PLANNEDSTMT :commandType 1 :queryId 0 :hasReturning false :hasModifyingCTE false :canSetTag true :transientPlan false :planTree {RESULT :startup_cost 0.00 :total_cost 0.01 :plan_rows 1 :plan_width 0 :targetlist ( {TARGETENTRY :expr {CONST :consttype 23 :consttypmod -1 :constcollid 0 :constlen 4 :constbyval true :constisnull false :location 7 :constvalue 4 [ 42 0 0 0 0 0 0 0 ] } :resno 1 :resname ?column? :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } ) :qual <> :lefttree <> :righttree <> :initPlan <> :extParam (b) :allParam (b) :resconstantqual <> } :rtable <> :resultRelations <> :utilityStmt <> :subplans <> :rewindPlanIDs (b) :rowMarks <> :relationOids <> :invalItems <> :nParamExec 0 } 2012-10-30 23:57:03.757 CET 21837 STATEMENT: select 42;

This is all written to the logfile so to me it seems not very likely the case for the OP. He (or some SQL-generator) probably just forgot to take an 'EXPLAIN'-prefix from an SQL statement.

[1] runtime-config-logging.html (postgres manual)

update (2012.10.30): show use in session setting (not postgresql.conf setting).


In reply to Re^2: DBI::Pg returns select plan on execute by erix
in thread DIB:Pg returns select plan on execute by solfier

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-19 20:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found