All Products
Search
Document Center

Lindorm:Terms

Last Updated:Oct 17, 2024

Trajectory storage models

The following major storage models are used when the spatiotemporal points collected based on moving objects are stored in databases.

  • Point model: defines each attribute field. Each trajectory point is a record.

    image

  • Line model for trajectories: Each entire trajectory is a record.

  • Line model for trajectory objects: Each entire trajectory is split into multiple trajectory objects. In this case, each trajectory object is a record.

    image

In the preceding figure, seg_start_time specifies the start time of the trajectory object. If the trajectory is not split, the value of the seg_start_time attribute is the same as the value of the traj_start_time attribute. The seg_index attribute specifies the sequential number of the trajectory object in the entire trajectory. If the trajectory is not split, the value of the seg_index attribute is -1.

Advantages, disadvantages, and scenarios

  • Among the preceding three models, the point model provides optimal performance for real-time index-based queries, but this model incurs the highest costs for storage and secondary indexes. This way, the point model is suitable for simple queries that have high requirements for real-time performance.

  • The line model for trajectories provides low query performance based on spatiotemporal indexes, but this model incurs low costs for storage cost and secondary indexes. This way, the line model is suitable for offline analytical scenarios.

  • Compared with the line model for trajectories, the line model for trajectory objects provides higher query performance and incurs lower costs for storage and secondary indexes. This way, you can store trajectory data at a lower cost and perform real-time and complex queries and analysis. The line model for trajectory objects is suitable for scenarios that require real-time queries and offline analysis.

Lindorm GanosBase supports the three storage models. You can write multiple trajectory points in the point model in a batch, or build a line model for trajectories or trajectory objects to store data. You can select a model based on business requirements. For the line model for trajectory objects, GanosBase provides four policies based on distance difference, angle difference, time intervals, and the number of trajectory points. If you use the line model for trajectories or trajectory points, you cannot append or update data points.

Trajectory indexes

GanosBase supports XZ2T indexes and OTS indexes for trajectory storage models. For information about common spatiotemporal indexes, see Create index tables.

  • XZ2T index: uses the time-bin encoding and XZ2 index. The XZ2T index is suitable for line models for trajectories and trajectory objects. The XZ2T index provides higher query performance than the XZ3 index.

  • OTS index: contains the ID of each moving object, the start time of the trajectory, and the sequential number of each trajectory object. When the line model for trajectory objects is used, the OTS index is applicable if you want to return the query result based on the entire trajectory.

Storage of trajectory-based secondary indexes

You can use GanosBase to create secondary indexes for spatiotemporal geometry schemas. For different trajectory storage models, GanosBase provides new index types for trajectories and uses spatiotemporal secondary indexes. For more information, see Create index tables. Secondary indexes can help you reduce storage costs and make queries efficient. We recommend that you do not build more than two secondary indexes.