473,796 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

explain with placeholders?

Is there any way to convince explain to go do its thing when given a
query with placeholders in it?

I'm trying to do some performance checking of some of the queries
built into a system I'm building. The SQL's all done with
placeholders, for safety and ease of twiddling, but EXPLAIN...
EXPLAIN doesn't like them. Trying throws an "ERROR: there is no
parameter $1" which is somewhat sub-optimal.

Any way, short of hand-replacing the placeholders with real values
(which makes me nervous since the optimizer may do things that
wouldn't be doable in the system when it was running), to get a
meaningful check on these things?
--
Dan

--------------------------------------it's like this-------------------
Dan Sugalski even samurai
da*@sidhe.org have teddy bears and even
teddy bears get drunk

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #1
2 1908
Dan Sugalski <da*@sidhe.or g> writes:
Is there any way to convince explain to go do its thing when given a
query with placeholders in it?


PREPARE foo(...) AS SELECT ...

EXPLAIN EXECUTE foo(...)

EXPLAIN EXECUTE is a relatively recent addition, but I'm sure it's in
7.4 at least.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2
At 10:39 AM -0400 9/7/04, Tom Lane wrote:
Dan Sugalski <da*@sidhe.or g> writes:
Is there any way to convince explain to go do its thing when given a
query with placeholders in it?


PREPARE foo(...) AS SELECT ...

EXPLAIN EXECUTE foo(...)

EXPLAIN EXECUTE is a relatively recent addition, but I'm sure it's in
7.4 at least.


Ah, cool. Thanks.
--
Dan

--------------------------------------it's like this-------------------
Dan Sugalski even samurai
da*@sidhe.org have teddy bears and even
teddy bears get drunk

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
20398
by: Ina Schmitz | last post by:
Hello all, I don't succeed in displaying the explain plan. I use IBM DB2 Universal Database 8.2. I tried to do the example given in the online help for "Visual Explain". The tables EXPLAIN_STATEMENT and EXPLAIN_INSTANCE exist. With VESAMPL.DDL, I loaded the predefined execution plans. In the next step, I'ld like to display the loaded access plans. So, I right clicked on "Show Explained Statements History" and got the result:
5
1289
by: Colin Basterfield | last post by:
Hi, I have some placeholders in my .aspx file, and when I add my controls to them at runtime I want them to appear in specific positions on the web form, however there are already some controls that appear statically, but the run time created controls overwrite them, so is there a way to force the dynamic controls to appear below them, or anywhere I choose really? Also my PlaceHolders have ids of "actname1", "actname2", "actname3" etc,...
3
4867
by: DotNetGruven | last post by:
Hi, Is there a trick to using nested PlaceHolders? I have a WebForm that has 3 PlaceHolders on it: headerPlaceHolder contentPlaceHolder footerPlaceHolder
4
1382
by: Alan Silver | last post by:
Hello, I am displaying product details on a page and am allowing the site owner to specify the style in which the product details are displayed. I am debating which of two approaches to use here and would appreciate some comments. I intend to write a control that handles the actual display. This control would have a method that gets passed the product ID and the display style ID. It would pull the product details from a database and...
10
2161
by: Jeff Boes | last post by:
I'm hoping there's someone here with experience in building the Visual Explain tool from Red Hat. I downloaded it and the J2 SDK, but when I attempt to follow the build instructions, I get messages like: error: Type `JTableHeader' not found in the declaration of the local variable `header'. JTableHeader header = null; To me, this indicates that the SDK isn't installed (properly). But I admit I'm pretty much a Java...
0
957
by: nemesis.saurabh | last post by:
hi, i am using VS 2005. i have created a master.master. i have added 2 content placeholders, i am able to edit them in the corresponding content page but if i am adding anymore placeholders in master form, newly added placeholders are shown as "master content placeholders" and i am not able to edit them. regards, saurabh
1
1546
by: pankajit09 | last post by:
Hello, Is it possible to put two placeholders in Ajax Updater ? or Can I use the same placeholder(div ID ) at two places in HTML? var myAjax = new Ajax.Updater( {success: 'placeholder'},
5
8112
by: kabotnet | last post by:
Hi, I'm new in db2, I'm trying to execute EXPLAIN command on some queries but i have error like: And message similar to: Token EXPLAIN is not valid, valid tokens ( END GET SET CALL DROP FREE HOLD LOCK OPEN WITH ALTER. I've created tables explain_* How can I start to find solution? Is it possible that my db2 doesn't support explain?
1
3583
by: w.l.fischer | last post by:
Hi, the following sequence: set current explain mode yes; set current explain snapshot yes; update ...; set current explain mode no;
0
10457
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10231
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
10176
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,...
0
10013
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9054
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7550
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
6792
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
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2927
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.