Project

General

Profile

« Previous | Next » 

Revision 10355

schemas/util.sql: fix_array(): turned off STRICT to allow dynamic inlining, which speeds up util.map_nulls() by 3x (1500 ms -> 500 ms)

View differences:

schemas/util.sql
968 968
--
969 969

  
970 970
CREATE FUNCTION fix_array("array" anyarray) RETURNS anyarray
971
    LANGUAGE sql IMMUTABLE STRICT
971
    LANGUAGE sql IMMUTABLE
972 972
    AS $_$
973 973
-- STRICT handles NULLs, so that the array will always be a value
974
SELECT CASE WHEN pg_catalog.array_ndims($1) IS NULL THEN util.empty_array($1[1]) ELSE $1 END
974
SELECT CASE WHEN $1 IS NULL THEN NULL ELSE (
975
	CASE WHEN pg_catalog.array_ndims($1) IS NULL THEN util.empty_array($1[1]) ELSE $1 END
976
) END
975 977
$_$;
976 978

  
977 979

  

Also available in: Unified diff