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

Started by PostgreSQL Bugs Listover 23 years ago7 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

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 timing information is shown when using PREPARE so I can't see the total before and after information. Since all PREPARE is doing is parsing and planning the statement, it makes sense that it would show the planning information when show_planner_stats is enabled?

Sample Code

No file was uploaded with this report

#2Neil Conway
neilc@samurai.com
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #758: show_planner_stats does not work for new PREPARE calls

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

Attachments:

prepare_planner_stats.patchtext/x-patchDownload+18-29
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Neil Conway (#2)
Re: Bug #758: show_planner_stats does not work for new PREPARE calls

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

#4Neil Conway
neilc@samurai.com
In reply to: Tom Lane (#3)
Re: Bug #758: show_planner_stats does not work for new PREPARE calls

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

Attachments:

prepare_planner_stats-2.patchtext/x-patchDownload+13-13
#5Bruce Momjian
bruce@momjian.us
In reply to: Neil Conway (#2)
Re: Bug #758: show_planner_stats does not work for new PREPARE

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
#6Bruce Momjian
bruce@momjian.us
In reply to: Neil Conway (#4)
Re: Bug #758: show_planner_stats does not work for new PREPARE

[ 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
#7Bruce Momjian
bruce@momjian.us
In reply to: Neil Conway (#4)
Re: Bug #758: show_planner_stats does not work for new PREPARE

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