]> granicus.if.org Git - postgis/commitdiff
ST_IsEmpty: Speed up by avoiding deserialization
authorRaúl Marín Rodríguez <rmrodriguez@carto.com>
Mon, 15 Jul 2019 10:13:23 +0000 (10:13 +0000)
committerRaúl Marín Rodríguez <rmrodriguez@carto.com>
Mon, 15 Jul 2019 10:13:23 +0000 (10:13 +0000)
Closes #4453
Closes https://github.com/postgis/postgis/pull/442

git-svn-id: http://svn.osgeo.org/postgis/trunk@17603 b70326c6-7e19-0410-871a-916f4a2858ee

NEWS
postgis/lwgeom_functions_basic.c

diff --git a/NEWS b/NEWS
index 2dedf9588a1a19ec2e094d133d078425080c4742..207bab2a3204c77c37c66a9425cc105211007a5c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Additional features enabled if you are running Proj6+ and PostgreSQL 12
   - #4449, Speed up ST_X, ST_Y, ST_Z and ST_M (Raúl Marín)
   - #4456, add Rasbery Pi 32-bit jenkins bot for testing (Bruce Rindahl)
   - #4454, Speed up _ST_OrderingEquals (Raúl Marín)
+  - #4453, Speed up ST_IsEmpty (Raúl Marín)
 
 PostGIS 3.0.0alpha3
 2019/07/01
index 5d837678374f3747c641217e8c784227d0daf3f7..b067feec9cc2d646d73bc4dd02d4d432493fff99 100644 (file)
@@ -1797,12 +1797,7 @@ PG_FUNCTION_INFO_V1(LWGEOM_isempty);
 Datum LWGEOM_isempty(PG_FUNCTION_ARGS)
 {
        GSERIALIZED *geom = PG_GETARG_GSERIALIZED_P(0);
-       LWGEOM *lwgeom = lwgeom_from_gserialized(geom);
-       bool empty = lwgeom_is_empty(lwgeom);
-
-       lwgeom_free(lwgeom);
-       PG_FREE_IF_COPY(geom, 0);
-       PG_RETURN_BOOL(empty);
+       PG_RETURN_BOOL(gserialized_is_empty(geom));
 }
 
 /**