Performance Tuning : Query session
Dear Friends,
I am working with Hyperion Interactive reporting and I am very new to this environment, I am having a query session with 11 tables all are simple joins. when ever I am processing the query it talks long time to fetch the data ofcourse it has milions of records, do you have any idea how do I reduce query processing time. or else please tell me what are things I need to do and what are things I need not do. any query performance tips in brio.
Best Regards,
S.Murugan
Query Performance is based on a variety of factors.
- Network speed
- size of dataset returning -- Are you really bringing back 1 million rows?
- properly tuned database -- Capture the SQL and have DBA review it
- proper created query - correct order of tables for the FROM clause -- This is based on order they were brought into the data model section
Wayne Van Sluys
TopDown Consulting
Similar Messages
-
Performance Tuning Query on Large Tables
Hi All,
I am new to the forums and have a very specic use case which requires performance tuning, but there are some limitations on what changes I am actualy able to make to the underlying data. Essentially I have two tables which contain what should be identical data, but for reasons of a less than optimal operational nature, the datasets are different in a number of ways.
Essentially I am querying call record detail data. Table 1 (refered to in my test code as TIME_TEST) is what I want to consider the master data, or the "ultimate truth" if you will. Table one contains the CALLED_NUMBER which is always in a consistent format. It also contains the CALLED_DATE_TIME and DURATION (in seconds).
Table 2 (TIME_TEST_COMPARE) is a reconciliation table taken from a different source but there is no consistent unique identifiers or PK-FK relations. This table contains a wide array of differing CALLED_NUMBER formats, hugely different to that in the master table. There is also scope that the time stamp may be out by up to 30 seconds, crazy I know, but that's just the way it is and I have no control over the source of this data. Finally the duration (in seconds) can be out by up to 5 seconds +/-.
I want to create a join returning all of the master data and matching the master table to the reconciliation table on CALLED_NUMBER / CALL_DATE_TIME / DURATION. I have written the query which works from a logi perspective but it performs very badly (master table = 200,000 records, rec table = 6,000,000+ records). I am able to add partitions (currently the tables are partitioned by month of CALL_DATE_TIME) and can also apply indexes. I cannot make any changes at this time to the ETL process loading the data into these tables.
I paste below the create table and insert scripts to recreate my scenario & the query that I am using. Any practical suggestions for query / table optimisation would be greatly appreciated.
Kind regards
Mike
-------------- NOTE: ALL DATA HAS BEEN DE-SENSITISED
/* --- CODE TO CREATE AND POPULATE TEST TABLES ---- */
--CREATE MAIN "TIME_TEST" TABLE: THIS TABLE HOLDS CALLED NUMBERS IN A SPECIFIED/PRE-DEFINED FORMAT
CREATE TABLE TIME_TEST ( CALLED_NUMBER VARCHAR2(50 BYTE),
CALLED_DATE_TIME DATE, DURATION NUMBER );
COMMIT;
-- CREATE THE COMPARISON TABLE "TIME_TEST_COMPARE": THIS TABLE HOLDS WHAT SHOULD BE (BUT ISN'T) IDENTICAL CALL DATA.
-- THE DATA CONTAINS DIFFERING NUMBER FORMATS, SLIGHTLY DIFFERENT CALL TIMES (ALLOW +/-60 SECONDS - THIS IS FOR A GOOD, ALBEIT UNHELPFUL, REASON)
-- AND DURATIONS (ALLOW +/- 5 SECS)
CREATE TABLE TIME_TEST_COMPARE ( CALLED_NUMBER VARCHAR2(50 BYTE),
CALLED_DATE_TIME DATE, DURATION NUMBER )
COMMIT;
--CREATE INSERT DATA FOR THE MAIN TEST TIME TABLE
INSERT INTO TIME_TEST ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'7721345675', TO_DATE( '11/09/2011 06:10:21 AM', 'MM/DD/YYYY HH:MI:SS AM'), 202);
INSERT INTO TIME_TEST ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'7721345675', TO_DATE( '11/09/2011 08:10:21 AM', 'MM/DD/YYYY HH:MI:SS AM'), 19);
INSERT INTO TIME_TEST ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'7721345675', TO_DATE( '11/09/2011 07:10:21 AM', 'MM/DD/YYYY HH:MI:SS AM'), 35);
INSERT INTO TIME_TEST ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'7721345675', TO_DATE( '11/09/2011 09:10:21 AM', 'MM/DD/YYYY HH:MI:SS AM'), 30);
INSERT INTO TIME_TEST ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'7721345675', TO_DATE( '11/09/2011 06:18:47 AM', 'MM/DD/YYYY HH:MI:SS AM'), 6);
INSERT INTO TIME_TEST ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'7721345675', TO_DATE( '11/09/2011 06:20:21 AM', 'MM/DD/YYYY HH:MI:SS AM'), 20);
COMMIT;
-- CREATE INSERT DATA FOR THE TABLE WHICH NEEDS TO BE COMPARED:
INSERT INTO TIME_TEST_COMPARE ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'7721345675', TO_DATE( '11/09/2011 06:10:51 AM', 'MM/DD/YYYY HH:MI:SS AM'), 200);
INSERT INTO TIME_TEST_COMPARE ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'00447721345675', TO_DATE( '11/09/2011 08:10:59 AM', 'MM/DD/YYYY HH:MI:SS AM'), 21);
INSERT INTO TIME_TEST_COMPARE ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'07721345675', TO_DATE( '11/09/2011 07:11:20 AM', 'MM/DD/YYYY HH:MI:SS AM'), 33);
INSERT INTO TIME_TEST_COMPARE ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'+447721345675', TO_DATE( '11/09/2011 09:10:01 AM', 'MM/DD/YYYY HH:MI:SS AM'), 33);
INSERT INTO TIME_TEST_COMPARE ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'+447721345675#181345', TO_DATE( '11/09/2011 06:18:35 AM', 'MM/DD/YYYY HH:MI:SS AM')
, 6);
INSERT INTO TIME_TEST_COMPARE ( CALLED_NUMBER, CALLED_DATE_TIME,
DURATION ) VALUES (
'004477213456759777799', TO_DATE( '11/09/2011 06:19:58 AM', 'MM/DD/YYYY HH:MI:SS AM')
, 17);
COMMIT;
/* --- QUERY TO UNDERTAKE MATCHING WHICH REQUIRES OPTIMISATION --------- */
SELECT MAIN.CALLED_NUMBER AS MAIN_CALLED_NUMBER, MAIN.CALLED_DATE_TIME AS MAIN_CALL_DATE_TIME, MAIN.DURATION AS MAIN_DURATION,
COMPARE.CALLED_NUMBER AS COMPARE_CALLED_NUMBER,COMPARE.CALLED_DATE_TIME AS COMPARE_CALLED_DATE_TIME,
COMPARE.DURATION COMPARE_DURATION
FROM
SELECT CALLED_NUMBER, CALLED_DATE_TIME, DURATION
FROM TIME_TEST
) MAIN
LEFT JOIN
SELECT CALLED_NUMBER, CALLED_DATE_TIME, DURATION
FROM TIME_TEST_COMPARE
) COMPARE
ON INSTR(COMPARE.CALLED_NUMBER,MAIN.CALLED_NUMBER)<> 0
AND MAIN.CALLED_DATE_TIME BETWEEN COMPARE.CALLED_DATE_TIME-(60/86400) AND COMPARE.CALLED_DATE_TIME+(60/86400)
AND MAIN.DURATION BETWEEN MAIN.DURATION-(5/86400) AND MAIN.DURATION+(5/86400);What does your execution plan look like?
-
Performance tuning: lite sessions and local ServletContext
I have been doing some research on iPlanet performance tuning. In our
current production environment (iAS6.0 SP1B, iWS4.1 SP2 on Solaris), since
we don't use clustering there should be a couple of performance improvements
we can make immediately:
1. Use lite sessions (<session-impl>lite</session-impl> in ias-web.xml) - I
believe that if you use lite sessions, the session data is stored in the kjs
process space as opposed to the kxs process space. This, of course, means
that if a kjs dies the user's on it will lose their session information but
it will provide a performance improvement by reducing kxs/kjs communication.
2. Use local ServletContexts (<distributable>false</distributable> in
web.xml) - This should cause the ServletContext to only be stored in the
originating JVM. So again, if a kjs dies, the user will lose their
ServletContext but again we will get a performance improvement by reducing
kxs/kjs communcation.
What I want to understand is how our load balancing configuration will
effect our production environment if we use this configuration. Right now
we use sticky load balancing on all our servlets but we don't have our JSPs
registered and therefore sticky load balancing cannot always be trusted to
return users to the iAS they came from. We make up for this by using
hardware load balancing that keeps the majority of our users sticky.
However, using lite sessions and local ServletContexts will require that a
user not only stick to an iAS, but to a specific kjs as well. Using sticky
load balancing would ensure that, but since we also rely on our hardware
load balancers, could they create a problem? If a user gets sent back to
the iAS they came from by our hardware load balancers, will the kxs process
be smart enough to return them to the kjs they came from? If so, then I
think that means that we can safely switch to lite sessions and local
ServletContexts, but if not, I think many users will lose their sessions.
Thanks,
LincPlease follow thru this link for your answers
http://developer.iplanet.com/viewsource/char_tuningias/index.jsp
Thanks
Shital Patel
Lincoln wrote:
I have been doing some research on iPlanet performance tuning. In our
current production environment (iAS6.0 SP1B, iWS4.1 SP2 on Solaris), since
we don't use clustering there should be a couple of performance improvements
we can make immediately:
1. Use lite sessions (<session-impl>lite</session-impl> in ias-web.xml) - I
believe that if you use lite sessions, the session data is stored in the kjs
process space as opposed to the kxs process space. This, of course, means
that if a kjs dies the user's on it will lose their session information but
it will provide a performance improvement by reducing kxs/kjs communication.
2. Use local ServletContexts (<distributable>false</distributable> in
web.xml) - This should cause the ServletContext to only be stored in the
originating JVM. So again, if a kjs dies, the user will lose their
ServletContext but again we will get a performance improvement by reducing
kxs/kjs communcation.
What I want to understand is how our load balancing configuration will
effect our production environment if we use this configuration. Right now
we use sticky load balancing on all our servlets but we don't have our JSPs
registered and therefore sticky load balancing cannot always be trusted to
return users to the iAS they came from. We make up for this by using
hardware load balancing that keeps the majority of our users sticky.
However, using lite sessions and local ServletContexts will require that a
user not only stick to an iAS, but to a specific kjs as well. Using sticky
load balancing would ensure that, but since we also rely on our hardware
load balancers, could they create a problem? If a user gets sent back to
the iAS they came from by our hardware load balancers, will the kxs process
be smart enough to return them to the kjs they came from? If so, then I
think that means that we can safely switch to lite sessions and local
ServletContexts, but if not, I think many users will lose their sessions.
Thanks,
Linc -
Performance tuning query.
hello everyone,
pls clarify my doubts regarding the oracle sql tuning.
I got a report which runs for 15 mins, i made the report to be run in 1.30 min in the test instance.
in that i made 2 queries which runs for 25 sec and 27 secs and i made it into a single query and ran in 6 secs.
data
then i came to a fact called COST. the cost is too high in my query nearly 73k. So this query is cant even run in real instance in my office.
I heard the reason is COST. Is it so?
I also the referred that COST is time taken for reading a table. (lik 10ms is a default for a single block read so on....)
if COST is the time, then how my query runs in 6 secs even though the COST is 73k?
Then
I reduced the cost in my query by the use of indexes which are already present in that column.
What if i want to fetch some other column which don't have index and which i should not create index?
In that time Does COST matters? bcz the query runs in milliseconds but the cost is 1600.
What is behind the COST? some says dont consider COST(but my COST is 73K), some says COST is time(but my time is 6sec), Some says COST is resource utilised by database (dats y its taking much time)...
Pls clearify..879090 wrote:
hello everyone,
pls clarify my doubts regarding the oracle sql tuning.
I got a report which runs for 15 mins, i made the report to be run in 1.30 min in the test instance.
in that i made 2 queries which runs for 25 sec and 27 secs and i made it into a single query and ran in 6 secs.
data
then i came to a fact called COST. the cost is too high in my query nearly 73k. So this query is cant even run in real instance in my office.
I heard the reason is COST. Is it so? I would invite whoever told you that to the largest set of stairs you can find and push them down it. If they seriously decide whether queries can run or not based on the cost they should be deleted.
I also the referred that COST is time taken for reading a table. (lik 10ms is a default for a single block read so on....)
if COST is the time, then how my query runs in 6 secs even though the COST is 73k?
Then
I reduced the cost in my query by the use of indexes which are already present in that column.
What if i want to fetch some other column which don't have index and which i should not create index?
In that time Does COST matters? bcz the query runs in milliseconds but the cost is 1600.
What is behind the COST? some says dont consider COST(but my COST is 73K), some says COST is time(but my time is 6sec), Some says COST is resource utilised by database (dats y its taking much time)...
Pls clearify..The cost is a calculation. It is comprised of a number of different metrics but utlimately it is something the database used internally to decide which exectuion plan it is going to use to execute a specific query. The costs between 2 different queryies aren't really comparable (there are specific circumstances where 2 different queries can be rewritten behind the scenes to result in the same execution plan, but that's a whole different kettle of fish).
The bottom line is that you should not use cost to tune a query - if someone tells you that you should, hit them with something non lethal but painful. -
Reg: Process Chain, query performance tuning steps
Hi All,
I come across a question like, There is a process chain of 20 processes.out of which 5 processes are completed at the 6th step error occured and it cannot be rectified. I should start the chain again from the 7th step.If i go to a prticular step i can do that particular step, How can i start the entair chain again from step 7.i know that i need to use a function module but i dont know the name of FM. Please somebody help me out.
Please let me know the steps involved in query performance tuning and aggregate tuning.
Thanks & Regards
Omkar.KHi,
Process Chain
Method 1 (when it fails in a step/request)
/people/siegfried.szameitat/blog/2006/02/26/restarting-processchains
How is it possible to restart a process chain at a failed step/request?
Sometimes, it doesn't help to just set a request to green status in order to run the process chain from that step on to the end.
You need to set the failed request/step to green in the database as well as you need to raise the event that will force the process chain to run to the end from the next request/step on.
Therefore you need to open the messages of a failed step by right clicking on it and selecting 'display messages'.
In the opened popup click on the tab 'Chain'.
In a parallel session goto transaction se16 for table rspcprocesslog and display the entries with the following selections:
1. copy the variant from the popup to the variante of table rspcprocesslog
2. copy the instance from the popup to the instance of table rspcprocesslog
3. copy the start date from the popup to the batchdate of table rspcprocesslog
Press F8 to display the entries of table rspcprocesslog.
Now open another session and goto transaction se37. Enter RSPC_PROCESS_FINISH as the name of the function module and run the fm in test mode.
Now copy the entries of table rspcprocesslog to the input parameters of the function module like described as follows:
1. rspcprocesslog-log_id -> i_logid
2. rspcprocesslog-type -> i_type
3. rspcprocesslog-variante -> i_variant
4. rspcprocesslog-instance -> i_instance
5. enter 'G' for parameter i_state (sets the status to green).
Now press F8 to run the fm.
Now the actual process will be set to green and the following process in the chain will be started and the chain can run to the end.
Of course you can also set the state of a specific step in the chain to any other possible value like 'R' = ended with errors, 'F' = finished, 'X' = cancelled ....
Check out the value help on field rspcprocesslog-state in transaction se16 for the possible values.
Query performance tuning
General tips
Using aggregates and compression.
Using less and complex cell definitions if possible.
1. Avoid using too many nav. attr
2. Avoid RKF and CKF
3. Many chars in row.
By using T-codes ST03 or ST03N
Go to transaction ST03 > switch to expert mode > from left side menu > and there in system load history and distribution for a particual day > check query execution time.
/people/andreas.vogel/blog/2007/04/08/statistical-records-part-4-how-to-read-st03n-datasets-from-db-in-nw2004
/people/andreas.vogel/blog/2007/03/16/how-to-read-st03n-datasets-from-db
Try table rsddstats to get the statistics
Using cache memoery will decrease the loading time of the report.
Run reporting agent at night and sending results to email.This will ensure use of OLAP cache. So later report execution will retrieve the result faster from the OLAP cache.
Also try
1. Use different parameters in ST03 to see the two important parameters aggregation ratio and records transferred to F/E to DB selected.
2. Use the program SAP_INFOCUBE_DESIGNS (Performance of BW infocubes) to see the aggregation ratio for the cube. If the cube does not appear in the list of this report, try to run RSRV checks on the cube and aggregates.
Go to SE38 > Run the program SAP_INFOCUBE_DESIGNS
It will shown dimension Vs Fact tables Size in percent.If you mean speed of queries on a cube as performance metric of cube,measure query runtime.
3. --- sign is the valuation of the aggregate. You can say -3 is the valuation of the aggregate design and usage. ++ means that its compression is good and access is also more (in effect, performance is good). If you check its compression ratio, it must be good. -- means the compression ratio is not so good and access is also not so good (performance is not so good).The more is the positives...more is useful the aggregate and more it satisfies the number of queries. The greater the number of minus signs, the worse the evaluation of the aggregate. The larger the number of plus signs, the better the evaluation of the aggregate.
if "-----" then it means it just an overhead. Aggregate can potentially be deleted and "+++++" means Aggregate is potentially very useful.
Refer.
http://help.sap.com/saphelp_nw70/helpdata/en/b8/23813b310c4a0ee10000000a114084/content.htm
http://help.sap.com/saphelp_nw70/helpdata/en/60/f0fb411e255f24e10000000a1550b0/frameset.htm
4. Run your query in RSRT and run the query in the debug mode. Select "Display Aggregates Found" and "Do not use cache" in the debug mode. This will tell you if it hit any aggregates while running. If it does not show any aggregates, you might want to redesign your aggregates for the query.
Also your query performance can depend upon criteria and since you have given selection only on one infoprovider...just check if you are selecting huge amount of data in the report
Check for the query read mode in RSRT.(whether its A,X or H)..advisable read mode is X.
5. In BI 7 statistics need to be activated for ST03 and BI admin cockpit to work.
By implementing BW Statistics Business Content - you need to install, feed data and through ready made reports which for analysis.
http://help.sap.com/saphelp_nw70/helpdata/en/26/4bc0417951d117e10000000a155106/frameset.htm
/people/vikash.agrawal/blog/2006/04/17/query-performance-150-is-aggregates-the-way-out-for-me
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1955ba90-0201-0010-d3aa-8b2a4ef6bbb2
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ce7fb368-0601-0010-64ba-fadc985a1f94
http://help.sap.com/saphelp_nw04/helpdata/en/c1/0dbf65e04311d286d6006008b32e84/frameset.htm
You can go to T-Code DB20 which gives you all the performance related information like
Partitions
Databases
Schemas
Buffer Pools
Tablespaces etc
use tool RSDDK_CHECK_AGGREGATE in se38 to check for the corrupt aggregates
If aggregates contain incorrect data, you must regenerate them.
Note 646402 - Programs for checking aggregates (as of BW 3.0B SP15)
Thanks,
JituK -
Dear All,
My client wants to do the performance tuning in a query where it has the Global structure of 300 CKF & 300 RKF.
They dont want to touch the MP, all they want to do some performance tuning through the front end without touching the Multiprovider.
The CKF is little bit tricky where in Each CKF has 28 RKF and In each RKF atleast 2 variables are used an with hierarchy restrictions. The query is taking 30 - 40 min to execute. Kindly guide me how to handle this.
Regards,
Suman Thangadurai.HI,
Improving query performance u2013
- Generate index.
- Build query on multiprovider and better use Constant Selection Function to bring infoset functionality to Multiprovider.
- Make your query more dynamic using variables.
- Do partitioning on IC when you have restriction on 0CALMONTH.
- Use more free charecterstics.
- Use include than exclude at Bex level.
- Utilize Cache mode and Read mode functions.
Regards,
rvc -
VAL_FIELD selection to determine RSDRI or MDX query: performance tuning
according to on of the HTG I am working on performance tuning. one of the tip is to try to query base members by using BAS(xxx) in the expension pane of BPC report.
I did so and found an interesting issue in one of the COPA report.
with income statement, when I choose one node gross_profit, saying BAS(GROSS_PROFIT), it generates RSDRI query as I can see in UJSTAT. when I choose its parent, BAS(DIRECT_INCOME), it generates MDX query!
I checked DIRECT_INCOME has three members, GROSS_PROFIT, SGA, REV_OTHER. , none of them has any formulars.
in stead of calling BAS(DIRECT_INCOME), I called BAS(GROSS_PROFIT),BAS(SGA),BAS(REV_OTHER), I got RSDRI query again.
so in smmary,
BAS(PARENT) =>MDX query.
BAS(CHILD1)=>RSDRI query.
BAS(CHILD2)=>RSDRI query.
BAS(CHILD3)=>RSDRI query.
BAS(CHILD1),BAS(CHILD2),BAS(CHILD3)=>RSDRI query
I know VAL_FIELD is SAP reserved name for BPC dimensions. my question is why BAS(PARENT) =>MDX query.?
interestingly I can repeat this behavior in my system. my intention is to always get RSDRI query,
GeorgeOk - it turns out that Crystal Reports disregards BEx Query variables when put in the Default Values section of the filter selection.
I had mine there and even though CR prompted me for the variables AND the SQL statement it generated had an INCLUDE statement with hose variables I could see by my result set that it still returned everything in the cube as if there was no restriction on Plant for instance.
I should have paid more attention to the Info message I got in the BEx Query Designed. It specifically states that the "Variable located in Default Values will be ignored in the MDX Access".
After moving the variables to the Characteristic Restrictions my report worked as expected. The slow response time is still an issue but at least it's not compounded by trying to retrieve all records in the cube while I'm expecting less than 2k.
Hope this helps someone else -
Oracle query performance tuning
Hi
I am doing Oracle programming.Iwould like to learn Query Performance Tuning.
Could you guide me , like how could i learn this online, which books to refer.
Thank youI would recommend purchasing a copy of Cary Millsap's book now:
http://www.amazon.com/Optimizing-Oracle-Performance-Cary-Millsap/dp/059600527X/ref=sr_1_1?ie=UTF8&qid=1248985270&sr=8-1
And Jonathan Lewis' when you feel you are at a slightly more advanced level.
http://www.amazon.com/Cost-Based-Oracle-Fundamentals-Experts-Voice/dp/1590596366/ref=pd_sim_b_2
Both belong in everyone's bookcase. -
Analysis and Performance tuning of a query
Hi gurus,
We have few reports built on multiprovider (which is containing five basic cubes) whose response time is very slow, so i want to do some analysis to find out why they are runing very slow and also do the performance tuning.
So where do i start and how do i start like is it from Report or multiprovider
if its report or multiprovider please kindly guide me what are the things do i need to look for and how to correct them whether adding something or changing the data design.
i have four reports
1. is runing on three basic cubes
2. is runing on all the five cubes
3.& 4. runing on 2 cubes
so kindly give your inputs
thanks and regards
Neeldocs on performance available in
FAQ - The Future of SAP NetWeaver Business Intelligence in the Light of the NetWeaver BI&Business Objects Roadmap
https://service.sap.com/bi
-> performance
effective query on MP can be found
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b03b7f4c-c270-2910-a8b8-91e0f6d77096
for nw2004s
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a9ab011a-0e01-0010-02a1-d496b94c9c0f
modeling on multiprovider
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2f5aa43f-0c01-0010-a990-9641d3d4eef7
hope this helps. -
Performance tuning or Query tuning
Hi,
I am a PL/SQL programmer and I wanna learn Query tuning or performance tuning to extend my knowledge.
Can any one please suggest me where to start? I read somthing RBO and CBO and get into confusion is oracle supports both? which one is better? how to use them...is it differ from version to version like 9i/10g
I appreciate any kind of help.
Thanks and Regards
MaiHi,
If you a pl/sql programmer than I shall assume that you don't do much database activity and at the moment , would be upgrading yourself with the database knowledge. I shall suggest in addition to Oracle docs, these books in order to understand Query Tuning.
Effective-Oracle-By-Design
Cost-Based-Oracle-Fundamentals
Practical-Oracle8i
I have found these books as the best ones in the understandng of various very important factors in query tuning and I use these books every day.
HTH
Aman.... -
Query About performance tuning
Hi Guru's
May be this question is stupid one, but i think this is the forum where every user get details of all there questions.
I want to start learning Performance tuning but not know the path from where to start can anyone suggest me the same.
Thanks in advanceHi,
performance tuning is a huge area. It involves following skills:
1. Understanding how Oracle stores data (physical structure of tables and indexes) and how it reads and writes it.
2. Understanding how Oracle processes and executes queries
3. Ability to read execution plans (not just scan them for 'red flags')
4. Familiarity is most common wait events, knowing and understanding Oracle Wait Interface and its limitations
5. Ability to understand AWR and ASH data and its limitations
6. Understanding Oracle optimizer and it's inputs, knowing basic formulas for cardinality and selectivity, cardinality feedback tuning
7. Abilty to read trace files (first of all extended SQL trace, 10046, and CBO trace, 10053)
8. Understanding concurrency and read consistency and work Oracle does to maintain them.
This is probably not a complete list. Of course you won't be able to learn everything at once. You can start by reading:
1. The official Oracle Performance Tuning Guide
2. T. Kyte's books on Oracle architecture
3. Milsap's and Holt's book "Optimizing Oracle Performance"
4. J. Lewis "Cost based fundamentals"
Best regards,
Nikolay -
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 -
Planning to start the performance tuning but....
Friends,
Database OS: RHEL AS 3.0
Database: Oracle Release 9.2.0.4.0
Number of Tables: 503
TableSpace size - 1.8GB out of 3GB
Max.Records in a Table - 1 Million and its increasing..
Our DB Optimizer mode is - CHOOSE (is it RBO?)
We are not using enterprise manager and not installed any tuning scripts like statspack etc....
Currently we are taking user managed backup without any problem so we are continuing the same from 2004 onwards.
Now we want want to tune our database.(We have never tuned our database)
We would like to change our optimizer from RBO to CBO.
Can anybody tell me the first step for the performance tuning?
Please dont suggest me oracle doc im already studying.....its taking time....
In the mean time......
Step 1: Can i Analyze the table or dbms_stat package?
We have not at all used the analyze or dbms_stat. So can i start with any of the above or do u have any other suggestions for the 1st step?
Thanksour manager feels that if we tune our db the performance will be more than compared to the current one.you have a mystique manager then, ask him what kind of "feelings" does he have about my database ;) there is no place for feelings in this game, this is life cycle to be successful ; testing->reporting->analyzing->take nedded actions->re-testing->reporting->analyzing..
so while you are surely reading the documentation;
Oracle9i Database Performance Planning Release 2 (9.2)
http://download.oracle.com/docs/cd/B10501_01/server.920/a96532/toc.htm
Oracle9i Database Performance Tuning Guide and Reference Release 2 (9.2)
http://download.oracle.com/docs/cd/B10501_01/server.920/a96533/toc.htm
first thing you have to do is to setup an appropriate test environment with same os-oracle releases, parameters;
-- some of them to check
SELECT NAME, VALUE
FROM v$system_parameter a
WHERE a.NAME IN
('compatible', 'optimizer_features_enable',
'optimizer_mode', 'pga_aggregate_target', 'workarea_size_policy',
'db_file_multiblock_read_count', .. )and of course schema set and data amount. Then you run your application on load and take statspack snapshots and do the same after collecting statistics;
-- customize for your configuration, schema level object statistics
exec dbms_stats.gather_schema_stats( ownname =>'YOUR_SCHEMA', degree=>16, options=>'GATHER AUTO', estimate_percent=>dbms_stats.auto_sample_size, cascade=>TRUE, method_opt=>'FOR ALL COLUMNS SIZE AUTO', granularity=>'ALL');
-- check your system stats, with sys account
SELECT pname, pval1 FROM sys.aux_stats$ WHERE sname = 'SYSSTATS_MAIN';after you have the base report and the report after change compare the top 5 waits, the top queries which have dramatic logical I/O changes etc. At this point you go into session based tuning in order to understand why a specific query performs worser with CBO compared to RBO. You need to be able to create and read execution plans and i/o statistics at least. Here are some quick introductions;
http://www.bhatipoglu.com/entry/17/oracle-performance-analysis-tracing-and-performance-evaluation
http://psoug.org/reference/explain_plan.html
http://coskan.wordpress.com/2007/03/04/viewing-explain-plan/
and last words again goes to your manager; how does he "feel" about a 10gR2 migration? With Grid Control, AWR, ADDM and ASH performance tuning evolved a lot. Important note here, after 10g RBO is dead(unsupported).
Best Regards,
H.Tonguç YILMAZ
http://tonguc.yilmaz.googlepages.com/
Message was edited by:
TongucY -
Help request for Oracle DB Performance tuning
I need some help on Oracle performance tuning.
My environment is VB 6 frontend & Oracle 8
in backend.
The problem I am facing is particularly in
muli-user environment. Some query which takes
20 seconds to when there is only one user
working in the network, takes more time
(3 minutes to even 5 minutes) when there are
4-5 users working in the network.
What may be wrong ?
Are there any parameters that I can
fine tune ?
We checked the resource utilization at the
server level CPU utilization is max 50 %,
Memoery utilization is 50 % (250 MB out of available 512 KB)
nullHi Vinay,
There can be many reasons for time delay.
Here are some--
1) You may not be releasing the locks on objects quickly after use.
This can be obtained by querying v$locked_object.
2) You may be holding many sessions concurrently and not closing the older ones.
This u can get by querying v$session.
These are some common problems in multi-user platform.
R u using MTS?
Yogesh. -
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
Maybe you are looking for
-
MDM and SRM installation on 1 Server??
Hi, I have a question for a new SAP SRM implementation with MDM. Is it possible to put them both on one server or is this not recommendable? And what are the (dis)advantages? Thanks for your replies! Regards, Roel van Loon
-
Why won't my iPhone 5 charge?
My iPhone is a 5S that I bought right before iOS7 came out. Once I updated the phone, it experienced a lot of crashes. iMessage doesnn't always work, my apps shut down, etc. My biggest problem, though, has been that my phone no longer charges. It wil
-
Date in "Notes" creates links to "Calendar"
I entered a date (17 Sep - 03 Oct) in the native "Notes" app. When I return to this note the date is now underlined (_17 Sep - 03 Oct_) and creates a link to the Calendar to create an event. How do I stop this auto formatting/linking?
-
IOS8 Family Sharing Limitations
I have a really interesting problem, and wonder if anyone might be able to help. In short. We have 4 iOS devices (iPhone x2 for me and my wife, iPad x2 for home/kids - under 12 yrs). All devices used to all use my iCloud/iTunes account. This gives us
-
Bridge/Photoshop Colour Issues
Bridge/ Photoshop Colour Issues: It appears that there are a few pictures that are noticeably dull, when I load them in Bridge and Photoshop. Those same pictures are very vibrant when I look at them directly from the SD card or load them into Pic