Thread: Bug #758: show_planner_stats does not work for new PREPARE calls

Bug #758: show_planner_stats does not work for new PREPARE calls

From
pgsql-bugs@postgresql.org
Date:
Barry Lind (barry@xythos.com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
show_planner_stats does not work for new PREPARE calls

Long Description
I was testing the 7.3 PREPARE functionality.  I was using the timing information from show_parser_stats,
show_planner_stats,show_executor_stats to compare times with and without using PREPARE.  But unfortunatly no planing
timinginformation is shown when using PREPARE so I can't see the total before and after information.  Since all PREPARE
isdoing is parsing and planning the statement, it makes sense that it would show the planning information when
show_planner_statsis enabled? 

Sample Code


No file was uploaded with this report

Re: Bug #758: show_planner_stats does not work for new PREPARE calls

From
Neil Conway
Date:
pgsql-bugs@postgresql.org writes:
> Short Description show_planner_stats does not work for new PREPARE
> calls

Thanks for the bug report. The attached patch should fix the
omission. I also took the liberty of removing some no-longer-used
variables from the show_xxx_stats output and fixing a typo in a
comment.

Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

Attachment

Re: Bug #758: show_planner_stats does not work for new PREPARE calls

From
Tom Lane
Date:
Neil Conway <neilc@samurai.com> writes:
> I also took the liberty of removing some no-longer-used
> variables from the show_xxx_stats output

I'm not sure why NDirectFileRead/NDirectFileWrite are unused at the
moment, but they used to be used; I think the correct response is to
put back the missing counter increments, not rip out the counters.

            regards, tom lane

Re: Bug #758: show_planner_stats does not work for new PREPARE calls

From
Neil Conway
Date:
Tom Lane <tgl@sss.pgh.pa.us> writes:
> I'm not sure why NDirectFileRead/NDirectFileWrite are unused at the
> moment, but they used to be used; I think the correct response is to
> put back the missing counter increments, not rip out the counters.

Ok, fair enough. It's worth noting that they've been broken for a
while -- for example, the HashJoin counter increments were broken when
you comitted r1.20 of executor/nodeHashJoin.c in May of '99.

I've attached a revised patch that doesn't remove the counters (but
doesn't increment them either: I'm not sure of all the places where
the counter should be incremented).

Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

Attachment

Re: Bug #758: show_planner_stats does not work for new PREPARE

From
Bruce Momjian
Date:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Neil Conway wrote:
> pgsql-bugs@postgresql.org writes:
> > Short Description show_planner_stats does not work for new PREPARE
> > calls
>
> Thanks for the bug report. The attached patch should fix the
> omission. I also took the liberty of removing some no-longer-used
> variables from the show_xxx_stats output and fixing a typo in a
> comment.
>
> Cheers,
>
> Neil
>
> --
> Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Bug #758: show_planner_stats does not work for new PREPARE

From
Bruce Momjian
Date:
[ Sorry, removed previous version of patch from queue.]

Your patch has been added to the PostgreSQL unapplied patches list at:

    http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


---------------------------------------------------------------------------

Neil Conway wrote:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
> > I'm not sure why NDirectFileRead/NDirectFileWrite are unused at the
> > moment, but they used to be used; I think the correct response is to
> > put back the missing counter increments, not rip out the counters.
>
> Ok, fair enough. It's worth noting that they've been broken for a
> while -- for example, the HashJoin counter increments were broken when
> you comitted r1.20 of executor/nodeHashJoin.c in May of '99.
>
> I've attached a revised patch that doesn't remove the counters (but
> doesn't increment them either: I'm not sure of all the places where
> the counter should be incremented).
>
> Cheers,
>
> Neil
>
> --
> Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Bug #758: show_planner_stats does not work for new PREPARE

From
Bruce Momjian
Date:
Patch applied.  Thanks.

---------------------------------------------------------------------------


Neil Conway wrote:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
> > I'm not sure why NDirectFileRead/NDirectFileWrite are unused at the
> > moment, but they used to be used; I think the correct response is to
> > put back the missing counter increments, not rip out the counters.
>
> Ok, fair enough. It's worth noting that they've been broken for a
> while -- for example, the HashJoin counter increments were broken when
> you comitted r1.20 of executor/nodeHashJoin.c in May of '99.
>
> I've attached a revised patch that doesn't remove the counters (but
> doesn't increment them either: I'm not sure of all the places where
> the counter should be incremented).
>
> Cheers,
>
> Neil
>
> --
> Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073