Native Spatial In SQL Server 2016

The CSS SQL Server Engineers team points out that spatial types will be a lot faster in the upcoming version of SQL Server:

The SQL Server development team was able to remove the PInvoke and PUnInvoke activities during T-SQL execution for many of the spatial methods.   A critical aspect of the change is that the change is fully compatible across the server and client scenarios. 

The same source code is used to build the managed C++ implementation and the unmanaged C++ implementation.   At the risk of understating this work the C++  managed code can be compiled with the C++ /CLI compiler, creating the managed assembly and a few, cleaver templates and macros bridge the native variations allowing C++ native compilation.  Any change to the code is made in one source file and built in two different ways.

They also have a couple of demos and point out that if you’re using a spatial index appropriately, the performance benefit from switching to 2016 is upwards of 3x.  A 3x performance improvement with no code changes is nothing to sneeze at.

Related Posts

SQL Server And Polygons

Bert Wagner shows that SQL Server interprets polygon definitions a bit differently from GeoJSON: Discerning eyes might notice that SQL Server didn’t shade in the area inside of the polygon — it instead shaded in everything in the world EXCEPT for the interior of our polygon. If this is the first time you’ve encountered this behavior then […]

Read More

Spheres In SQL Server

Slava Murygin continues his quest to build a graphics engine with spatial data: Couple of years ago I came up with an algorithm of drawing an ellipse using SQL Server spatial geometry: I’ve used that algorithm to make a sphere and as in my previous blog of drawing 3D Cube I use external procedure to simplify the […]

Read More


March 2016
« Feb Apr »