Filter postgis function on connect
Created by: zacbarton
I've got a database that has postgis enabled and connecting takes seconds in-which massive is proxying the 1000+ postgis functions.
It would be great if setting these functions up was avoided either by convention or as a connect option. Actually an option to skip the loadFunctions all together would be handy in some cases.
I managed to reduce the functions.sql queries results from 1081 rows (4500ms) to 43 rows (185ms). I've added what I was playing with in-case its handy?
AND routines.routine_name NOT LIKE 'st_%'
AND routines.routine_name NOT LIKE 'box%d%'
AND routines.routine_name NOT LIKE '_st_%'
AND routines.routine_name NOT LIKE 'geography%'
AND routines.routine_name NOT LIKE 'geometry%'
AND routines.routine_name NOT LIKE 'pgis%'
AND routines.routine_name NOT LIKE 'postgis%'
AND routines.routine_name NOT LIKE '_postgis%'
AND routines.routine_name NOT LIKE 'raster%'
AND routines.routine_name NOT LIKE '_raster%'
AND routines.routine_name NOT IN ('addgeometrycolumn', 'dropgeometrytable', 'updategeometrysrid', 'addrasterconstraints', 'droprasterconstraints', 'updaterastersrid', 'addoverviewconstraints', 'dropoverviewconstraints', 'populate_geometry_columns', 'dropgeometrycolumn', 'populate_geometry_columns', '_updaterastersrid')
AND routines.routine_name NOT LIKE '_add_raster%'
AND routines.routine_name NOT LIKE '_drop_raster%'
AND routines.routine_name NOT LIKE 'geomfrom%'
AND routines.routine_name NOT LIKE 'gidx_%'
AND routines.routine_name NOT LIKE 'spheroid_%'
AND routines.routine_name NOT LIKE 'gserialized_gist_%'
-- order by routine_name -- is this needed?