BUG #4382: there is an exagerate increase of execution times putting a 'case' condition in this update

Поиск
Список
Период
Сортировка
От Gianluca Buttarelli
Тема BUG #4382: there is an exagerate increase of execution times putting a 'case' condition in this update
Дата
Msg-id 200808271300.m7RD02jp088480@wwwmaster.postgresql.org
обсуждение исходный текст
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      4382
Logged by:          Gianluca Buttarelli
Email address:      gianluca.buttarelli@business-partner.it
PostgreSQL version: 8.1.11
Operating system:   linux
Description:        there is an exagerate increase of execution times
putting  a 'case' condition in this update
Details:

update accounts_changing set closed_sc_nowcurrent_nbr = (select count (*)
from crm_shopping_carts  ,qab_wf_states
               where  accounts_changing.account_id=crm_shopping_carts.agency_id
and  qab_wf_states.state_code in ('SC-FAT1','SC-FAT2') and
crm_shopping_carts.state_id = qab_wf_states.state_id and
               (case when ( CURRENT_DATE >  date(EXTRACT(YEAR FROM
CURRENT_DATE)||'-10-31')  and CURRENT_DATE < date(EXTRACT(YEAR FROM
CURRENT_DATE)||'-12-31'))
                then   (crm_shopping_carts.creation_date between date((EXTRACT(YEAR FROM
CURRENT_DATE))||'-11-01')  and CURRENT_DATE)
                else  (crm_shopping_carts.creation_date between date((EXTRACT(YEAR FROM
CURRENT_DATE)-1)||'-11-01')and CURRENT_DATE) end ))
                where active_indcr='1'

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Heikki Linnakangas"
Дата:
Сообщение: Re: BUG #4381: Postgresql daemon won't stay in the foreground
Следующее
От: Tom Wright
Дата:
Сообщение: Re: BUG #4381: Postgresql daemon won't stay in the foreground