Hi all,
I was upgrading a 4.5 installation to 4.6. The upgrade to 4.6 died on
the acs-events upgrade script, so I went to fix it. I found what I
think is a very innefficient query and am trying to optimize it, so
suggestions and pointers of places where I screwed up are appreciated 😊
Here's the original query (in a function):
FOR v_timespan in
select *
from time_intervals
where interval_id in
(select interval_id
from timespans
where timespan_id in
(select timespan_id
from acs_events
where recurrence_id =
(select recurrence_id
from acs_events
where event_id = p_event_id)))
I'm thinking that it this case it would work to put everything in
inner joins to get rid of the INs. I just woke up so I may be missing
something obvious :) Comments?