## 3 Methodology
### Spatial Layer Construction
#### 3.1.2 Trie Tree for Managing Non-Equal Length-Encoding Sets
This paper effectively reduces the immediate cost of frequent insertions through the buffer, but the index is blocked and cannot work when the data are merged into the segment. In addition, under heavy write load, the buffer may frequently reach the threshold, requiring continuous merging and segmentation, resulting in reduced insertion and query efficiency. Figure 12 compares the performance of asynchronous and synchronous merge strategies under different read-write load ratios. In Figure 12a, the \(x\)-axis represents the workload with a read-write load ratio of 1:1, while in Figure 12b, the workload has a read-write load ratio of 1:2. The \(y\)-axis in the figure represents the time cost in seconds. The results show that the asynchronous strategy always outperforms the synchronous strategy in terms of time cost for different workloads. This performance improvement is more obvious as the workload increases. And for scenarios with heavier write loads, the asynchronous strategy has a more obvious advantage. The main reason is that it is able to decouple the merge operation from the main thread, allowing query operations and insertions to continue without being blocked. This demonstrates the efficiency of the asynchronous merge process in reducing data merging and model retraining overhead, especially under heavier write loads, ultimately improving system throughput and scalability. ## 5 Discussion

This paper proposes an efficient index GLMI for spatiotemporal data, which is a double-layer structure including a spatial layer and a temporal layer. GLMI constructs dynamic spatial partitions using Geohash-Hilbert curves and manages partition encoding with Trie trees. Geohash uses Z-order curves to partition space, effectively preserving

Figure 5:2 Comparison of index insertion performance. Figure 5:3 Comparison of time cost between synchronous and asynchronous merge strategies: (a) read–write load ratio 1:1, (b) read–write load ratio 1:2.

spatial locality. GLMI uses Hilbert curves instead of \(Z\)-order curves because Hilbert curves can effectively reduce spatial mutations and maintain better locality. In the time dimension, a piecewise linear model was constructed using the ShrinkingCone algorithm, and a buffer with skiplist as the core was designed to support the fast writing of spatiotemporal data. We aim to combine Geohash and piecewise linear models to fully utilize the ad-vantages of both technologies to solve the problems of spatiotemporal data management and query and the limitations of current indexes. Traditional structures such as R-trees and KD-trees can handle a variety of data types and distributions, but they often ignore specific application scenarios and the underlying characteristics of the data. At the same time, the performance of traditional indexes may be limited by some additional factors. For example, there is a situation where MBR overlaps during the construction of R-trees, resulting in the repeated retrieval of overlapping areas. The performance of the KD-tree is determined by its depth. GLMI uses Geohash and piecewise linear models to learn data distribution to adjust and optimize the index structure, significantly improving query efficiency. At the same time, the traditional tree structure will hold a large amount of additional storage space such as pointer information, increasing the number of disk IOs. GLMI utilizes a Trie tree to manage partition encodings, effectively reducing space consumption by avoiding the redundant storage of encoding details. In the time layer, GLMI minimizes space usage by only storing the essential parameters of the piecewise linear model, further optimizing the overall memory footprint while maintaining efficient indexing performance. Learned index methods such as the learned ZM index focus on reducing index size and improving query performance through machine learning models.