I really can't figure this one out:
Whenever someone logs into My Space, and the day-summary is to be generated, it takes like 12(!) seconds...
The user has 5 communities and 5 classes.
[04/Jul/2003:13:01:51][936.5126][-conn3-] Notice: SQL():
select to_char(start_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_start_date,
to_char(end_date, 'YYYY-MM-DD HH24:MI:SS') as ansi_end_date,
nvl(e.name, a.name) as name,
nvl(e.status_summary, a.status_summary) as status_summary,
e.event_id as item_id,
(select type from cal_item_types where item_type_id= cal_items.item_type_id) as item_type,
on_which_calendar as calendar_id,
(select calendar_name from calendars
where calendar_id = on_which_calendar)
as calendar_name,
to_char(timezone.local_to_utc(timezone.get_id(:timezone),to_date(:current_date,:date_format)),'YYYY-MM-DD HH24:MI:SS') as start_interval,
to_char(timezone.local_to_utc(timezone.get_id(:timezone),to_date(:current_date,:date_format) + (24 - 1/3600)/24),'YYYY-MM-DD HH24:MI:SS') as end_interval
from acs_activities a,
acs_events e,
timespans s,
time_intervals t,
cal_items
where e.timespan_id = s.timespan_id
and s.interval_id = t.interval_id
and e.activity_id = a.activity_id
and start_date between
timezone.local_to_utc(timezone.get_id(:timezone),to_date(:current_date,:date_format)) and
timezone.local_to_utc(timezone.get_id(:timezone),to_date(:current_date,:date_format) + (24 - 1/3600)/24)
and cal_items.cal_item_id= e.event_id
and e.event_id
in (
select cal_item_id
from cal_items
where on_which_calendar in (421755,18243,18478,981405,1638428)
)
[04/Jul/2003:13:01:51][936.5126][-conn3-] Notice: bind variable 'timezone' = 'Europe/Oslo'
[04/Jul/2003:13:01:51][936.5126][-conn3-] Notice: bind variable 'current_date' = '2003-07-04'
[04/Jul/2003:13:01:51][936.5126][-conn3-] Notice: bind variable 'date_format' = 'YYYY-MM-DD HH24:MI'
[04/Jul/2003:13:01:51][936.5126][-conn3-] Notice: bind variable 'timezone' = 'Europe/Oslo'
[04/Jul/2003:13:01:51][936.5126][-conn3-] Notice: bind variable 'current_date' = '2003-07-04'
[04/Jul/2003:13:01:51][936.5126][-conn3-] Notice: bind variable 'date_format' = 'YYYY-MM-DD HH24:MI'
[04/Jul/2003:13:01:51][936.5126][-conn3-] Notice: bind variable 'timezone' = 'Europe/Oslo'
[04/Jul/2003:13:01:51][936.5126][-conn3-] Notice: bind variable 'current_date' = '2003-07-04'
[04/Jul/2003:13:01:51][936.5126][-conn3-] Notice: bind variable 'date_format' = 'YYYY-MM-DD HH24:MI'
[04/Jul/2003:13:01:51][936.5126][-conn3-] Notice: bind variable 'timezone' = 'Europe/Oslo'
[04/Jul/2003:13:01:51][936.5126][-conn3-] Notice: bind variable 'current_date' = '2003-07-04'
[04/Jul/2003:13:01:51][936.5126][-conn3-] Notice: bind variable 'date_format' = 'YYYY-MM-DD HH24:MI'
[04/Jul/2003:13:02:03][936.5126][-conn3-] Notice: SQL():
select to_char(to_date(:current_date, 'yyyy-mm-dd')-1, 'yyyy-mm-dd')
as yesterday,
to_char(to_date(:current_date, 'yyyy-mm-dd')+1, 'yyyy-mm-dd')
as tomorrow
from dual
[04/Jul/2003:13:02:03][936.5126][-conn3-] Notice: bind variable 'current_date' = '2003-07-04'
[04/Jul/2003:13:02:03][936.5126][-conn3-] Notice: bind variable 'current_date' = '2003-07-04'
The last select statement generates like 150 cal_items;
select cal_item_id
from cal_items
where on_which_calendar in (421755,18243,18478,981405,1638428)
Any clues for where to look to improve performance?
(Oracle 8.1.7, calendar 1.0, acs-kernel 4.7.2d)