Monday, January 27. 2014Writing PostGIS raster Map Algebra Callback Functions in PLV8Printer FriendlyRecommended Books: PostGIS Cookbook PostgreSQL: Up and Running PostGIS in Action (2nd edition)
Trackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
Good to know. I wonder if PL/Pythonu will match Javascript's performance?
I was thinking about that myself but haven't had a chance to test PL/Python in that regard. My gut feeling says it will be slower just because I think the V8 engine is less of a load than the Python environment.
Besides PL/V8 you can create window functions which you can't in PL/Python :)
One thought I have had is to rewrite the provided callback functions in C. Having said that, it's awesome that the are easy performance improvements... 52 to 18 seconds just by using a different PL language.
I was going to investigate the ST_Range4MA function. I had started creating a simplified since I didn't need the userargs piece. While that was not quite as fast as the SQL one. It was within 1-2 second. So I'm thinking we maybe don't want to do that user args check in each loop maybe check if it needs to be done and take a simpler route if no userargs is passed in.
So a lot of the gain was my simplication. I suspect copying the array in the beginning adds a lot of overhead.
Just tried creating a quick map algebra call back function in plpython3 in PostgreSQL 9.3. Unfortunately it seems like a no go.
When it comes in even if the body of the function does nothing, it tries to cast the multi-dimensional to a list which fails. Returning with error: ERROR: cannot convert multidimensional array to Python list DETAIL: PL/Python only supports one-dimensional arrays. |
Entry's LinksQuicksearchCalendar
Categories
Blog Administration |