Scholarly Article
Improving Spatiotemporal Query Performance in PostGIS Through Composite GiST Indexes
Aisha Yousef, Anwar Alhenshiri
2026-03-11 · AlQalam Journal of Medical and Applied Sciences · University of Tripoli Alahlia
Abstract
The increasing volume of spatiotemporal trajectory data generated by IoT and smart city applications presents major challenges for efficient query processing in relational databases. Although PostgreSQL with PostGIS offers strong spatial capabilities, compound queries involving both spatial and temporal constraints often experience high latency due to reliance on separate indexing strategies. This study investigates the use of composite Generalized Search Tree (GiST) indexing as an effective solution for optimizing multidimensional spatiotemporal queries. A controlled experimental evaluation was conducted using a synthetic dataset of 10 million records to compare query performance before and after implementing a multi-column GiST index with the gist_timestamptz_ops operator class. Results demonstrate a significant improvement in execution time, reducing query latency from 1490 ms to 31.38 ms, achieving a 47.5-fold speedup. The findings confirm that composite GiST indexing enables real-time performance for complex spatiotemporal workloads and provides a practical, reproducible approach for enhancing query efficiency in high-volume PostGIS environments.
Keywords
Spatiotemporal Indexing, PostGIS, Gist, Real-time Database, Performance Optimization
Citation Details
AlQalam Journal of Medical and Applied Sciences, Vol. 9, No. 3, pp. 641-651