By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

How to check a query execution plans in PostgreSQL

P: 3
HI All,

I want to know the command that will display all the execution plans which are generated by the parser in PostgreSQL.
Is there any command to instruct PostgreSQL to choose a specific query plan.

Regards
Vijay
Mar 2 '07 #1
Share this Question
Share on Google+
5 Replies


Expert 100+
P: 534

P: 3
Welcome to the Forum!

You can use explain analyze, take a look at these pages:

http://www.postgresql.org/docs/8.0/i...l-explain.html

http://www.postgresql.org/docs/8.0/i...ance-tips.html

http://www.postgresql.org/docs/8.0/i...s-examine.html

Hi

Thanks for it
I have already saw those links
My question is different.
The PostgreSQL generates multiple query plans for query
I want to see all of them and forcefully want to run one of those
Mar 2 '07 #3

Expert 100+
P: 534
>> The PostgreSQL generates multiple query plans for query
What do you mean by that?
Different results for different executions of 'explain analyze', or something else?

As far as forcing a certain plan I am not aware of any way of doing that
(unless they introduced something new in the last Pg versions)

But you can certainly affect the execution plan indirectly by modifying some run time parameters
Mar 2 '07 #4

P: 3
What do you mean by that?
Different results for different executions of 'explain analyze', or something else?

As far as forcing a certain plan I am not aware of any way of doing that
(unless they introduced something new in the last Pg versions)

But you can certainly affect the execution plan indirectly by modifying some run time parameters
HI
Thanks for reply my problem is different.
I want to know how to generate different query plans for a single query and to execute each of them forcefully so that i can test the correctness of parser whether it is giving the same result or not for same query but using multiple plans.Performance might affect but i am not worry about it for the time being

Thanks
Vijay
Mar 6 '07 #5

Expert 100+
P: 534
The only way to generate multiple plans is again to tweak the run-time parameters I mentioned above.
In addition to that you may need to tweak your data.in some cases.
This is all I can think of.

I wonder though why do you need to go through this exercise.
You may not agree with this parallel, but I'll throw it in anyway.
If you bought a scientific calculator you use it. You don't think of running a bunch of tests to make sure that 2 * 2 * 2 will yield the same result as 2 to the 3rd degree. You just trust it because this is something basic, and you don't have any concerns unless and until you have a proved malfunction, or at least a serious suspicion that something isn't working correctly.

Same here, what you want to test seems so fundamental that I can't help wondering what made you think you need to test it.
Mar 6 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.