Re: Help with time series data design & optimization
Posted by: Peter Brawley
Date: March 28, 2011 06:02AM

Is this faster?

drop table tmp;
create table tmp
SELECT id,fid,MAX(date) AS date
FROM tbl
where date between '2011-03-09' and '2011-03-27'
GROUP BY id,fid;
alter table tmp add primary key(id,fid,date);

explain extended
SELECT t1.*
FROM tbl t1
JOIN tmp t2 ON t1.id = t2.id AND t1.fid = t2.fid AND t1.date = t2.date;

PB

Options: ReplyQuote


Subject
Written By
Posted
Re: Help with time series data design & optimization
March 28, 2011 06:02AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.