agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: David Johnston <polobo@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: how to effectively SELECT new "customers"
Date: Fri, 28 Feb 2014 07:39:38 -0800 (PST)
Message-ID: <1393601978985-5794056.post@n5.nabble.com> (raw)
In-Reply-To: <976203811.595346.1393587926835.JavaMail.root@mobiletech.sk>
References: <1001132708.567696.1393510818245.JavaMail.root@mobiletech.sk>
	<1393513774376-5793882.post@n5.nabble.com>
	<976203811.595346.1393587926835.JavaMail.root@mobiletech.sk>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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.ht...
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



view thread (10+ messages)  latest in thread

Message-ID: <1393601978985-5794056.post@n5.nabble.com>
Permalink:  ../1393601978985-5794056.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1393601978985-5794056.post@n5.nabble.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: polobo@yahoo.com
  Subject: Re: how to effectively SELECT new "customers"
  In-Reply-To: <1393601978985-5794056.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox