473,805 Members | 2,297 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Execution Consistency

Dan
I am new to tuning and I am having some trouble with my Oracle
9.2.0.1. I have a database that I am trying to gain consistent
performance out of but I seem to have changing execution plans. Due
to a number of factors outside my control, I have to handle an
application that does not send bind variables, I handle them as they
come in. To do this, I have set the init.ora file to have an entry of
'cursor_sharing =similiar'. I know this is a temporary fix, but I have
to deal with it for now.

When I test a general search query on a stand alone application, I
get good returns (<10s, good enough anyway). When the application
runs, it takes forever. I copied the query that was being run from
the Oracle session manager and tried playing with it. It seems that
the execution plan of this query changes if there are bind variables
in it or actual data. I narrowed this down to a single field. It
does not matter what I put in the other parts of the where clause. As
soon as I change this particular where clause
AND (Entity.lname like 'MART%')

to

AND (Entity.lname like :"SYS_B_22")

the execution plan changes and my returns lose about a minute of
response time, not acceptable. Does anyone have any experience with
something like this? Any help is greatly appreciated.

-Dan
Jul 19 '05 #1
1 2942
With cursor_sharing = similiar, you are telling Oracle to force the
use of bind variables in certain situations. In this case, Oracle is
using bind variables in a way that is detrimental to performance.

If you avoid gathering histograms on the lname of the entity column,
that will likely cause Oracle not to choose a different plan for
literals and bind variables. Whether this will lead Oracle to choose
the "good" plan or the "bad" plan universally, though, can't be
predicted with the information provided.

My preference would be to issue an ALTER SESSION command before
executing the particular statement(s) you don't want to be forced to
use bind variables.

ALTER SESSION SET cursor_sharing= EXACT

will cause your session not to force the use of bind variables. After
the statement executes, you can switch back to

ALTER SESSION SET cursor_sharing= SIMILIAR

Justin Cave <jc***@ddbcinc. com>
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC

do*****@amcad.c om (Dan) wrote in message news:<bd******* *************** ****@posting.go ogle.com>...
I am new to tuning and I am having some trouble with my Oracle
9.2.0.1. I have a database that I am trying to gain consistent
performance out of but I seem to have changing execution plans. Due
to a number of factors outside my control, I have to handle an
application that does not send bind variables, I handle them as they
come in. To do this, I have set the init.ora file to have an entry of
'cursor_sharing =similiar'. I know this is a temporary fix, but I have
to deal with it for now.

When I test a general search query on a stand alone application, I
get good returns (<10s, good enough anyway). When the application
runs, it takes forever. I copied the query that was being run from
the Oracle session manager and tried playing with it. It seems that
the execution plan of this query changes if there are bind variables
in it or actual data. I narrowed this down to a single field. It
does not matter what I put in the other parts of the where clause. As
soon as I change this particular where clause
AND (Entity.lname like 'MART%')

to

AND (Entity.lname like :"SYS_B_22")

the execution plan changes and my returns lose about a minute of
response time, not acceptable. Does anyone have any experience with
something like this? Any help is greatly appreciated.

-Dan

Jul 19 '05 #2

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

Similar topics

11
12723
by: Markus Breuer | last post by:
I have a question about oracle commit and transactions. Following scenario: Process A performs a single sql-INSERT into a table and commits the transaction. Then he informs process B (ipc) to read the new date. So process B starts "select ..." but does not get the previously inserted row. The timespan between commit and select is very short. (NOTE: two different sessions are used) Questions: 1.) Does commit when returning from call...
1
2041
by: Sergio | last post by:
Hi everybody, I have the following scenario. Several computers with shared disk in a LAN. Each of these computer has a MySQL server that serves several databases. I have several clients that communicate with a Java process that I have in each computer to answer queries for a given database (it connects to the MySQL server). I also have a Java process that updates continuously the databases; this process executes only in the local...
2
8466
by: bruce strom | last post by:
I have a sql database I run dbcc checkdb and get no errors I go to backup the database in enterprise manager, and it won't restore because it has internal consistency errors I can go back to an older version of the database I run a particular procedure in our accounting software package Never do I get errors when running dbcc checkdb Sometimes I get the backup and restore problem, sometimes I don't
6
2546
by: | last post by:
Assume that we have a complex application with many math operations and it is written in an ANSI C++ code and running on a single PC without any problem. Is there an automatic way to execute the same application on a cluster of PCs to speed-up the execution? (How?) Or does it has to be re-written in some special way to be executed on the cluster?
19
2203
by: Catherine Jo Morgan | last post by:
If one user enters "Laurel Drive" and another enters "Laurel Dr." and still another forgets the period and enters "Laurel Dr" - is there a way to enforce consistency so that "103 Laurel Drive" doesn't appear as three different addresses when entered by the different users? TIA
3
10913
by: taru | last post by:
Env: DB2 UDB 8.1 on AIX We are executing a db2 sql stored procedure which is invoked from a java client. The stored procedure contains few select, insert and update statements. Using the DB2 snapshot and event monitor we are able to find the time taken for the stored procedure execution. We want to find what is the execution time for each
23
1806
by: Chance Ginger | last post by:
If I define a decorator like: def t(x) : def I(x) : return x return I and use it like: @t(X) def foo(a) :
1
169
by: Dan | last post by:
I am new to tuning and I am having some trouble with my Oracle 9.2.0.1. I have a database that I am trying to gain consistent performance out of but I seem to have changing execution plans. Due to a number of factors outside my control, I have to handle an application that does not send bind variables, I handle them as they come in. To do this, I have set the init.ora file to have an entry of 'cursor_sharing=similiar'. I know this is a...
5
1821
by: =?ISO-8859-1?Q?Marcel_M=FCller?= | last post by:
Hi, I have a question about the execution sequence of the postfix increment operator with respect to a function call. void foo(int type, int*& data); int* sequence;
0
9718
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
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10617
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...
1
10370
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
10109
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
9186
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
7649
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...
2
3849
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
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.