SELECT on view runs slower with more WHERE conditions

Поиск
Список
Период
Сортировка
От aditya desai
Тема SELECT on view runs slower with more WHERE conditions
Дата
Msg-id CAN0SRDE8UgmDVd1CT40wR_m3tx0xqWHnQ74NYnFZA4d1S=Ob0A@mail.gmail.com
обсуждение исходный текст
Список pgsql-sql
Hi,
I have a view on which we are running query with below conditions.

select *  from view_alerts
where
datetypeid=2 and
timeperiodid=2 and
alertreasonid= 2 and
(percendate < -25 or percentage > 25 )

Whenever I run query with only one WHERE condition it runs within 1 min. If I keep more than one WHERE condition in above query it hangs. Also just select * from view_alerts runs in just 1 min. Unfortunately I am unable to put explain plan.

Any suggestions here?

Regards,
Aditya.

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

Предыдущее
От: chris
Дата:
Сообщение: Re: Constructing colum name as alias
Следующее
От: Shaozhong SHI
Дата:
Сообщение: Re: Fault with initcap