Re: [PERFORM] Performance problem with joined aggregate query

2010-09-16 Thread Merlin Moncure
On Thu, Sep 16, 2010 at 1:51 AM, Anssi Kääriäinen wrote: > Yes, looks like this is the same case. This makes it hard to use views > having group by in them, as the whole group by part will always be > executed. Back to planning board then... > > I guess my possibilities for pivot views are: >  - c

Re: [PERFORM] Performance problem with joined aggregate query

2010-09-16 Thread Anssi Kääriäinen
On 09/16/2010 01:25 AM, Merlin Moncure wrote: Take a look at this, and the responses. Is it the same case?: http://www.mail-archive.com/pgsql-performance@postgresql.org/msg21756.html merlin Yes, looks like this is the same case. This makes it hard to use views having group by in them, as th

Re: [PERFORM] Performance problem with joined aggregate query

2010-09-15 Thread Merlin Moncure
On Wed, Sep 15, 2010 at 2:26 AM, Anssi Kääriäinen wrote: > Hello all, > > I am trying to use aggregate queries in views, and when joining these views > to other > tables, I get seq scan in the view, even if index scan would be clearly > better. The views > I am using in my Db are actually long piv

[PERFORM] Performance problem with joined aggregate query

2010-09-15 Thread Anssi Kääriäinen
Hello all, I am trying to use aggregate queries in views, and when joining these views to other tables, I get seq scan in the view, even if index scan would be clearly better. The views I am using in my Db are actually long pivot queries, but the following simple test case is enough to show t