Optimizing CartoDB's JenksBins function - Mailing list pgsql-general

From Seamus Abshere
Subject Optimizing CartoDB's JenksBins function
Date
Msg-id 53287791.2000604@abshere.net
Whole thread Raw
Responses Re: Optimizing CartoDB's JenksBins function  (Joe Conway <mail@joeconway.com>)
List pgsql-general
hi,

Our friends from CartoDB [1] provide a beautiful Jenks Natural Breaks
function for Postgres [2]. It is quite computationally intensive.

Even if you don't know what Jenks is, do you see any optimizations?

Best, thanks,
Seamus

PS. I was hoping for something magical like Tom Lane's VALUES() fix for
DataDog [3] or HeapAnalytic's array fix [4], although I realize both are
fundamentally different :) This is probably a more subtle loop
optimization problem, if anything.


[1] http://cartodb.com
[2]
https://github.com/CartoDB/cartodb/blob/master/lib/sql/scripts-available/CDB_JenksBins.sql
[3]
https://www.datadoghq.com/2013/08/100x-faster-postgres-performance-by-changing-1-line/
[4]
http://blog.heapanalytics.com/dont-iterate-over-a-postgres-array-with-a-loop/


--
Seamus Abshere, SCEA
https://github.com/seamusabshere


pgsql-general by date:

Previous
From: Rich Shepard
Date:
Subject: Re: Upgrade: 9.0.5->9.3.3
Next
From: Kevin Goess
Date:
Subject: Re: pgpgout/s without swapping--what does it mean?