首页 PolarDB PolarDB for PostgreSQL Spatio-temporal Database Advanced usage Spatial-temporal object storage optimization Feature signature-based storage optimization for large spatio-temporal objects

Feature signature-based storage optimization for large spatio-temporal objects

更新时间: 2026-03-28 03:33:04

In PostgreSQL, filtering rows with a spatial operator forces the database to fetch each geometry from the TOAST table to compare bounding boxes—even when only a handful of rows match. For tables with high-resolution geometries (such as administrative boundaries or dense trajectory data), this means reading thousands of TOAST pages for a scan that touches only a few rows.

GanosBase addresses this by splitting each large spatio-temporal object into two parts: a compact feature signature (such as a bounding box) stored in-row, and the full entity data stored off-row. Index creation and spatial joins read only the lightweight in-row signature, skipping TOAST retrieval entirely. The full geometry is fetched only when the query actually needs it.

Enable or disable the feature

Connect to your PolarDB cluster, then set the polar_enable_storage_partial Grand Unified Configuration (GUC) parameter. The feature is disabled by default.

To enable:

SET polar_enable_storage_partial = true;

To disable:

SET polar_enable_storage_partial = false;

Configure the size threshold

When the feature is enabled, GanosBase applies in-row/off-row splitting only to objects whose size exceeds the polar_partial_external_threshold value (in bytes). Objects at or below the threshold are stored using the standard strategy.

ParameterRangeDefault
polar_partial_external_threshold1000–80002000

Set the threshold before creating a table:

SET polar_partial_external_threshold = 3000;
上一篇: Spatial-temporal object storage optimization 下一篇: Use ST_SetTypeStorage to set the storage mode for specific data types
阿里云首页 云原生数据库 PolarDB 相关技术圈