dbTalk Databases Forums  

Need help with oracle performance, union all

comp.database.oracle comp.database.oracle


Discuss Need help with oracle performance, union all in the comp.database.oracle forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
MartyL
 
Posts: n/a

Default Need help with oracle performance, union all - 09-22-2006 , 02:45 PM






I have some very large tables divided into yearly archives. I want to run a
report where the user enters the date range of the data desired. The date
field is indexed.

I have constructed a view essentially:

create view all_data as
(select x,y,data_date from table_2000 where ... [some additional criteria] )
union all
(select x,y,data_date from table_2001 where ...)
union all
(select x,y,data_date from table_2002 where ...)


I then query the view:

select * from all_data
where data_date > todate('01/10/2000','DD/MM/YYYY')
and data_date < todate('01/12/2000','DD/MM/YYYY')

Since the date is indexed, I was expecting the query to run almost as fast
as the same query run against the table_2000 - but it essentially takes
3x as long - and if I add other archive tables to the union it extends the
execution time.

any thoughts on how to speed this up? Thx, Marty










Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.