I have created an alias for st_expand function like this
CREATE OR REPLACE FUNCTION expand( geom geometry, value double precision) RETURNS geometry AS $BODY$ DECLARE my_geom geometry; BEGIN my_geom = st_expand(geom,value); return my_geom; END; $BODY$ LANGUAGE plpgsql VOLATILE;
This function on running my sql query returns in 1.5s, but if I directly use st_expand function - the return is in ~ 30ms.
Do note, I have to do an alias, since RDS Postgres doesn't allow me to create expand same as st_expand since they restrict creation of functions of language C.
The time to change all our sql scripts(legacy) to call st_expand and not expand is way too long. Hence creating the alias, changing to st_expand is not an option for now.
Is there any change that I can do to ensure the time is still ~30ms and not 1.5s since there's no logic done here.