Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLngB-0007uN-Ay for pgsql-sql@postgresql.org; Wed, 10 Oct 2012 04:13:55 +0000 Received: from plane.gmane.org ([80.91.229.3]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLng7-0006ap-Ly for pgsql-sql@postgresql.org; Wed, 10 Oct 2012 04:13:54 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TLngB-0000Sw-7x for pgsql-sql@postgresql.org; Wed, 10 Oct 2012 06:13:55 +0200 Received: from ip-118-90-102-36.xdsl.xnet.co.nz ([118.90.102.36]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 10 Oct 2012 06:13:55 +0200 Received: from jasen by ip-118-90-102-36.xdsl.xnet.co.nz with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 10 Oct 2012 06:13:55 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Jasen Betts Subject: Re: Calling the CTE for multiple inputs Date: 7 Oct 2012 01:02:46 GMT Organization: Dis (not Dat) Organisation Lines: 15 Message-ID: References: <1349379109760-5726661.post@n5.nabble.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip-118-90-102-36.xdsl.xnet.co.nz X-Face: ?)Aw4rXwN5u0~$nqKj`xPz>xHCwgi^q+^?Ri*+R(&uv2=E1Q0Zk(>h!~o2ID@6{uf8s; a +M[5[U[QT7xFN%^gR"=tuJw%TXXR'Fp~W; (T"1(739R%m0Yyyv*gkGoPA.$b,D.w:z+<'"=-lVT?6 {T?=R^:W5g|E2#EhjKCa+nt":4b}dU7GYB*HBxn&Td$@f%.kl^:7X8rQWd[NTc"P"u6nkisze/Q; 8 "9Z{peQF,w)7UjV$c|RO/mQW/NMgWfr5*$-Z%u46"/00mx-,\R'fLPe.)^ User-Agent: slrn/pre1.0.0-18 (Linux) X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201210/36 X-Sequence-Number: 36907 On 2012-10-04, air wrote: > I have a CTE that takes top left and bottom right latitude/longitude values > along with a start and end date and it then calculates the amount of user > requests that came from those coordinates per hourly intervals between the > given start and end date. However, I want to execute this query for about > 2600 seperate 4-tuples of lat/lon corner values instead of typing them in > one-by-one. How would I do that? The code is as below: I see that your're using the CTE only to fill-in the nulls in main query group-by is it the same plan for the coordinates (non-overlapping ranges)? how are your coordinates respresented? -- ⚂⚃ 100% natural