<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.xmsonormal, li.xmsonormal, div.xmsonormal
        {mso-style-name:x_msonormal;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.xmsochpdefault, li.xmsochpdefault, div.xmsochpdefault
        {mso-style-name:x_msochpdefault;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Times New Roman",serif;}
span.xemailstyle18
        {mso-style-name:x_emailstyle18;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>That's surprising.  It should have had a significant performance gain  though it's possible the PostgreSQL 10 rewrote your original so it ends up following the lateral construct.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>I think older versions just end up calling PC_Explode multiple times.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>What does your final query look like?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Lars [mailto:laasunde@hotmail.com] <br><b>Sent:</b> Wednesday, May 09, 2018 2:19 AM<br><b>To:</b> Regina Obe <lr@pcorp.us>; pgpointcloud@lists.osgeo.org<br><b>Subject:</b> Sv: [pgpointcloud] PC_Get array of dimensions<o:p></o:p></span></p></div></div><p class=MsoNormal style='margin-left:.5in'><o:p> </o:p></p><div><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Calibri",sans-serif;color:black'>Regina,<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Calibri",sans-serif;color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Calibri",sans-serif;color:black'>Thank you for the suggestion.<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Calibri",sans-serif;color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Calibri",sans-serif;color:black'>Using LATERAL makes the query easier to read but it does not appear to have any performance gain.<o:p></o:p></span></p></div><div><p class=MsoNormal style='margin-left:.5in'><span style='font-family:"Calibri",sans-serif;color:black'><o:p> </o:p></span></p></div><div class=MsoNormal align=center style='margin-left:.5in;text-align:center'><hr size=3 width="98%" align=center></div><div id=divRplyFwdMsg><p class=MsoNormal style='margin-left:.5in'><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:black'>Fra:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:black'> Regina Obe <<a href="mailto:lr@pcorp.us">lr@pcorp.us</a>><br><b>Sendt:</b> 8. mai 2018 14:45<br><b>Til:</b> 'Lars'; <a href="mailto:pgpointcloud@lists.osgeo.org">pgpointcloud@lists.osgeo.org</a><br><b>Emne:</b> RE: [pgpointcloud] PC_Get array of dimensions</span> <o:p></o:p></p><div><p class=MsoNormal style='margin-left:.5in'> <o:p></o:p></p></div></div><div><div><p class=xmsonormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Lars,</span><o:p></o:p></p><p class=xmsonormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=xmsonormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Have you tried using LATERAL for this.  This seems like an example just dying for that to be used.</span><o:p></o:p></p><p class=xmsonormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=xmsonormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>For example</span><o:p></o:p></p><p class=xmsonormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>SELECT  PC_Get(pae, 'X') AS X, PC_Get(pae, 'Y') AS Y, PC_GET(pae, 'Z') As Z </span><o:p></o:p></p><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>FROM import , LATERAL PC_Explode(import.pa) AS pae</span><o:p></o:p></p><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>WHERE PC_Intersects(...);</span><o:p></o:p></p><p class=xmsonormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=xmsonormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=xmsonormal style='margin-left:.5in'><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:currentColor currentColor;border-image: none'><p class=xmsonormal style='margin-left:1.0in'><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> pgpointcloud [<a href="mailto:pgpointcloud-bounces@lists.osgeo.org">mailto:pgpointcloud-bounces@lists.osgeo.org</a>] <b>On Behalf Of </b>Lars<br><b>Sent:</b> Tuesday, May 08, 2018 5:32 AM<br><b>To:</b> <a href="mailto:pgpointcloud@lists.osgeo.org">pgpointcloud@lists.osgeo.org</a><br><b>Subject:</b> [pgpointcloud] PC_Get array of dimensions</span><o:p></o:p></p></div></div><p class=xmsonormal style='margin-left:1.0in'> <o:p></o:p></p><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>Hello,</span><o:p></o:p></p></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'> </span><o:p></o:p></p></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>Does pgpointcloud have any plans to add a generic PC_Get function that accepts an array of input names? There was a discussion on the subject a while back but cannot see any new function. <a href="http://lists.osgeo.org/pipermail/pdal/2014-November/000429.html">http://lists.osgeo.org/pipermail/pdal/2014-November/000429.html</a></span><o:p></o:p></p></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'> </span><o:p></o:p></p></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>The suggested function would make the query more compact and easier to read. Could it also improve performance? </span><o:p></o:p></p></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'> </span><o:p></o:p></p></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>A simple query without PC_Get/PC_Explode takes 1 ms.</span><o:p></o:p></p></div><div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>select id from import where PC_Intersects(...);</span><o:p></o:p></p></div></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'> </span><o:p></o:p></p></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>Updating the test to include X value and the time increases to 21 ms.</span><o:p></o:p></p></div><div><div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>select PC_Get(PC_Explode(pa), 'X') from import where PC_Intersects(...);</span><o:p></o:p></p></div></div></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'> </span><o:p></o:p></p></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>Updating the test to include X and Y and it takes 34ms.</span><o:p></o:p></p></div><div><div><div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>select PC_Get(PC_Explode(pa), 'X'), PC_Get(PC_Explode(pa), 'Y')  from import where PC_Intersects(...);</span><o:p></o:p></p></div></div></div></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'> </span><o:p></o:p></p></div><div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>Updating the test to include X,Y and Z and it takes 46ms.</span><o:p></o:p></p></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>select PC_Get(PC_Explode(pa), 'X'), PC_Get(PC_Explode(pa), 'Y'), PC_Get(PC_Explode(pa), 'Z')  from import where PC_Intersects(...);</span><o:p></o:p></p></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'> </span><o:p></o:p></p></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>It appear that for each dimension added the time increase quiet a bit. This is obviously a very simple test but just wanted to get a feedback.</span><o:p></o:p></p></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'> </span><o:p></o:p></p></div></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>Using Windows 7, PostgresSQL 10.3 and PostGIS 2.4.4</span><o:p></o:p></p></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'> </span><o:p></o:p></p></div><div><p class=xmsonormal style='margin-left:1.0in'><span style='font-family:"Calibri",sans-serif;color:black'>kind regards, Lars</span><o:p></o:p></p></div></div></div></div></body></html>