[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-sql
Subject:    Re: [SQL] How to unnest an array with element indexes
From:       Pavel Stehule <pavel.stehule () gmail ! com>
Date:       2014-02-20 4:17:05
Message-ID: CAFj8pRBB90SYpxWY-sLxciODHD-NoPV=uRJch-qmNFxcSLi+2w () mail ! gmail ! com
[Download RAW message or body]

2014-02-19 21:55 GMT+01:00 AlexK <alkuzo@gmail.com>:

> Pavel,
> 
> This works for me, thank you!
> 
> Presumably foreach is guaranteed to iterate array elements in order: "The
> elements are visited in storage order, regardless of the number of array
> dimensions", quoted from this:
> 
> http://www.postgresql.org/docs/9.2/static/plpgsql-control-structures.html
> 
> Since parallelism is coming up, will this behavior stay as documented? My
> arrays are as big as 20K-30K elements, maybe more.
> 

I cannot to say, what will be in next years - but it is less probable --
plans for parallelism are related for SQL executor internals - like
parallel sort - or parallel hashing.

we have no plans do plpgsql parallel - now works well - and it is relative
simple to maintain it.

Regards

Pavel



> 
> 
> 
> --
> View this message in context:
> http://postgresql.1045698.n5.nabble.com/How-to-unnest-an-array-with-element-indexes-tp5792770p5792787.html
>  Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
> 
> 
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
> 


[Attachment #3 (text/html)]

<div dir="ltr"><br><div class="gmail_extra"><br><br><div \
class="gmail_quote">2014-02-19 21:55 GMT+01:00 AlexK <span dir="ltr">&lt;<a \
href="mailto:alkuzo@gmail.com" \
target="_blank">alkuzo@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Pavel,<br>
<br>
This works for me, thank you!<br>
<br>
Presumably foreach is guaranteed to iterate array elements in order: &quot;The<br>
elements are visited in storage order, regardless of the number of array<br>
dimensions&quot;, quoted from this:<br>
<br>
<a href="http://www.postgresql.org/docs/9.2/static/plpgsql-control-structures.html" \
target="_blank">http://www.postgresql.org/docs/9.2/static/plpgsql-control-structures.html</a><br>
 <br>
Since parallelism is coming up, will this behavior stay as documented? My<br>
arrays are as big as 20K-30K elements, maybe \
more.<br></blockquote><div><br></div><div>I cannot to say, what will be in next years \
- but it is less probable -- plans for parallelism are related for SQL executor \
internals - like parallel sort - or parallel hashing.<br>

<br></div><div>we have no plans do plpgsql parallel - now works well - and it is \
relative simple to maintain it. \
<br><br></div><div>Regards<br><br></div><div>Pavel<br><br></div><div>  \
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">


<br>
<br>
<br>
--<br>
View this message in context: <a \
href="http://postgresql.1045698.n5.nabble.com/How-to-unnest-an-array-with-element-indexes-tp5792770p5792787.html" \
target="_blank">http://postgresql.1045698.n5.nabble.com/How-to-unnest-an-array-with-element-indexes-tp5792770p5792787.html</a><br>



<div class="HOEnZb"><div class="h5">Sent from the PostgreSQL - sql mailing list \
archive at Nabble.com.<br> <br>
<br>
--<br>
Sent via pgsql-sql mailing list (<a \
href="mailto:pgsql-sql@postgresql.org">pgsql-sql@postgresql.org</a>)<br> To make \
changes to your subscription:<br> <a \
href="http://www.postgresql.org/mailpref/pgsql-sql" \
target="_blank">http://www.postgresql.org/mailpref/pgsql-sql</a><br> \
</div></div></blockquote></div><br></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic