Project

General

Profile

« Previous | Next » 

Revision 10356

schemas/util.sql: added hstore(text[], anyelement), which dynamically inlines properly, unlike hstore(anyarray, anyelement). this can be selected by explicitly casting the keys array to text[], which now provides a 6x speed improvement (380 ms -> 60 ms) for map_nulls().

View differences:

util.sql
1052 1052
CREATE FUNCTION hstore(keys anyarray, value anyelement) RETURNS hstore
1053 1053
    LANGUAGE sql IMMUTABLE
1054 1054
    AS $_$
1055
SELECT util.hstore($1::text[], $2::text)
1055
SELECT util.hstore($1::text[], $2)
1056 1056
$_$;
1057 1057

  
1058 1058

  
......
1064 1064

  
1065 1065

  
1066 1066
--
1067
-- Name: hstore(text[], anyelement); Type: FUNCTION; Schema: util; Owner: -
1068
--
1069

  
1070
CREATE FUNCTION hstore(keys text[], value anyelement) RETURNS hstore
1071
    LANGUAGE sql IMMUTABLE
1072
    AS $_$
1073
SELECT util.hstore($1, $2::text)
1074
$_$;
1075

  
1076

  
1077
--
1078
-- Name: FUNCTION hstore(keys text[], value anyelement); Type: COMMENT; Schema: util; Owner: -
1079
--
1080

  
1081
COMMENT ON FUNCTION hstore(keys text[], value anyelement) IS 'avoids repeating the same value for each key';
1082

  
1083

  
1084
--
1067 1085
-- Name: is_constant(col_ref); Type: FUNCTION; Schema: util; Owner: -
1068 1086
--
1069 1087

  

Also available in: Unified diff