Defeito #1145
Melhoria em query da Agenda
Início:
12/08/2022
Data prevista:
% Terminado:
0%
Descrição
Observou-se no log do Expresso que uma query da agenda eventualmente causa estouro de memória.
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.
Verificar se a query pode ser melhorada: (exemplo)
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
Histórico
#1 Atualizado por Mauricio Luiz Viani há mais de 2 anos
- Descrição atualizado(a) (diff)
- Arquivo exemplo-query-estourada-2.jpeg adicionado
#2 Atualizado por Mauricio Luiz Viani há aproximadamente 2 anos
- Versão alterado de Expresso Livre - Milestone 46 para Backlog