473,383 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How to check a query execution plans in PostgreSQL

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
5 3695
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
michaelb
534 Expert 512MB
>> 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
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
michaelb
534 Expert 512MB
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

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

Similar topics

7
by: Thomi Baechler | last post by:
Hello Everybody I run the following query against to identical databases. Execution time on the first DB is 0 seconds, on the other 6 seconds! SELECT dbo.HRMABZ.EMPKEY ,...
8
by: djwhisky | last post by:
Hi there - i'm hoping someone can help me! I'm having a problem with a live database that i'm running on MSDE - It seems to have slowed down quite considerably from the test environment (even...
13
by: Dmitry Tkach | last post by:
Hi, everybody! Here is a weird problem, I ran into... I have two huge (80 million rows each) tables (a and b), with id as a PK on both of them and also an FK from b referencing a. When I try to...
0
by: apb18 | last post by:
A bit of query plan strangeness. Suppose you have an inheritance tree such that the columns 'ID' and 'field' appear in the top level table, call that table XXX. tables YYY and ZZZ both inherit...
6
by: Ryan | last post by:
I came across a situation that I've been unable to explain and was hoping somebody had an answer: I had written an update query which was taking about 8 seconds to run and considered it too...
15
by: wizofaus | last post by:
I have a chunk of code which is essentially IDbCommand cmd = db.CreateCommand(); cmd.CommandText = "SELECT X, Y, Count(*) FROM Foo WHERE Z = 1 GROUP BY X, Y"; using (IDataReader reader =...
2
by: Luke.Schollmeyer | last post by:
I found an unusual problem between 2000 and 2005 I haven't been able to decipher from any documentation. The query structure is as follows: select * from tableA a join tableB b ON...
1
by: Don Li | last post by:
Hi, Env: MS SQL Server 2000 DB Info (sorry no DDL nor sample data): tblA has 147249 rows -- clustered index on pk (one key of datatype(int)) and has two clumns, both are being used in joins;...
2
by: dvelst | last post by:
Hi All, I have the following query which was based on a working query in MySQL: (don't be afraid of the size of the query you see below, later on I will concentrate on part of this query) ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.