You can use a Lastpoint index to quickly retrieve data of the latest point in time in time series in a time series table. This topic describes the overview, usage methods, and other information about the Lastpoint index feature.
Overview
Lastpoint indexes are specifically designed to quickly retrieve the latest status of time series in time series tables. You can use a Lastpoint index to quickly obtain data of the latest point in time of monitored objects.
After you create a Lastpoint index for a time series table, when data is written to the time series table, Tablestore automatically synchronizes data of the latest point in time in time series in the time series table to the Lastpoint index by using local indexing. After all data of the latest point in time in time series in the time series table is synchronized to the Lastpoint index, the Lastpoint index enters the incremental synchronization state in which no synchronization latency exists. A Lastpoint index includes the partition key (the _#h field) generated by Tablestore for the time series, the time series identifiers, and the data of the latest point in time in the time series.
The Lastpoint index feature is supported in the following regions: China (Hangzhou), China (Shanghai), China (Beijing), and China (Zhangjiakou).
If you want to view the sample data in a Lastpoint index, see Appendix: Sample data in a Lastpoint index.
Scenarios
The following table describes the typical scenarios of Lastpoint indexes.
Scenario | Description |
IoT platform | In Internet of vehicles (IoV) scenarios, vehicles regularly report large amounts of data, such as vehicle location coordinates, in-vehicle temperature, and remaining power. Lastpoint indexes can be used for real-time vehicle location tracking to quickly query the latest location information of vehicles, helping users monitor vehicle status and location in real time. |
Monitoring system | In device monitoring scenarios, it is often necessary to quickly obtain the latest data of certain metrics, such as device operating status, temperature, and humidity. The monitoring system can use Lastpoint indexes to efficiently obtain the latest status of each device, supporting quick response and adjustment. |
Financial transactions | In real-time financial transactions, obtaining the latest price data in real time is crucial for decision-making. Lastpoint indexes help users quickly obtain the latest market quotations and trend analysis. |
Lastpoint index operations
The following table describes the features and call methods supported by Lastpoint indexes.
Feature | Description | Call method |
Create a Lastpoint index | Create a Lastpoint index for a time series table. | |
Query Lastpoint index data | Query Lastpoint index data by executing SQL statements or using the same method that you use to read data from a data table. | |
Delete a Lastpoint index | Delete a Lastpoint index that is created for a time series table. | |
Retrieve Lastpoint index | Create a search index for a Lastpoint index to fully leverage the advantages of search indexes in data queries for efficient retrieval of Lastpoint index data. |
Billing
The process of building a Lastpoint index does not incur fees. However, data storage in the Lastpoint index and reading data from the index will incur fees. For more information, see Billable items of the TimeSeries model.
If you query or retrieve Lastpoint index data by executing SQL statements or using a search index, SQL query- or search index-related fees will be incurred according to the billing rules of the respective features. For more information, see Billable items of SQL query and Billable items of search indexes.
Appendix: Sample data in a Lastpoint index
The following table shows the data in a time series table that contains two time series.
The _m_name, _data_source, and _tags fields are time series identifiers. The _time field is the time when the data is recorded. The cpu_usage and cpu_sys fields are metering metrics.
_m_name | _data_source | _tags | _time | cpu_usage | cpu_sys |
cpu | host_1 | ["region=hangzhou"] | 1712476524000000 | 10.0 | 5.0 |
cpu | host_1 | ["region=hangzhou"] | 1712476525000000 | 12.0 | 5.0 |
cpu | host_1 | ["region=hangzhou"] | 1712476526000000 | 14.0 | 5.0 |
cpu | host_2 | ["region=hangzhou"] | 1712476524000000 | 10.0 | 5.0 |
cpu | host_2 | ["region=hangzhou"] | 1712476525000000 | 20.0 | 5.0 |
cpu | host_2 | ["region=hangzhou"] | 1712476526000000 | 40.0 | 5.0 |
After you create a Lastpoint index, Tablestore automatically synchronizes data of the latest point in time in time series in the time series table to the Lastpoint index. The following table shows sample data in the Lastpoint index.
The _#h
field is the partition key generated by Tablestore for the time series.
_#h | _m_name | _data_source | _tags | _time | cpu_usage | cpu_sys |
03#cpu#a3 | cpu | host_1 | ["region=hangzhou"] | 1712476526000000 | 14.0 | 5.0 |
48#cpu#a5 | cpu | host_2 | ["region=hangzhou"] | 1712476526000000 | 40.0 | 5.0 |