Tablestore supports queries similar to the IN and BETWEEN...AND queries in relational databases. To run an IN query, you can use one of the following methods.
Method 1: After you create a table mapping, you can use the IN operator in the WHERE clause of a SELECT statement to run the query. This method is similar to an IN query in MySQL and offers better performance. For more information, see SQL operators.
Method 2: After you create a search index, you can use the terms query (TermsQuery) feature to run the query. This method supports terms queries on any column, is fully equivalent to an IN query in MySQL, and offers better performance.
Method 3: You can use the batch read data feature to run the query. This method supports only term queries on full primary keys.
To run a BETWEEN...AND query, you can use one of the following methods.
Method 1: After you create a table mapping, you can use the BETWEEN...AND operator in the WHERE clause of a SELECT statement to run the query. This method is similar to a BETWEEN...AND query in MySQL. For more information, see SQL operators.
Method 2: After you create a search index, you can use the range query (RangeQuery) feature to run the query. This method supports range queries on any column.
Method 3: You can use the range read data feature to run the query. This method supports only range queries on full primary keys or key prefixes.