Performance tuning - Hints
Hi Experts,
I am new to oracle database developer. currently i am leraning the performance tuning.
I have a question that is it a good practice to use hint as having using oracle database version 10g.
some where i have read and also some Senior members from suggest me that before 9i the optimizer was rule based , hence there was nesecarry to use hint.
after 9i onwards the optimeser is cost based hence there is no need to provide the hints.
but i have seen some queries from the expert where they have used hints.( even in db version 10g).
so can you please tell me that if we wants to use hints then when to use them>\
thanks in advance
Prashant Mhatre
> Senior members from suggest me that before 9i the optimizer was rule based
No, the CBO was introduced in Oracle 7.
> so can you please tell me that if we wants to use hints then when to use them>
Hints can be handy during development for tuning and tweaking (but not twerking).
In production code, hints can be poison. Some of the worst performance problems I've seen were *caused* by inappropriate hints.
Keep in mind I'm talking about "tuning hints". There are some other hints (like insert /*+ append */) that fall into a totally different category.
Similar Messages
-
Hi folks,
I having a problem with performance tuning ... Below is a sample query
SELECT /*+ PARALLEL (K 4) */ DISTINCT ltrim(rtrim(ibc_item)), substr(IBC_BUSINESS_CLASS, 1,1)
FROM AAA K
WHERE ltrim(rtrim(ibc_item)) NOT IN
select /*+ PARALLEL (II 4) */ DISTINCT ltrim(rtrim(THIRD_MAINKEY)) FROM BBB II
WHERE SECOND_MAINKEY = 3
UNION
SELECT /*+ PARALLEL (III 4) */ DISTINCT ltrim(rtrim(BLN_BUSINESS_LINE_NAME)) FROM CCC III
WHERE BLN_BUSINESS_LINE = 3
The above query is having a cost of 460 Million. I tried creating index but oracle is not using index as a FT scan looks better. (I too feel FT scan is the best as 90% of the rows are used in the table)
After using the parallel hint the cost goes to 100 Million ....
Is there any way to decrease the cost ...
Thanks in advance for ur help !Be aware too Nalla, that the PARALLEL hint will rule out the use of an index if Oracle adheres to it.
This is what I would try:
SELECT /*+ PARALLEL (K 4) */ DISTINCT TRIM(ibc_item), substr(IBC_BUSINESS_CLASS, 1,1)
FROM AAA K
WHERE NOT EXISTS (
SELECT 1
FROM BBB II
WHERE SECOND_MAINKEY = 3
AND TRIM(THIRD_MAINKEY) = TRIM(K.ibc_item))
AND NOT EXISTS (
SELECT 1
FROM CCC III
WHERE BLN_BUSINESS_LINE = 3
AND TRIM(BLN_BUSINESS_LINE_NAME) = TRIM(K.ibc_item))But I don't like this at all: TRIM(K.ibc_item), and you never need to use DISTINCT with NOT IN or NOT EXISTS.
Try this:
SELECT DISTINCT TRIM(ibc_item), substr(IBC_BUSINESS_CLASS, 1,1)
FROM AAA K
WHERE NOT EXISTS (
SELECT 1
FROM BBB II
WHERE SECOND_MAINKEY = 3
AND TRIM(THIRD_MAINKEY) = K.ibc_item
AND NOT EXISTS (
SELECT 1
FROM CCC III
WHERE BLN_BUSINESS_LINE = 3
AND TRIM(BLN_BUSINESS_LINE_NAME) = K.ibc_itemThis may not work though, since you may have whitespaces in K.ibc_item. -
Invalid statement in Performance Tuning Guide
Oracle® Database Performance Tuning Guide
10g Release 2 (10.2)
Part Number B14211-01
13 The Query Optimizer
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/optimops.htm#sthref1324
excerpt:
"You can specify fast full index scans with the initialization parameter OPTIMIZER_FEATURES_ENABLE or the INDEX_FFS hint. Fast full index scans cannot be performed against bitmap indexes."
Emphasis mine - Gints
Here is counterexample:
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> create table blah (sex varchar2(1) not null, data varchar2(4000));
Table created.
SQL> insert into blah select 'F', lpad('a', 4000, 'a') from user_objects where rownum<=10;
10 rows created.
SQL> insert into blah select 'M', lpad('a', 4000, 'a') from user_objects where rownum<=10;
10 rows created.
SQL> commit;
Commit complete.
SQL> create bitmap index sexidx on blah(sex);
Index created.
SQL> exec dbms_stats.gather_table_stats(user, 'blah', cascade=>true)
PL/SQL procedure successfully completed.
SQL>
SQL> set autot traceonly expl
SQL> set lines 100
SQL> select count(*) from blah where sex = 'F';
SQL> /
Execution Plan
Plan hash value: 1028317341
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 2 | 1 (0)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 2 | | |
| 2 | BITMAP CONVERSION COUNT | | 10 | 20 | 1 (0)| 00:00:01 |
|* 3 | BITMAP INDEX FAST FULL SCAN| SEXIDX | | | | |
Predicate Information (identified by operation id):
3 - filter("SEX"='F')
SQL> set autot off
SQL> alter session set events '10046 trace name context forever, level 12';
Session altered.
SQL> select count(*) from blah where sex = 'F';
COUNT(*)
10
SQL> disconn
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining optionsand here is relevant section from tkprofed trace file assuring that bitmap index fast full scan really was performed.
select count(*)
from
blah where sex = 'F'
call count cpu elapsed disk query current rows
Parse 1 0.00 0.02 0 0 0 0
Execute 1 0.00 0.03 0 0 0 0
Fetch 2 0.00 0.00 0 3 0 1
total 4 0.00 0.05 0 3 0 1
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 60
Rows Row Source Operation
1 SORT AGGREGATE (cr=3 pr=0 pw=0 time=74 us)
1 BITMAP CONVERSION COUNT (cr=3 pr=0 pw=0 time=55 us)
1 BITMAP INDEX FAST FULL SCAN SEXIDX (cr=3 pr=0 pw=0 time=43 us)(object id 98446)Gints Plivna
http://www.gplivna.euHello Gints. I've reported this to the writer responsible for the Performance Tuning Guide. One of us will get back to you with the resolution.
Regards,
Diana -
Performance tuning of database using DBACOCKPIT
Hiii Experts,
I have installed new server with OS:- Windows server 2012 and DB:- Sybase ASE 15.07.
Now I want to perform performance tuning of SAP and Database, so for that I have configured
DBACOCKPIT but I could not change the parameter values so could you tell me how to change
parameter values and how to use DBACOCKPIT for performance tuning.
Thank you,
Regards,
Omkar M.DBA_Guide wrote:
Reports running slow, not sure if database is using Start transformation for the Datawarehouse Database.
Used hint */+ STAR_TRANSFORMATION */, still no performance increase.
Checked database parameter -
SQL> show parameter star;
NAME TYPE VALUE
dg_broker_start boolean FALSE
fast_start_io_target integer 0
fast_start_mttr_target integer 0
fast_start_parallel_rollback string LOW
log_archive_start boolean FALSE
star_transformation_enabled string TRUE
Any Help is appreciated.
Thanks!
If star transformation was not the cause of the slowness, of course it won't make it faster.
I bet you any number of other different hints will result in no change in performance.
This is like replacing gas tank on your car with a LARGER tank & filling it with more gasoline to make the car go faster.
The amount of gasoline is not a factor that limits the speed of your car. -
IIR 2.8.0.7 performance tuning suggestions / documents for Oracle 11?
Would we have any hints or white papers that would support a customer in IIR matching server tuning for initial load performance,
beyond the Siebel specific
Performance Tuning Guidelines for Siebel CRM Application on Oracle Database (Doc ID 781927.1)
which does NOT generate any statistics on the Informatica Schema?
Customer is starting production data load into Siebel UCM of over 5 million customer records . Their current bottle neck seems to be IIR queries and high IIR host resources usage.
This would be for Siebel 8.1.1.4 [21225] on Oracle 11.1.0.6; I currently do not know if ACR 475 with its EBC access is used or not; I'd be looking for any performance tuning suggestions on the Informatica & database side - I have not found anything helpful in the informatica knowledgebase and in the 2.8.0.7 docs the only performance tuning suggestions seem to be on IDT loads.
Obviously performance can be influenced by the matching fields used, but this customer will be looking for performance tuning suggestions keeping the matching fields and thresholds they got approved from the business side.
Any documents we could share?Hi Varad,
Well, Oracle Metalink actually got it fixed for me! Got to give them credit.
I ran the 1st bit of SQL they sent me and it fixed it so I think it was only cosmetic. I've enclosed all of their response in case others may find themselves in similar situation.
Thanks again for YOUR help too.
Perry
==========================================================
1. Do you see any invalid objects in the database?
2. Please update the SR with the output of running the commands below
1.Connect as SYS.
set serveroutput on (This will let you see if any check fails)
exec validate_apex; (If your version is 2.0 or above)
If all are fine, the registry should be changed to VALID for APEX and you should see the following
message:
PL/SQL procedure successfully completed.
Note : The procedure validate_apex should always complete successfully.
With serveroutput on, it should show why Application Express is listed as invalid.It should show output like:
FAILED CHECK FOR <<obect_name>>
Or
FAILED EXISTENCE CHECK FOR <<object_name>> -
Performance Tuning Section in Business Blueprint
Dear Gurus,
I am at a client location doing a blueprint. We are in the closure level of the business blueprint and one of the sections need to be added is the Performance Tuning. Can anybody suggest me what would be content to be added in the Performance Tuning section of blueprint. If anybody got the content section with them please forward that to my mail id, i.e. [email protected]
Thanks and regards
VijayHi,
Think abt all BI is made up of an dhow to tune them..
Some hints:
1 Performance tuning for data loads : ( number range buffering, parallel loading..pseudo delta..chnging technical properties of tables if rec >100,000...IDOC clogging...etc)
2) Performnce tuing for Queries Aggregate...Cube modelling, OLAP cache....efficient multiprovider queries.etc.)
MEntion about transactiona whoich you will require for these things..such as RSRV..RSRTRACE..STO3n..ST05..etc...
gaurav -
Is there a performance tuning guide focusing on WB ABAP?
- Showing server settings which improve performance
- Client (Browser) setting being recommend
Any hint?http://help.sap.com/saphelp_nw2004s/helpdata/en/c6/58e70398244a87a2c39e700bdae4a9/frameset.htm
-
Performance Tuning DBA fix not Applications fix
Hi
I had an interview , which the DBA team leader was asking me about my performance tuning expereince
i was answering about my expereince in tuning the sqls and get a good statistics so the CBO choose the best plan, or even hint my sqls so i force the best plan
the interviwer was worried because this is an application tuning , not a DBA tuning
he mention that he want to hear that i changed a db parameter that enhance the performance , or chnage any thing in the DBA side that tune the performance
Anybody have an example of changing a parameter or something DBAish that help the performance?
Thanks for any contributionYou should read following sections of Performance Tuning Guide:
Performance Considerations for Initial Instance Configuration:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/build_db.htm#i20151
Memory Configuration and Use:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/memory.htm#i53187
Oracle Instance Tuning Using Dynamic Views:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/instance_tune.htm#i35312 -
Report running for long time & performance tuning
Hi All,
(1). WebI report is running for long time.so what are the steps i need to check for it ?
(2). Can you tell me about performance tuning in BO ?
please help me.....
Thanks
Kumar(1). WebI report is running for long time.so what are the steps i need to check for it ?
The first step is to see if the problem lies in the query on the data source or in webi itself. Depending on the data source there are different ways to extract the query and try to run it against the database. Which source does your report uses?
(2). Can you tell me about performance tuning in BO ?
I would recommend to start by reading the administrator's guide. There is a section about how to improve performance.
Regards,
Stratos -
Oracle 11g Performance tuning approach ?
Hello Experts,
Is it the right forum to follow oracle performance tuning discussions ? If not, let me know what will be the forum to pick up some thread on this subject.
I am looking for performance tuning approach for oracle 11g. I learned there are some new items in 11g in this regard. For persons, who did tuning in earlier versions of Oracle,
what will be the best way adopt to 11 g?
I reviewed the 11g performance tuning guide, but I am looking for some white papers/blogs with case studies and practical approaches. I hope that you have used them.
What are the other sources to pick up some discussions?
Do you mind, share your thoughts?
Thanks in advance.
RIThe best sources of information on performance tuning are:
1. Jonathan Lewis: http://jonathanlewis.wordpress.com/all-postings/
2. Christian Antognini: http://www.antognini.ch/
3. Tanel Poder: http://blog.tanelpoder.com/
4. Richard Foote: http://richardfoote.wordpress.com/
5. Cary Millsap: http://carymillsap.blogspot.com/
and a few dozen others whose blogs you will find cross-referenced in those above. -
Performance tuning of BPEL processes in SOA Suite 11g
Hi,
We are working with a customer for performance tuning of SOA Suite 11g, one of the areas is to tune the BPEL processes. I am new to this and started out with stress testing Hello World process using SOAPUI tool. I would like help with the below topics -
1. How do I interpret the statistics collected during stress testing? Do we have any benchmark set that can indicate that the performance is ok.
2. Do we need to run stress tests for every BPEL process deployed?
2. Is there any performance tuning strategy documentation available? Or can anybody share his/her experiences to guide me?
Thanks in advance!
Sritama1. How do I interpret the statistics collected during stress testing? Do we have any benchmark set that can indicate that the performance is ok.
You need
pay attention to:
java heap usage vs java heap capacity
java eden usage vs java eden capacity
JDBC pool initial connections vs JDBC pool capacity connections
if you are using linux: top
if you are using aix: topas
2. Do we need to run stress tests for every BPEL process deployed?
yes, you need test each BPEL. You can use "Jmeter" tool.
Download Jmeter from here: Apache JMeter - Apache JMeter&trade;
Other tools:
jstat
jstack
jps -v
Enterprise Manager
WebLogic Console
VisualVM
JRockit Mission Control
3. Is there any performance tuning strategy documentation available? Or can anybody share his/her experiences to guide me?
I recommend "Oracle SOA Suite 11g Performance Tuning Cookbook" http://www.amazon.com/Oracle-Suite-Performance-Tuning-Cookbook/dp/1849688842/ref=sr_1_1?ie=UTF8&qid=1378482031&sr=8-1&keywords=oracle+soa+suite+11g+performance+tuning+cookbook -
Performance tuning related issues
hi experts
i am new to performance tuning application. can any one share some stuff(bw3.5& bi7)related to the concern area.send any relavent docs to my id: [email protected] .
thanks in advance
regards
gavaskar
[email protected]hi Gavaskar,
check this, you can download lot of performance materials
Business Intelligence Performance Tuning [original link is broken]
and e-learning -> intermediate course and advance course
https://www.sdn.sap.com/irj/sdn/developerareas/bi?rid=/webcontent/uuid/fe5b0b5e-0501-0010-cd88-c871915ec3bf [original link is broken]
e.g
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/10b589ad-0701-0010-0299-e5c282b7aaad
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/d9fd84ad-0701-0010-d9a5-ba726caa585d
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/8e6183ad-0701-0010-e083-9ab1c6afe6f2
performance tools in bw 3.5
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/07a4f070-0701-0010-3b91-a6bf7644c98f
(here also you can download the presentation by righ click the disk drive icon)
hope this helps. -
[ADF-11.1.2] Proof of view performance tuning in oracle adf
Hello,
Take an example of : http://www.gebs.ro/blog/oracle/adf-view-object-performance-tuning-analysis/
It tells me perfectly how to tune VO to achieve performance, but how to see it working ?
For example: I Set Fetch size of 25, 'in Batch of' set to 1 or 26 I see following SQL Statement in Log
[1028] SELECT Company.COMPANY_ID, Company.CREATED_DATE, Company.CREATED_BY, Company.LAST_MODIFY_DATE, Company.LAST_MODIFY_BY, Company.NAME FROM COMPANY Companyas if it is fetching all the records from table at a time no matter what's the size of Batch. If I am seeing 50 records on UI at a time, then I would expect at least 2 SELECT statement fetching 26 records by each statement if I set Batch Size to 26... OR at least 50 SELECT statement for Batch size set to '1'.
Please tell me how to see view performance tuning working ? How one can say that setting batch size = '1' is bad for performance?Anandsagar,
why don't you just read up on http://download.oracle.com/docs/cd/E21764_01/core.1111/e10108/adf.htm#CIHHGADG
there are more factors influencing performance than just query. Btw, indexing your queries also helps to tune performance
Frank -
Performance tuning in PL/SQL code
Hi,
I am working on already existing PL/SQL code which is written by someone else on validation and conversion of data from a temporary table to base table. It usually has 3.5 million rows. and the procedure takes arount 2.5 - 3 hrs to complete.
Can I enhance the PL/SQL code for better performance ? or, is this OK to take so long to process these many rows?
Thanks!
YoginiCan I enhance the PL/SQL code for better performance ? Probably you can enhance it.
or, is this OK to take so long to process these many rows? It should take a few minutes, not several hours.
But please provide some more details like your database version etc.
I suggest to TRACE the session that executes the PL/SQL code, with WAIT events, so you'll see where and on what time is spent, you'll identify your 'problem statements very quickly' (after you or your DBA have TKPROF'ed the trace file).
SQL> alter session set events '10046 trace name context forever, level 12';
SQL> execute your PL/SQL code here
SQL> exitWill give you a .trc file in your udump directory on the server.
http://www.oracle-base.com/articles/10g/SQLTrace10046TrcsessAndTkprof10g.php
Also this informative thread can give you more ideas:
HOW TO: Post a SQL statement tuning request - template posting
as well as doing a search on 10046 at AskTom, http://asktom.oracle.com will give you more examples.
and reading Oracle's Performance Tuning Guide: http://www.oracle.com/pls/db102/to_toc?pathname=server.102%2Fb14211%2Ftoc.htm&remark=portal+%28Getting+Started%29 -
hi,
I have to do perofrmance for one program, it is taking 67000 secs in back ground for execution and 1000 secs for some varints .It is an ALV report.
please suggest me how to proced to change the code.Performance tuning for Data Selection Statement
<b>http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm</b>Debugger
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
Run Time Analyser
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm
SQL trace
http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm
CATT - Computer Aided Testing Too
http://help.sap.com/saphelp_47x200/helpdata/en/b3/410b37233f7c6fe10000009b38f936/frameset.htm
Test Workbench
http://help.sap.com/saphelp_47x200/helpdata/en/a8/157235d0fa8742e10000009b38f889/frameset.htm
Coverage Analyser
http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm
Runtime Monitor
http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm
Memory Inspector
http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm
ECATT - Extended Computer Aided testing tool.
http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm
Just refer to these links...
performance
Performance
Performance Guide
performance issues...
Performance Tuning
Performance issues
performance tuning
performance tuning
You can go to the transaction SE30 to have the runtime analysis of your program.Also try the transaction SCI , which is SAP Code Inspector.
Maybe you are looking for
-
Custom Adobe Forms in FORM16 output
Dear Sapgurus, I have a requirement to change the adobe forms output in FORM16 PDF output. In standard output PDF will contain annexure to Form 16 as fifth page .We don't need that fifth page in output. So we tried to create a custom Adobe form witho
-
Fonts- transferring from old Mac to new Mac
I used FontDoctor to check and collect all my fonts from my old MBP and copied them to my new MBP OSX-10.6.4. But I don't want to install duplicates or older versions of fonts over newer ones. Will FontBook refrain from adding dups, prefer newer font
-
Changing sequence from 16:9 widescreen to anamorphic widescreen
I am working on a short video clip shot using 5D Mark II - 1080p. I am editing on FCP 7 and want to change my sequence from 16:9 to anamorphic widescreen without any distortion...anyway this can be done? All my raw files and transcoded file are 16:9.
-
I am using ant to precompile my jsp files which contains struts taglibs but it is giving an error [jasperc] error:org.apache.jasper.JasperException: Error compiling \attendance\AllPendingAuthentication.jsp [jasperc] at org.apache.jasper.JspC.processF
-
Login/keychain bug: Login as admin without a password.
I just stumbled upon this bug. I have two user accounts on my iMac (OS 10.6.1) one password protected admin account and one user account without a password. If I go to the login window and click on the user account and immediately follow up with clic