Unlock the Power of AI

1 million free tokens

88% Price Reduction

NaNDayNaN:NaN:NaN
Activate Now

Specify index types

Updated at: 2024-10-17 06:31

Trajectories support multiple indexing modes.

View the default indexing mode

-- Default indexing mode.
SELECT * FROM pg_opclass WHERE opcname LIKE '%traj%' AND opcdefault = true;

-- Default index parameter. This parameter is suitable for trajgist_ops_multi.
SHOW ganos.trajectory.index_split_config;

Indexing modes are divided into two types:

  • Single bounding box indexing: represents each trajectory as a single bounding box. This type of indexing requires a small number of storage resources but provides low filtering efficiency. You can use different indexing modes based on the dimensions that you want to query. For example, trajgist_2d indicates a two-dimensional index, and trajgist_3dt indicates a three-dimensional and time index.

  • Multi-bounding box indexing: divides a trajectory into multiple parts, and each part is individually represented as a single bounding box. The trajectory is represented as multiple bounding boxes. This type of indexing requires a large number of storage resources but provides high filtering efficiency. If you use this type of indexing for a spatial query, the query efficiency is improved by twice or more than the efficiency of spatial queries for which bounding boxes are not used. This type of indexing is not supported in some versions of GanosBase.

Specify an index type

  • Create a two-dimensional and time index.

    CREATE INDEX idx_2dt ON trajectory_table USING GiST(traj trajgist_2dt);
  • Delete an index.

    DROP INDEX idx_2dt;
  • Configure the method to express a trajectory as bounding boxes. For example, configure the method to express a trajectory as four bounding boxes.

    SET ganos.trajectory.index_split_config = '{"cut_point.even_divide":4}';
  • Create a multi-bounding box index.

    CREATE INDEX idx_2dt ON trajectory_table USING GiST(traj multi);
  • On this page (1, T)
  • View the default indexing mode
  • Specify an index type
Feedback
phone Contact Us

Chat now with Alibaba Cloud Customer Service to assist you in finding the right products and services to meet your needs.

alicare alicarealicarealicare