This topic describes GiST indexing. You can create a GiST index on a column that stores trajectory data.

Syntax

CREATE INDEX [index_name] on table_name USING GIST(traj_col [operator_family]);
  • index_name: the name of the index. This parameter is optional.
  • table_name: the name of the table to which the column belongs.
  • traj_col: the name of the column.
  • operator_family: the operator family that is used to create the index. Default value: trajgist_ops_multi. You can use the ganos.trajectory.index_split_config parameter to specify the operator family. This parameter is optional.
Note The created index helps accelerate queries that are run by operators and the following functions: ST_ndIntersect, ST_ndDWithin, ST_ndContains, and ST_ndWithin.

Supported operator families

The following table describes the operator families that are supported by GiST.

Operator family Description
trajgist_ops_z Creates an index on the z axis. This type of index supports queries that cover only the z axis.
trajgist_ops_t Creates an index on the t axis. This type of index supports queries that cover only the t axis.
trajgist_ops_2d Creates an index on the x and y axes. This type of index supports queries that cover only the x and y axes.
trajgist_ops_2dt Creates an index on the x, y, and t axes. This type of index supports queries that cover only the x and y axes, queries that cover only the t axis, and queries that cover the x, y, and t axes.
trajgist_ops_3d Creates an index on the x, y, and z axes. This type of index supports queries that cover only the x and y axes, queries that cover only the z axis, and queries that cover the x, y, and z axes.
trajgist_ops_3dt Creates an index on the x, y, z, and t axes. This type of index supports all queries that are supported by the preceding five operator families.
trajgist_ops_multi Creates an index on multiple bounding boxes to accelerate queries. However, the system requires more time and storage to create the index.

Examples

-- Create an index on the t axis. 
CREATE INDEX on table_name USING GIST(traj_col trajgist_ops_t);

-- Create an index on the x and y axes. 
CREATE INDEX on table_name USING GIST(traj_col trajgist_ops_2d);

-- Create an index on the x, y, and t axes. 
CREATE INDEX on table_name USING GIST(traj_col trajgist_ops_2dt);