Home » RDBMS Server » Performance Tuning » How to Improve Oracle View Performance
How to Improve Oracle View Performance [message #178289] Tue, 20 June 2006 08:50 Go to next message
TheStupid
Messages: 3
Registered: June 2006
Junior Member
We have an application written by a now defunc company a few years back. It uses a few synonyms which are views from another schema.

The problem is the speed. It takes almost 20 secs to get some value out of these views.

I am wondering if there is anyway to improve the speed? It's in Oracle 8.1.6

-------- View 1 -------
SELECT job_outputs.company_code,
       job_outputs.factory,
       job_outputs.job_number,
       job_outputs.process_stage,
       job_outputs.process_spec,
       job_outputs.warehouse,
       job_outputs.part_code,
       job_outputs.output_unit,
       job_outputs.temp_count_unit,
       jobs.description
FROM   jobs,
       job_outputs
WHERE  job_outputs.company_code = jobs.company_code
       AND job_outputs.factory = jobs.factory
       AND job_outputs.job_number = jobs.job_number
       AND job_outputs.destination_type = 'I'
       AND jobs.status_flag = 'R'



-------View 2 -------
SELECT jobs.company_code,
       jobs.factory,
       jobs.job_number,
       jobs.description,
       job_stage.process_stage,
       jobs.std_process_spec,
       job_stage_lines.source_type,
       job_stage_lines.pm_close_line
FROM   jobs,
       job_stage,
       job_stage_lines
WHERE  Rtrim(jobs.status_flag,
             ' ') = 'R'
       AND jobs.company_code = job_stage.company_code
       AND jobs.factory = job_stage.factory
       AND jobs.job_number = job_stage.job_number
       AND jobs.company_code = job_stage_lines.company_code
       AND jobs.factory = job_stage_lines.factory
       AND jobs.job_number = job_stage_lines.job_number


[Updated on: Tue, 20 June 2006 08:54] by Moderator

Report message to a moderator

Re: How to Improve Oracle View Performance [message #178293 is a reply to message #178289] Tue, 20 June 2006 08:58 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Next time, please apply some formatting.
http://www.orafaq.com/cgi-bin/sqlformat/pp/utilities/sqlformatter.tpl
>>I am wondering if there is anyway to improve the speed?
Without any useful information, we cannot proceed. Please read the sticky.
http://www.orafaq.com/forum/t/51267/42800/
Same questions again. Are there proper indexes. Are the statistics updated on indexes/tables?
Did you make use of function based indexes?
>>It uses a few synonyms
Synonyms are known to have problems.
Re: How to Improve Oracle View Performance [message #178294 is a reply to message #178289] Tue, 20 June 2006 09:07 Go to previous messageGo to next message
TheStupid
Messages: 3
Registered: June 2006
Junior Member
I don't really know how to apply index on views with joints.
Re: How to Improve Oracle View Performance [message #178295 is a reply to message #178294] Tue, 20 June 2006 09:11 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Views can make use of Indexes on the base tables.
Did you collect the statistics lately?
Post your execution plan.
Re: How to Improve Oracle View Performance [message #178296 is a reply to message #178295] Tue, 20 June 2006 09:14 Go to previous messageGo to next message
TheStupid
Messages: 3
Registered: June 2006
Junior Member
Mahesh, thank you so much for your input. I don't really know much about Oracle.

When you say "views can make use of indexes on the base tables", how do I construct the indexes on the base tables then? Would you be able to do that for the examples I posted above? That's where I got stuck

I don't know what "statistics" or "execution plan" is, I guess I'll find out.

Mahesh Rajendran wrote on Tue, 20 June 2006 09:11

Views can make use of Indexes on the base tables.
Did you collect the statistics lately?
Post your execution plan.

Re: How to Improve Oracle View Performance [message #178302 is a reply to message #178296] Tue, 20 June 2006 09:38 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Did you go through the sticky?
For most of your questions, please search the forum/google. There are tons of examples in this site which will help you to get a kickstart. Most of the questions usually asked here are already answered in form or the other.
http://www.orafaq.com/wiki/Explain_Plan
Regards
Re: How to Improve Oracle View Performance [message #178304 is a reply to message #178302] Tue, 20 June 2006 09:39 Go to previous message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
http://orafaq.com/faq/performance_tuning
Previous Topic: Is there any way for defrage the tablespace in linux Os
Next Topic: How to find the loading session
Goto Forum:
  


Current Time: Wed Nov 27 05:51:06 CST 2024