473,749 Members | 2,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to check a query execution plans in PostgreSQL

3 New Member
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 3721
michaelb
534 Recognized Expert Contributor
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
Mar 2 '07 #2
vijaylohkare
3 New Member
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 Recognized Expert Contributor
>> 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
vijaylohkare
3 New Member
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.Performan ce might affect but i am not worry about it for the time being

Thanks
Vijay
Mar 6 '07 #5
michaelb
534 Recognized Expert Contributor
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
3629
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 , dbo.HRMABZ.CONNUMB , dbo.HRM_CALENDER.Datum, dbo.HRMABZ.ABZTXT FROM dbo.HRM_CALENDER INNER JOIN dbo.HRMABZ ON dbo.HRM_CALENDER.Datum >= dbo.HRMABZ.ABZDATF
8
2055
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 when all the data is the same). The is notably different on one particular query that takes 1 sec on the test machine and almost 1 min on the live machine The total number of user connections on the live machine is normally 4 or so (found out...
13
1993
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 run a query like: select * from a, b where a.id >= 7901288 and a.id=b.id limit 1; The query takes *forever*.
0
1454
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 XXX. Now suppose there exists some query that returns a set of IDs that match some criteria (that query may involve various tests/joins/etc on other arbitrary tables). Executing that query alone produces an optimal plan and the exact result set...
6
4564
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 slow. I copied the SQL statement from the query and tried executing it from code which then ran in 1 second. To make sure that I didn't miss anything, I copied the SQL statement back into a query and tried running it again. It now also only took 1...
15
1900
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 = cmd.ExecuteReader()) while (reader.Read()) { // grab values from query }
2
4866
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 a.somekey = b.somekey
1
3041
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; intersecTbl4AB has 207016 rows -- clustered index on two fks and
2
4438
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) SELECT count(*) FROM ((SELECT * FROM tileinfo where julianDay BETWEEN DATE2JDAY(('2003-03-01 00:00:00'),0) AND DATE2JDAY(('2003-03-01 23:59:59' ),0) AND intersects(tile, geomFromText('POLYGON((-10.84 35.8,18.14 35.8,18.14 59.41,-10.84 59.41,-10.84...
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6800
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.