Adjusting debug_print_plan to be more useful by default

Lists: pgsql-hackers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Adjusting debug_print_plan to be more useful by default
Date: 2008-08-19 16:40:11
Message-ID: 5120.1219164011@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Adjusting debug_print_plan to be more useful by default
Date: 2008-08-19 17:33:33
Message-ID: 1219167213.5343.1047.camel@ebony.2ndQuadrant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


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.com
PostgreSQL Training, Services and Support


From: daveg <daveg(at)sonic(dot)net>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Adjusting debug_print_plan to be more useful by default
Date: 2008-08-19 18:28:52
Message-ID: 20080819182852.GB4818@sonic.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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(at)sonic(dot)net 510 536 1443 510 282 0869
If simplicity worked, the world would be overrun with insects.


From: Hannu Krosing <hannu(at)krosing(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Adjusting debug_print_plan to be more useful by default
Date: 2008-08-19 18:35:21
Message-ID: 1219170921.7109.1.camel@huvostro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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
>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hannu Krosing <hannu(at)krosing(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Adjusting debug_print_plan to be more useful by default
Date: 2008-08-19 18:40:30
Message-ID: 8012.1219171230@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hannu Krosing <hannu(at)krosing(dot)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


From: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Adjusting debug_print_plan to be more useful by default
Date: 2008-08-20 02:06:33
Message-ID: 200808192206.33197.xzilla@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: David Fetter <david(at)fetter(dot)org>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Adjusting debug_print_plan to be more useful by default
Date: 2008-08-20 02:19:47
Message-ID: 20080820021947.GZ7447@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Adjusting debug_print_plan to be more useful by default
Date: 2008-08-20 02:21:24
Message-ID: 18007.1219198884@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Robert Treat <xzilla(at)users(dot)sourceforge(dot)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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Fetter <david(at)fetter(dot)org>
Cc: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Adjusting debug_print_plan to be more useful by default
Date: 2008-08-20 02:28:32
Message-ID: 18136.1219199312@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

David Fetter <david(at)fetter(dot)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