[Mobilitydb-users] Speed up tintersects function

Sharath S Bhargav shrthsbhargav96 at gmail.com
Sat Apr 17 22:25:18 PDT 2021


Hello,

I have a query in which I need to find the intersection of a trajectory
(tGeomPoint) with a polygon and get the sub trajectory which intersects.
So I am using

getTime(atvalue(tintersects(tt.trajectory_extracted_l0,b.b1),true))

to get the time periods during which there is an intersection.
My dataset contains about 21 million points which form about 17000
trajectories.
The full query is

WITH box(b1) AS (
SELECT ST_MakeEnvelope(116.390000,39.90,116.404655,39.9072,4326))
SELECT tt.trip_id as
id,getTime(atvalue(tintersects(tt.trajectory_extracted_l0,b.b1),true))
periods
FROM box b, trips_trajectory tt
WHERE intersects(tt.trajectory_extracted_l0, b.b1);

The above query takes about 5.5 seconds to execute on my data.
I have built indexes on the trajectory as shown in the example in
documentation and the research paper.
Is it possible to modify the query so that it can run in less time?

Thanks in advance for your help.
-- 
Regards,
Sharath
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mobilitydb-users/attachments/20210418/b0044056/attachment.html>


More information about the Mobilitydb-users mailing list