printing the query plan?

Started by dakotali kasapabout 19 years ago4 messages
#1dakotali kasap
dakotalidavid@yahoo.com

Hi,

I want to print the query-plan that will be used before the execution of the query. Therefore put this line at the beginning of the ExecutorStart() function located in execMain.c :

print_plan(queryDesc->plantree,queryDesc->parsetree);

However, it did not work. What I want to ask is:

1. Does postgresql call ExecutorStart()-ExecutorRun-ExecutorEnd functions each time a new query is invoked? If so, why the above line did not work?

2. Can I print just a dummy string inside ExecutorStart() function and will it be shown before the result of the query? Because I also tried this and it also did not work.

Thanks a lot.

Baran

#2Martijn van Oosterhout
kleptog@svana.org
In reply to: dakotali kasap (#1)
Re: printing the query plan?

On Fri, Oct 27, 2006 at 01:58:21AM -0700, dakotali kasap wrote:

Hi,

I want to print the query-plan that will be used before the execution
of the query. Therefore put this line at the beginning of the
ExecutorStart() function located in execMain.c :

print_plan(queryDesc->plantree,queryDesc->parsetree);

print_plan writes to stdout, did you check where that is redirected to?

Also, I thought there was a logging option to print plans, but I might
be wrong about that.

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

From each according to his ability. To each according to his ability to litigate.

#3dakotali kasap
dakotalidavid@yahoo.com
In reply to: Martijn van Oosterhout (#2)
Re: printing the query plan?

Hi,

I want to print the query-plan that will be used before the execution
of the query. Therefore put this line at the beginning of the
ExecutorStart() function located in execMain.c :

print_plan(queryDesc->plantree,queryDesc->parsetree);

print_plan writes to stdout, did you check where that is redirected to?

But how can I find where stout is redirected to?

Baran

#4Gurjeet Singh
singh.gurjeet@gmail.com
In reply to: dakotali kasap (#3)
Re: printing the query plan?

Try your logfile... the one specified by the '-l' option while starting the
server.

On 10/27/06, dakotali kasap <dakotalidavid@yahoo.com> wrote:

But how can I find where stout is redirected to?

Baran

--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | yahoo }.com