Re: [PERFORM] Slow CTE Query

2013-05-18 Thread Sergey Konoplev
On Sat, May 18, 2013 at 12:54 PM, Stefan Keller wrote: > I'm experiencing a very slow CTE query (see below). > > When I split the three aggregations into three separate views, its' decent > fast. So I think it's due to the planner. > > Any ideas like reformulating the query? Rewrite it without CT

[PERFORM] Slow CTE Query

2013-05-18 Thread Stefan Keller
Hi, I'm experiencing a very slow CTE query (see below). When I split the three aggregations into three separate views, its' decent fast. So I think it's due to the planner. Any ideas like reformulating the query? These are the tables and views involved: * Table promotion with start/end date and