In most cases, a trajectory contains a large amount of data. In some scenarios, new trajectory points are constantly added to the trajectory. To reduce storage costs, you can store cold data that is less queried or updated in Object Storage Service (OSS) buckets.
UPDATE trajectory_table
SET traj = ST_exportTo(
traj,
'OSS://<access key>:<access secret>@oss-cn-beijing-internal.aliyuncs.com/<bucket>/<directory>',
'{"compress":"zstd"}'
);
Parameter | Description |
---|
Parameter | Description |
---|---|
'OSS://<access key>:<access secret>@oss-cn-beijing-internal.aliyuncs.com/<bucket>/<directory>' | The URL of the OSS bucket to which you want to store trajectory data. For more information, see OSS domain names.
|
"compress":"zstd" | The method that is used to compress data. For more information about compression methods, see ST_ExportTo. |
After the data is imported into the OSS bucket, you can use the same statement to query the data. However, the query efficiency decreases. If you need to create an index, you must create an index before you import the data to the OSS bucket.