## 1 Introduction
In cases of skewed workloads, optimizing the index structure by considering data sparsity and distribution can significantly enhance query efficiency. Moreover, learned indexes typically only need to store model parameters, eliminating the need for large amounts of auxiliary data such as pointer information, which reduces space overhead and minimizes disk I/O operations ([PERSON], 1996; [PERSON], 1997; [PERSON], 1998; [PERSON], 1999). Learned indexes have more promising application prospects. It takes about 50 cycles for a B-tree to fetch a page, and these cycles are difficult to parallelize. For machine learning models, they can complete more complex models in the same time and can transfer the load from the CPU to the GPU, which will bring higher access time, but it can still be overcome with the rapid development of GPU/TPU computing performance, while the development of CPU is lagging relatively behind. Learned indexes requires learning the mapping relationship between original data keys and record locations. The distribution of messy data is difficult to learn, which makes the construction of learned index models complicated. The distribution of multidimensional data is even more difficult to capture. At this time, a more adaptable learned index model needs to be considered. At the same time, the learned index learns the distribution of original data keys when it is built. When too much data are inserted, the distribution of original data keys will change significantly, causing the model to no longer be applicable. Therefore, after the inserted data affects the index performance, the learned index needs to be updated. Index updates require retraining the model, which increases the index maintenance cost. How to design and implement data insertion strategies without affecting index query performance and reduce the cost of model retraining is a key issue to be solved in learned index updates. When processing multidimensional data, a common method is to sort the data after dimensionality reduction, and then construct a one-dimensional learned index [10], such as the learned Z-order Model (ZM) index [11] and the Multidimensional Learned (ML) index [12]. However, this method presents several challenges: (1) dimensionality reduction-based methods cannot fully utilize the distribution of multidimensional data, complicating spatial relationship analysis; (2) since time and space have different dimensions, the one-dimensional encoding after dimensionality reduction is too complex, resulting in low-query efficiency; (3) it is difficult to support multiple query modes, such as queries on time or space dimensions; (4) it is difficult to efficiently perform spatial partitioning to maintain load balancing. To address the aforementioned challenges, this paper proposes a Geohash and piece-wise linear model-based index for spatiotemporal data (GLMI). Following the strategy of time-space separation, GLMI establishes a double-layer index to efficiently store and manage spatiotemporal data. Considering the uneven distribution of spatial data, GLMI implements dynamic partitioning in two-dimensional space. After uniform partitioning, data-intensive partitions are further subdivided and encoded. The management and maintenance of non-equal length-encoding sets are facilitated through a Trie tree, which supports fast querying. Additionally, a piecewise linear model is constructed for the dynamically partitioned data points based on the time dimension. In response to the fast update characteristics of spatiotemporal data, the index update method of GLMI is designed by drawing on the idea of delayed update. GLMI records the incoming data in an in-memory data structure, such as a skiplist, and upon reaching certain conditions, executes batch data merging and retraining to efficiently handle frequent writes.