<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">
Regina,</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">
Thank you for the suggestion.</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">
Using LATERAL makes the query easier to read but it does not appear to have any performance gain.</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif; font-size: 12pt;">
<br>
</div>
<hr tabindex="-1" style="width: 98%; display: inline-block;">
<div id="divRplyFwdMsg" dir="ltr"><font color="#000000" face="Calibri, sans-serif" style="font-size: 11pt;"><b>Fra:</b> Regina Obe <lr@pcorp.us><br>
<b>Sendt:</b> 8. mai 2018 14:45<br>
<b>Til:</b> 'Lars'; pgpointcloud@lists.osgeo.org<br>
<b>Emne:</b> RE: [pgpointcloud] PC_Get array of dimensions</font>
<div> </div>
</div>
<meta content="text/html; charset=us-ascii">
<meta name="x_Generator" content="Microsoft Word 15 (filtered medium)">
<style>
<!--
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif}
a:x_link, span.x_MsoHyperlink
        {color:#0563C1;
        text-decoration:underline}
a:x_visited, span.x_MsoHyperlinkFollowed
        {color:#954F72;
        text-decoration:underline}
p
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif}
span.x_EmailStyle18
        {font-family:"Calibri",sans-serif;
        color:#1F497D}
.x_MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
div.x_WordSection1
        {}
-->
</style>
<div lang="EN-US" vlink="#954F72" link="#0563C1">
<div class="x_WordSection1">
<p class="x_MsoNormal" style="margin: 0in 0in 0pt; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">Lars,</span></p>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span></p>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">Have you tried using LATERAL for this.  This seems like an example just dying for that to be used.</span></p>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span></p>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;">For example</span></p>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span></p>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">SELECT  PC_Get(pae, 'X') AS X, PC_Get(pae, 'Y') AS Y, PC_GET(pae, 'Z') As Z </span></p>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">FROM import , LATERAL PC_Explode(import.pa) AS pae</span></p>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">WHERE PC_Intersects(...);</span></p>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span></p>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span></p>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: rgb(31, 73, 125); font-family: "Calibri",sans-serif; font-size: 11pt;"> </span></p>
<div>
<div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(225, 225, 225) currentColor currentColor; padding: 3pt 0in 0in; border-image: none;">
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<b><span style="font-family: "Calibri",sans-serif; font-size: 11pt;">From:</span></b><span style="font-family: "Calibri",sans-serif; font-size: 11pt;"> pgpointcloud [mailto:pgpointcloud-bounces@lists.osgeo.org]
<b>On Behalf Of </b>Lars<br>
<b>Sent:</b> Tuesday, May 08, 2018 5:32 AM<br>
<b>To:</b> pgpointcloud@lists.osgeo.org<br>
<b>Subject:</b> [pgpointcloud] PC_Get array of dimensions</span></p>
</div>
</div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
 </p>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">Hello,</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">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></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">The suggested function would make the query more compact and easier to read. Could it also improve performance?
</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">A simple query without PC_Get/PC_Explode takes 1 ms.</span></p>
</div>
<div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">select id from import where PC_Intersects(...);</span></p>
</div>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">Updating the test to include X value and the time increases to 21 ms.</span></p>
</div>
<div>
<div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">select PC_Get(PC_Explode(pa), 'X') from import where PC_Intersects(...);</span></p>
</div>
</div>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">Updating the test to include X and Y and it takes 34ms.</span></p>
</div>
<div>
<div>
<div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">select PC_Get(PC_Explode(pa), 'X'), PC_Get(PC_Explode(pa), 'Y')  from import where PC_Intersects(...);</span></p>
</div>
</div>
</div>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;"> </span></p>
</div>
<div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">Updating the test to include X,Y and Z and it takes 46ms.</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">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></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">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></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;"> </span></p>
</div>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">Using Windows 7, PostgresSQL 10.3 and PostGIS 2.4.4</span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;"> </span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin: 0in 0in 0pt 0.5in; font-family: "Times New Roman",serif; font-size: 12pt;">
<span style="color: black; font-family: "Calibri",sans-serif;">kind regards, Lars</span></p>
</div>
</div>
</div>
</body>
</html>