Re: [GENERAL] Use cases for lateral that do not involve a set returning function

2014-12-09 Thread AJ Welch
names.validfrom -> Seq Scan on names (cost=0.00..245542.94 rows=1594 width=18) -> Hash (cost=77028.00..77028.00 rows=500 width=10) -> Seq Scan on people p (cost=0.00..77028.00 rows=500 width=10) Thanks, AJ http://chartio.com/ https://www.l

Re: FW: [GENERAL] SQL rolling window without aggregation

2014-12-07 Thread AJ Welch
I believe this can be accomplished with lead() and union: http://sqlfiddle.com/#!15/521d5/7 Thanks, AJ https://www.linkedin.com/in/ajw0100 On Sun, Dec 7, 2014 at 3:13 PM, Huang, Suya wrote: > It seems like it’s not been sent to the SQL group, so I’m trying with > this group. > > > > Thanks, >

[GENERAL] Use cases for lateral that do not involve a set returning function

2014-12-06 Thread AJ Welch
I was reading this post the other day: http://blog.heapanalytics.com/postgresqls-powerful-new-join-type-lateral/ I suspected some of the claims in the post may not have been accurate. This one in particular: "Without lateral joins, we would need to resort to PL/pgSQL to do this analysis. Or, if