Re: how to effectively SELECT new "customers" - Mailing list pgsql-sql

From David Johnston
Subject Re: how to effectively SELECT new "customers"
Date
Msg-id 1393601978985-5794056.post@n5.nabble.com
Whole thread Raw
In response to Re: how to effectively SELECT new "customers"  (Jan Ostrochovsky <ostrochovsky@mobiletech.sk>)
Responses Re: how to effectively SELECT new "customers"
List pgsql-sql
Jan Ostrochovsky wrote
> materialized view could be part of that solution, when we will have the
> right query and uprgade from 9.0 to 9.3 (as I see it:
> http://www.postgresql.org/docs/9.3/static/rules-materializedviews.html)... 

9.3 adds materialized views syntax and functionality directly into
PostgreSQL but you can "roll your own" in any version and that is what I
would suggest.

I would probably focus on getting a single reporting period to execute
performantly and just use a loop to build up the materialized view
period-by-period.

I don't know how you want to go about dealing with your payment channel
since it depends on whether a customer can make use of more than one and
whether their "new-ness" is impacted by such.

Incorporating other data is as simple as building the different pieces and
joining them together into a final output; usually through a series of
CTEs/WITH sub-queries.

David J.





--
View this message in context:
http://postgresql.1045698.n5.nabble.com/how-to-effectively-SELECT-new-customers-tp5793867p5794056.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



pgsql-sql by date:

Previous
From: ALMA TAHIR
Date:
Subject: Re: Function Issue
Next
From: Jan Ostrochovsky
Date:
Subject: Re: how to effectively SELECT new "customers"