[pgpointcloud] PC_Get array of dimensions

Lars laasunde at hotmail.com
Wed May 9 04:17:44 PDT 2018


Eric,

That is interesting.

Viewing the pgpointcloud source code it looks like the method pcpoint_get_value (pc_access.c line 66) implement the PC_Get function. It appears this method will deserialize the patch data for each invocation via the pc_point_deserialize method. Deserializing a patch might be an "expensive" operation.

________________________________
Fra: Éric Lemoine <eric.lemoine at oslandia.com>
Sendt: 9. mai 2018 12:41
Til: Regina Obe; 'Lars'; pgpointcloud at lists.osgeo.org
Emne: Re: [pgpointcloud] PC_Get array of dimensions

On Wed, 2018-05-09 at 04:22 -0400, Regina Obe wrote:
> 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.
> I think older versions just end up calling PC_Explode multiple times.


It looks like there is a significant per-PC_Get cost:

lopocs=# /timing
lopocs=# select pc_get(pae, 'x') from (select pc_explode(points) pae
from inrap limit 100000) t;
Time: 225.342 ms
lopocs=# select pc_get(pae, 'x'), pc_get(pae, 'y') from (select
pc_explode(points) pae from inrap limit 100000) t;
Time: 331.342 ms
lopocs=# select pc_get(pae, 'x'), pc_get(pae, 'y'), pc_get(pae, 'z')
from (select pc_explode(points) pae from inrap limit 100000) t;
Time: 426.759 ms
lopocs=# select pc_get(pae, 'x'), pc_get(pae, 'y'), pc_get(pae, 'z'),
pc_get(pae, 'NumberOfReturns'), pc_get(pae, 'Classification'),
pc_get(pae, 'UserData'), pc_get(pae, 'PointSourceId'), pc_get(pae,
'Green'), pc_get(pae, 'Red'), pc_get(pae, 'Blue'), pc_get(pae,
'GpsTime') from (select pc_explode(points) pae from inrap limit 100000)
t;
Time: 926.485 ms

I use Postgres 9.6.5 in these tests.


--
Éric Lemoine
Oslandia
+33 1 86 95 95 55
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgpointcloud/attachments/20180509/5c014fa0/attachment.html>


More information about the pgpointcloud mailing list