Performance tuning (cache sub query results) [message #483360] |
Sun, 21 November 2010 07:02 |
|
yosikal
Messages: 1 Registered: November 2010 Location: Israel
|
Junior Member |
|
|
Hi Everyone,
I need some help with performance tuning for a query I'm running. The query is calculating average build time for projects when each project has several build connected to it. The builds subquery returning ~200000 rows is a constant query (no where clause containing reference to the projects table and therefore returns the same data always) and I think that Oracle is running the query for each row in projects table even though same results return. Is it possible to tell Oracle in some way to run this sub query once and cache the result?
Here is the query:
select
.....project.name,
.....(select avg(builds.end builds.start) from
..........(select project_name, start, end...) builds
.....where
..........build.project_name = projects.name) as project_avg
from
.....projects
Thanks in advance,
Yosi
|
|
|
|