Use the Simple storage policy

更新时间:
复制 MD 格式

Spatio-temporal data types such as grids, trajectories, and point clouds produce large individual objects and accumulate significant total data volume. The default storage policies in PostgreSQL support only fixed, built-in compression algorithms or uncompressed external storage — neither is optimized for spatio-temporal workloads. As a result, spatio-temporal data can consume excessive storage space and degrade query performance.

GanosBase addresses this with the Simple storage policy. When enabled, data is compressed using a custom algorithm and stored in regular tables where possible, rather than in external storage, reducing storage costs and query overhead.

Enable the Simple storage policy

Enabling the policy requires two steps: turning on the Grand Unified Configuration (GUC) parameter, then setting the storage type on the target column.

Step 1: Set the GUC parameter

The polar_enable_storage_simple parameter controls whether the Simple storage policy is available. It is enabled by default.

To enable it:

SET polar_enable_storage_simple = true;

To disable it:

SET polar_enable_storage_simple = false;

Step 2: Apply the policy to a column

Set the storage type of the target column to simple:

ALTER TABLE tbname ALTER COLUMN colname SET STORAGE simple;

Replace tbname with your table name and colname with your column name.

After the statement completes, new data written to colname is automatically compressed and stored using the Simple storage policy.