This topic describes how to query data in a Lastpoint index.
Prerequisites
A Lastpoint index is created for a time series table. For more information, see Create a Lastpoint index.
Query methods
Directly query data
Go to the Instance Management page.
Log on to the Tablestore console.
In the top navigation bar, select a resource group and a region.
On the Overview page, click the instance name or click Manage Instance in the Actions column of the instance.
Go to the Manage Time Series Table page.
On the Instance Management page, click the Time Series Tables tab.
On the Time Series Tables tab, click the time series table name or click Manage Data in the Actions column of the time series table.
Open the Search dialog box.
In the LastPoint Index section of the Basic Information tab, click Query in the Actions column of the Lastpoint index.
Perform a range query to retrieve all data in the Lastpoint index.
Set Modes to Range Search.
By default, the system returns all columns. If you want to explicitly specify attribute columns, turn off the All Columns switch and enter the attribute columns that you want to return.
Separate multiple attribute columns with commas (,).
Retain the default value of 10 for the Max Versions parameter.
Time series tables do not support the max versions feature.
Retain the default settings for the Primary Key parameter.
The default setting for Start Primary Key Column is the minimum value, and the default setting for End Primary Key Column is the maximum value.
Specify the sorting direction for the query results. You can select Forward Search or Backward Search.
Click Query.
The data that meets the query conditions is displayed in the LastPoint Index section of the Basic Information tab.
Query data by executing SQL statements
Go to the Instance Management page.
Log on to the Tablestore console.
In the top navigation bar, select a resource group and a region.
On the Overview page, click the instance name or click Manage Instance in the Actions column of the instance.
Go to the Manage Time Series Table page.
On the Instance Management page, click the Time Series Tables tab.
On the Time Series Tables tab, click the time series table name or click Manage Data in the Actions column of the time series table.
Create an SQL mapping table for the Lastpoint index.
On the Manage Time Series Table page, click the Query by Executing SQL Statement tab.
On the Query by Executing SQL Statement tab, click the
icon.In the Create Mapping Table dialog box, select Lastpoint Index as the table type, specify the names of the time series table and the Lastpoint index, and then click Generate SQL Statement.
The system automatically generates the SQL statement to create the mapping table.

Click Execute SQL Statement.
Execute the SELECT statement to query data.
Enter an SQL statement in the console and click Execute SQL Statement.
The following sample SQL statement provides an example on how to query all data in the Lastpoint index:
select * from your_lastpoint_name;
Development integration
You can query data in a Lastpoint index by using Tablestore SDKs for the following programming languages:
Billing
You are not charged for creating a Lastpoint index. You are charged for the storage usage of data in a Lastpoint index and when you read data from a Lastpoint index. For more information, see Billable items of the TimeSeries model.
If you query data in a Lastpoint index by executing SQL statements, you are charged SQL query-related fees. For more information, see Billable items of SQL query.
References
The SQL query feature provides a centralized access interface for multiple data engines of Tablestore and is compatible with the query syntax of MySQL. The SQL query feature is suitable for scenarios in which a large volume of data is stored and you want to access the data online. You can use the SQL query feature to perform complex queries and analytics on data in Tablestore in an efficient manner. For more information, see SQL query.
If you want to query data in a Lastpoint index by using various query methods in an accelerated manner, such as Boolean query, full-text search, prefix query, and fuzzy query, you can create a search index for the Lastpoint index and use the search index to query data. For more information, see Retrieve a Lastpoint index.
If you want to display data in a Lastpoint index in a visualized manner, you can connect Tablestore to Grafana or DataV. For more information, see Integrate with Grafana or Connect Tablestore to DataV-Board 6.0.