SELECT on view runs slower with more WHERE conditions - Mailing list pgsql-sql

From aditya desai
Subject SELECT on view runs slower with more WHERE conditions
Date
Msg-id CAN0SRDE8UgmDVd1CT40wR_m3tx0xqWHnQ74NYnFZA4d1S=Ob0A@mail.gmail.com
Whole thread Raw
List 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 by date:

Previous
From: chris
Date:
Subject: Re: Constructing colum name as alias
Next
From: Shaozhong SHI
Date:
Subject: Re: Fault with initcap