From 53a555a8a897ad3139be7942dfdfd83e33e1a4da Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Mon, 27 Apr 2015 17:29:55 +0000 Subject: [PATCH] #3103 Get rid of casting of table, schema, and column name. though oddly find_srid did not seem to be slowed down by this -- need to investigate (might be the immutable strict) git-svn-id: http://svn.osgeo.org/postgis/trunk@13453 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/postgis.sql.in | 9 ++++----- postgis/postgis_drop_before.sql | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index cd6c7e885..ee791ef48 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -4991,13 +4991,12 @@ LANGUAGE 'sql' STABLE STRICT; -- Availability: 2.0.0 -- Changed: 2.1.8 significant performance improvement for constraint based columns +-- Changed: 2.2.0 get rid of scheman, table, column cast to improve performance CREATE OR REPLACE VIEW geometry_columns AS SELECT current_database()::character varying(256) AS f_table_catalog, --- TODO: consider getting rid of CASTING it slows things down by 2 to 6 fold for table/column exact matches. --- Geography doesn't have casting by the way - n.nspname::varchar(256) AS f_table_schema, - c.relname::varchar(256) AS f_table_name, - a.attname::varchar(256) AS f_geometry_column, + n.nspname AS f_table_schema, + c.relname AS f_table_name, + a.attname AS f_geometry_column, COALESCE(postgis_typmod_dims(a.atttypmod), sn.ndims, 2) AS coord_dimension, COALESCE(NULLIF(postgis_typmod_srid(a.atttypmod), 0), sr.srid, 0) AS srid, replace(replace(COALESCE(NULLIF(upper(postgis_typmod_type(a.atttypmod)), 'GEOMETRY'::text), st.type, 'GEOMETRY'::text), 'ZM'::text, ''::text), 'Z'::text, ''::text)::character varying(30) AS type diff --git a/postgis/postgis_drop_before.sql b/postgis/postgis_drop_before.sql index 2ddc9f1cf..dbaf912a0 100644 --- a/postgis/postgis_drop_before.sql +++ b/postgis/postgis_drop_before.sql @@ -65,3 +65,5 @@ $$ ; DROP FUNCTION IF EXISTS ST_AsTWKB(geometry,int4); DROP FUNCTION IF EXISTS ST_AsTWKB(geometry,int4,int8); DROP FUNCTION IF EXISTS ST_AsTWKB(geometry,int4,int8,boolean); + +DROP VIEW geometry_columns; -- removed cast 2.2.0 so need to recreate -- 2.40.0