From 143a35f8221275cc61f7b3bfcae4a1ff6507c2dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ra=C3=BAl=20Mar=C3=ADn=20Rodr=C3=ADguez?= Date: Mon, 15 Jul 2019 10:13:23 +0000 Subject: [PATCH] ST_IsEmpty: Speed up by avoiding deserialization 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 | 1 + postgis/lwgeom_functions_basic.c | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 2dedf9588..207bab2a3 100644 --- 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 diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c index 5d8376783..b067feec9 100644 --- a/postgis/lwgeom_functions_basic.c +++ b/postgis/lwgeom_functions_basic.c @@ -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)); } /** -- 2.40.0