Re: Looping through string constants - Mailing list pgsql-general

From Sam Mason
Subject Re: Looping through string constants
Date
Msg-id 20090813103338.GA5407@samason.me.uk
Whole thread Raw
In response to Re: Looping through string constants  (Scott Bailey <artacus@comcast.net>)
Responses Re: Looping through string constants  (Scott Bailey <artacus@comcast.net>)
List pgsql-general
On Wed, Aug 12, 2009 at 08:45:58PM -0700, Scott Bailey wrote:
> CREATE OR REPLACE FUNCTION unnest(anyarray)
>   RETURNS SETOF anyelement AS
> $BODY$
> SELECT $1[i] FROM
>     generate_series(array_lower($1,1),
>                     array_upper($1,1)) i;
> $BODY$
>   LANGUAGE 'sql' IMMUTABLE STRICT

I'd recommend taking off the "STRICT" from this.  It will, counter
intuitively, slow things down when you're not expecting it.

--
  Sam  http://samason.me.uk/

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: totally different plan when using partitions
Next
From: Sim Zacks
Date:
Subject: multiple paramters in aggregate function