All Products
Search
Document Center

Tablestore:Differences between the GetRange and Search operations

Last Updated:Nov 20, 2024

Difference

GetRange operation

Search operation

Real-time query

The GetRange operation is performed on the data table. You do not need to create an index to query data. You can query data immediately after the data is written to the data table.

For more information about the GetRange operation, see Read data and GetRange.

The Search operation is performed on the search index. Data is asynchronously synchronized from the data table to the search index that is created for the data table. You can query data from the search index after the data is synchronized from the data table to the search index. In most cases, data is synchronized from the data table to the search index 3 seconds after the data is written to the data table.

For more information about the Search operation, see Overview and Search.

Consumption and scaling of computing resources

The system locates the partitions of the data table based on the specified primary key range and performs read operations only on the partitions. A small number of computing resources are consumed, and the computing resources are scalable.

The consumption and scaling of computing resources vary based on whether or not you specify a routing key when you create a search index.

  • If you do not specify a routing key, the system performs read operations on all partitions. In this case, a large number of computing resources are consumed, and the scaling of computing resources is weak.

  • If you specify a routing key, the system locates the specified partitions and performs read operations on the partitions. In this case, a small number of computing resources are consumed. The query capability can be scaled based on the number of partitions. However, partitions of indexes do not support dynamic splitting. Therefore, the query capability cannot be dynamically scaled.

For information about how to create a search index, see Create a search index.

Data filtering

Data can be scanned. Complex data filtering is not supported.

The Search operation is more flexible than the GetRange operation. You can specify column conditions and combine the conditions to filter data based on search indexes.