MY Problem is that the join queries take around 7-15 seconds for 1,5 million datasets and i want to reduce it significantly but don't really know how.
I have a Database Designed as Followed:
Tbl1: ID - Time1 - Time 2 - Time2
Tbl2: ID - Topic_ID
Tbl3: ID - Location_ID
Tbl4: ID - Status_ID
The first ID is always the same and there are allways keys on both Columns. It is easily possible to join 2 tables but as soon as i try to join a 3rd on like for example:
Select t1.Time1,t2.Topic_ID,t3_Location_id
from
(select ID,Time1 from tbl1 where time > 400 and < 500 ) as t1
inner join tbl2 as t2 on t2.Id = t1.ID
inner join tbl3 as t3 on t2.id = t3.ID
where t2.topic_ID = 2
The Time Grows massively from 0.02 secs to 7-15 secs.
MY Problem now is that there is a 1:1 Relation for all tables execpt for table 2 where it is possible that one Id has more than one Topic.
I Hope I explained my Problem decently.
Thank you very much for you Help