Defeito #1145
Atualizado por Mauricio Luiz Viani há aproximadamente 2 anos
Observou-se no log do Expresso que uma query da agenda eventualmente causa estouro de memória.
<pre>
pgsql Error: -1 (ERROR: out of memory DETAIL: Failed on request of size 24 in memory context "ExprContext".)
File: /var/www/expresso/calendar/inc/class.socalendar_sql.inc.php
Line: 758
Function: socalendar_::get_event_ids / socalendar_::list_events / socalendar::list_events /
bocalendar::store_to_cache / uicalendar::display_weekly / uicalendar::get_week / uicalendar::week / ExecMethod
Session halted.
</pre>
Verificar se a query pode ser melhorada: (exemplo)
<pre>
SELECT DISTINCT phpgw_cal.cal_id, phpgw_cal.datetime,phpgw_cal.edatetime,phpgw_cal.priority FROM phpgw_cal
JOIN
(
SELECT DISTINCT cal_id FROM
( SELECT DISTINCT phpgw_cal.cal_id FROM phpgw_cal WHERE phpgw_cal.owner = 265
UNION ALL SELECT DISTINCT phpgw_cal_user.cal_id FROM phpgw_cal_user WHERE phpgw_cal_user.cal_login = 265 ) AS sub1
)
AS sub2 ON sub2.cal_id = phpgw_cal.cal_id
WHERE
(
(
( phpgw_cal.datetime BETWEEN 1652065200 AND 1652756399 ) OR
( phpgw_cal.edatetime BETWEEN 1652065200 AND 1652756399 )
) OR
(
( phpgw_cal.datetime BETWEEN 0 AND 1652065200 ) AND
( phpgw_cal.edatetime BETWEEN 1652065200 AND 1684292399 )
) OR
(
( phpgw_cal.edatetime BETWEEN 1652756399 AND 1684292399 ) AND
( phpgw_cal.datetime BETWEEN 0 AND 1652756399 )
)
)
ORDER BY phpgw_cal.datetime ASC, phpgw_cal.edatetime ASC, phpgw_cal.priority ASC
</pre>
<pre>
pgsql Error: -1 (ERROR: out of memory DETAIL: Failed on request of size 24 in memory context "ExprContext".)
File: /var/www/expresso/calendar/inc/class.socalendar_sql.inc.php
Line: 758
Function: socalendar_::get_event_ids / socalendar_::list_events / socalendar::list_events /
bocalendar::store_to_cache / uicalendar::display_weekly / uicalendar::get_week / uicalendar::week / ExecMethod
Session halted.
</pre>
Verificar se a query pode ser melhorada: (exemplo)
<pre>
SELECT DISTINCT phpgw_cal.cal_id, phpgw_cal.datetime,phpgw_cal.edatetime,phpgw_cal.priority FROM phpgw_cal
JOIN
(
SELECT DISTINCT cal_id FROM
( SELECT DISTINCT phpgw_cal.cal_id FROM phpgw_cal WHERE phpgw_cal.owner = 265
UNION ALL SELECT DISTINCT phpgw_cal_user.cal_id FROM phpgw_cal_user WHERE phpgw_cal_user.cal_login = 265 ) AS sub1
)
AS sub2 ON sub2.cal_id = phpgw_cal.cal_id
WHERE
(
(
( phpgw_cal.datetime BETWEEN 1652065200 AND 1652756399 ) OR
( phpgw_cal.edatetime BETWEEN 1652065200 AND 1652756399 )
) OR
(
( phpgw_cal.datetime BETWEEN 0 AND 1652065200 ) AND
( phpgw_cal.edatetime BETWEEN 1652065200 AND 1684292399 )
) OR
(
( phpgw_cal.edatetime BETWEEN 1652756399 AND 1684292399 ) AND
( phpgw_cal.datetime BETWEEN 0 AND 1652756399 )
)
)
ORDER BY phpgw_cal.datetime ASC, phpgw_cal.edatetime ASC, phpgw_cal.priority ASC
</pre>