Thread: Adjusting debug_print_plan to be more useful by default

Adjusting debug_print_plan to be more useful by default

From
Tom Lane
Date:
Back in April we changed EXPLAIN VERBOSE to not dump the internal plan
tree anymore, on the grounds that non-hackers didn't want that info and
hackers could get it with debug_print_plan and related variables.
Well, now that I've tried to do some planner development work relying on
debug_print_plan instead of EXPLAIN VERBOSE, I find it a mite annoying.
It's not sufficient to set debug_print_plan = true, because the output
comes out at priority DEBUG1, which is to say it doesn't come out at all
in a default configuration.  If you boost up client_min_messages or
log_min_messages so you can see it, you get lots of extraneous debugging
messages too.

I'd like to propose that the messages emitted by debug_print_plan
and friends be given priority LOG rather than DEBUG1.  If you've gone
to the trouble of turning on the variable, then you presumably want the
results, so it seems dumb to print them at a priority that isn't logged
by default.  (Note that this is biased to the assumption that you want
the messages in the postmaster log, not on the console.  Which is
usually what I want, but maybe someone wants to argue for NOTICE?)

I'd also like to propose making debug_pretty_print default to ON.
At least for me, the other formatting is 100% unreadable.

Comments?
        regards, tom lane


Re: Adjusting debug_print_plan to be more useful by default

From
Simon Riggs
Date:
On Tue, 2008-08-19 at 12:40 -0400, Tom Lane wrote:
> Back in April we changed EXPLAIN VERBOSE to not dump the internal plan
> tree anymore, on the grounds that non-hackers didn't want that info and
> hackers could get it with debug_print_plan and related variables.
> Well, now that I've tried to do some planner development work relying on
> debug_print_plan instead of EXPLAIN VERBOSE, I find it a mite annoying.
> It's not sufficient to set debug_print_plan = true, because the output
> comes out at priority DEBUG1, which is to say it doesn't come out at all
> in a default configuration.  If you boost up client_min_messages or
> log_min_messages so you can see it, you get lots of extraneous debugging
> messages too.
> 
> I'd like to propose that the messages emitted by debug_print_plan
> and friends be given priority LOG rather than DEBUG1.  If you've gone
> to the trouble of turning on the variable, then you presumably want the
> results, so it seems dumb to print them at a priority that isn't logged
> by default.  (Note that this is biased to the assumption that you want
> the messages in the postmaster log, not on the console.  Which is
> usually what I want, but maybe someone wants to argue for NOTICE?)
> 
> I'd also like to propose making debug_pretty_print default to ON.
> At least for me, the other formatting is 100% unreadable.

+1

-- Simon Riggs           www.2ndQuadrant.comPostgreSQL Training, Services and Support



Re: Adjusting debug_print_plan to be more useful by default

From
daveg
Date:
On Tue, Aug 19, 2008 at 06:33:33PM +0100, Simon Riggs wrote:
> 
> On Tue, 2008-08-19 at 12:40 -0400, Tom Lane wrote:
> > Back in April we changed EXPLAIN VERBOSE to not dump the internal plan
> > tree anymore, on the grounds that non-hackers didn't want that info and
> > hackers could get it with debug_print_plan and related variables.
> > Well, now that I've tried to do some planner development work relying on
> > debug_print_plan instead of EXPLAIN VERBOSE, I find it a mite annoying.
> > It's not sufficient to set debug_print_plan = true, because the output
> > comes out at priority DEBUG1, which is to say it doesn't come out at all
> > in a default configuration.  If you boost up client_min_messages or
> > log_min_messages so you can see it, you get lots of extraneous debugging
> > messages too.
> > 
> > I'd like to propose that the messages emitted by debug_print_plan
> > and friends be given priority LOG rather than DEBUG1.  If you've gone
> > to the trouble of turning on the variable, then you presumably want the
> > results, so it seems dumb to print them at a priority that isn't logged
> > by default.  (Note that this is biased to the assumption that you want
> > the messages in the postmaster log, not on the console.  Which is
> > usually what I want, but maybe someone wants to argue for NOTICE?)
> > 
> > I'd also like to propose making debug_pretty_print default to ON.
> > At least for me, the other formatting is 100% unreadable.
> 
> +1

+1

-dg

-- 
David Gould       daveg@sonic.net      510 536 1443    510 282 0869
If simplicity worked, the world would be overrun with insects.


Re: Adjusting debug_print_plan to be more useful by default

