performace issue with indexing [message #207441] |
Tue, 05 December 2006 10:11 |
jaydba
Messages: 86 Registered: September 2006 Location: UK
|
Member |
|
|
Our users are experiencing the performance problem using Oracle 8.1.7 database. We are using Business object to display the data as required.
This is the below script using BO.
Can you please suggest me technically how to get resolved this issue?
Please let me know if you need any more information.
Thanks
This is an example of the typical type of query I use, it works o.k. but I think some indexing could make it run much quicker.
I think the TEST.SH_TYS____COMPL.CLOSED_TIME & TEST.SH_TYS____COMPL.CANCELLED_TIME are key fields that could be indexed to speed up the report.
Also I tend to do a lot of reports using the TEST.TYS__COMPL_CONFIGURATION.OWNING_CENTRE as a filter, this isn't that large a table but
uses a table join on TEST.TYS____COMPL.CID = TEST.TYS__COMPL_CONFIGURATION.CID so indexing the TEST.TYS____COMPL.CID field could
provide an improvement.
The TEST.TYS____COMPL.CREATE_DATE is another key field when we want to identify tickets raised during a period.
The TEST.TYS____COMPL.SUBCASE_OF is another key field we filter by.
The TEST.TYS____COMPL.CLEAR_CODE_OBJECT_FAMILY,TEST.TYS____COMPL.CLEAR_CODE_OBJECT & TEST.TYS____COMPL.CLEAR_CODE_ACTION fields may also be useful.
|
|
|
|
Re: performace issue with indexing [message #207593 is a reply to message #207441] |
Wed, 06 December 2006 02:50 |
bwetkstr
Messages: 114 Registered: August 2005
|
Senior Member |
|
|
There are a few things you can do.
First run the query in for example TOAD, check how long it takes to execute. (Best to count the rows)
select count(*) from (
--here comes your own query
)
Let's say it takes 500ms. Then the problem is not your query but BO. The reason why I mention this is because I've had similar problems.
If it is indeed the query that is slow. Then you can indeed add indexes. Don't forget an index can help you but also slow you down.
Oracle says that the best place the create an index is on the column that has the most distinct values.
But it all depends, it is not that easy. It depends weather your database is using the rule or cost based optimizer. When in cost based, are your statistics up to date, and so on.
So my advice is first check if your reports are slow due to your sql statement and not an other factor.
If so check if your database is in Rule based or cost based, and slowly add some indexes. Starting with the column that has the most distinct values.
It could be that your query is still slow, but at least you will have a better view of what is going on.
Kr
Karel.
|
|
|
|
|
|
Re: performace issue with indexing [message #207811 is a reply to message #207688] |
Thu, 07 December 2006 02:15 |
bwetkstr
Messages: 114 Registered: August 2005
|
Senior Member |
|
|
jaydba wrote on Wed, 06 December 2006 18:24 | The optimizer mode is CHOOSE(I think CBO) I will check your suggestion for creating index. Can you please tell me how to create explain plan through toad? How it would be useful here?
Thanks in advance.
|
Creating an explain plan is very easy : http://www.oracle-base.com/articles/8i/ExplainPlanUsage.php
Here you can find how to install it and how to use it.
An explain plan will tell you if your indexes are beeing used, if so, witch ones and so on. You see how your database is processing your query.
Kr
Karel.
|
|
|
Re: performace issue with indexing [message #207815 is a reply to message #207688] |
Thu, 07 December 2006 02:24 |
bwetkstr
Messages: 114 Registered: August 2005
|
Senior Member |
|
|
jaydba wrote on Wed, 06 December 2006 18:24 | The optimizer mode is CHOOSE(I think CBO)
|
CBO = Cost Based Optimizer
Not choose based.
Your database is in choose witch means that if you have statistics you will run in CBO, if not it will be RBO.
So do you run statistics on your objects?
|
|
|
|
Re: performace issue with indexing [message #208198 is a reply to message #208194] |
Fri, 08 December 2006 09:52 |
bwetkstr
Messages: 114 Registered: August 2005
|
Senior Member |
|
|
jaydba wrote on Fri, 08 December 2006 16:28 | I executed the same rport today and it takes 01:10 sec. Do you beieve that it is a problem with BO.
|
Did you add an index?
And by saying you ran the report .. is it the select count(*) .. query of that report ? Or the realy report?
[Updated on: Fri, 08 December 2006 09:52] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: performace issue with indexing [message #208611 is a reply to message #208604] |
Mon, 11 December 2006 09:22 |
bwetkstr
Messages: 114 Registered: August 2005
|
Senior Member |
|
|
jaydba wrote on Mon, 11 December 2006 16:01 | I'm sending herewith the explain plan from toad as below for further invetigation
Operation Object Name Rows Bytes Cost Object Node In/Out PStart PStop
SELECT STATEMENT Optimizer Mode=CHOOSE 7 K 19360
CONCATENATION
HASH JOIN 3 K 2 M 11048
TABLE ACCESS FULL ARADMIN.T60 11 K 473 K 200
NESTED LOOPS 3 K 1 M 10837
TABLE ACCESS BY INDEX ROWID ARADMIN.H35 3 K 111 K 3255
INDEX RANGE SCAN ARADMIN.STF_CANT 3 K 48
TABLE ACCESS BY INDEX ROWID ARADMIN.T35 1 M 698 M 2
INDEX UNIQUE SCAN ARADMIN.IT35 1 M 1
HASH JOIN 3 K 2 M 11048
TABLE ACCESS FULL ARADMIN.T60 11 K 473 K 200
NESTED LOOPS 3 K 1 M 10837
TABLE ACCESS BY INDEX ROWID ARADMIN.H35 3 K 111 K 3255
INDEX RANGE SCAN ARADMIN.STF_CLOT 3 K 48
TABLE ACCESS BY INDEX ROWID ARADMIN.T35 1 M 698 M 2
INDEX UNIQUE SCAN ARADMIN.IT35 1 M 1
|
What did you do? Add an index? Where ? What kind? How long did the query take?
|
|
|