From
Hannu Krosing
Date:
On Tue, 2008-08-19 at 12:40 -0400, Tom Lane wrote:
> Back in April we changed EXPLAIN VERBOSE to not dump the internal plan
> tree anymore, on the grounds that non-hackers didn't want that info and
> hackers could get it with debug_print_plan and related variables.
> Well, now that I've tried to do some planner development work relying on
> debug_print_plan instead of EXPLAIN VERBOSE, I find it a mite annoying.
> It's not sufficient to set debug_print_plan = true, because the output
> comes out at priority DEBUG1, which is to say it doesn't come out at all
> in a default configuration.  If you boost up client_min_messages or
> log_min_messages so you can see it, you get lots of extraneous debugging
> messages too.
> 
> I'd like to propose that the messages emitted by debug_print_plan
> and friends be given priority LOG rather than DEBUG1.  If you've gone
> to the trouble of turning on the variable, then you presumably want the
> results, so it seems dumb to print them at a priority that isn't logged
> by default.  (Note that this is biased to the assumption that you want
> the messages in the postmaster log, not on the console.  Which is
> usually what I want, but maybe someone wants to argue for NOTICE?)

what about changing (or adding) values "log" and "notice" ?

debug_print_plan = log;

debug_print_plan = notice;

so you could set that on demand ?

> I'd also like to propose making debug_pretty_print default to ON.
> At least for me, the other formatting is 100% unreadable.
> 
> Comments?
> 
>             regards, tom lane
> 



Re: Adjusting debug_print_plan to be more useful by default

From
Tom Lane
Date:
Hannu Krosing <hannu@krosing.net> writes:
> what about changing (or adding) values "log" and "notice" ?
> debug_print_plan = log;
> debug_print_plan = notice;
> so you could set that on demand ?

Well, we could, but it would break existing habits for not much gain.
Really this proposal is to make debug_print_plan and friends work like
all our other logging options, and AFAIR all the rest emit at level LOG.
        regards, tom lane


Re: Adjusting debug_print_plan to be more useful by default

From
Robert Treat
Date:
On Tuesday 19 August 2008 12:40:11 Tom Lane wrote:
> I'd also like to propose making debug_pretty_print default to ON.
> At least for me, the other formatting is 100% unreadable.
>

Any thoughts on just making it always print that way and getting rid of the 
GUC? Anyone want to argue they'll be turning this off? 

-- 
Robert Treat
Build A Brighter LAMP :: Linux Apache {middleware} PostgreSQL


Re: Adjusting debug_print_plan to be more useful by default

From
David Fetter
Date:
On Tue, Aug 19, 2008 at 10:06:33PM -0400, Robert Treat wrote:
> On Tuesday 19 August 2008 12:40:11 Tom Lane wrote:
> > I'd also like to propose making debug_pretty_print default to ON.
> > At least for me, the other formatting is 100% unreadable.
> 
> Any thoughts on just making it always print that way and getting rid
> of the GUC?  Anyone want to argue they'll be turning this off? 

I can vaguely imagine somebody wanting to debug the pretty printer,
but that's a pretty weak argument.

A slightly different point would be to have some kind of pluggable
output formats, but those could easily be in user space.

Cheers,
David.
-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


Re: Adjusting debug_print_plan to be more useful by default

From
Tom Lane
Date:
Robert Treat <xzilla@users.sourceforge.net> writes:
> On Tuesday 19 August 2008 12:40:11 Tom Lane wrote:
>> I'd also like to propose making debug_pretty_print default to ON.
>> At least for me, the other formatting is 100% unreadable.

> Any thoughts on just making it always print that way and getting rid of the 
> GUC? Anyone want to argue they'll be turning this off? 

Hmm ... I don't personally have any use for the OFF setting, but if
there's someone out there who actually wants to run with the
debug_print_xxx settings enabled for any length of time, I can see where
there'd be a log-volume problem with the pretty-printed format.  Such a
person would presumably also want to do automated analysis of the
results and so wouldn't give a fig for nice whitespace anyhow.

Maybe that's a long shot, but the other side of the coin is that taking
it out isn't going to save us a thing except one GUC variable ...
        regards, tom lane


Re: Adjusting debug_print_plan to be more useful by default

From
Tom Lane
Date:
David Fetter <david@fetter.org> writes:
> On Tue, Aug 19, 2008 at 10:06:33PM -0400, Robert Treat wrote:
>> Any thoughts on just making it always print that way and getting rid
>> of the GUC?  Anyone want to argue they'll be turning this off? 

> I can vaguely imagine somebody wanting to debug the pretty printer,
> but that's a pretty weak argument.

One other point is backwards compatibility: if there is anyone out there
depending on the current behavior, changing the behavior and then
removing the switch in the same release would be, er, discourteous.

I'd be happy to remove debug_pretty_print in a release or two after
8.4, if no one has squawked about the change...
        regards, tom lane