JingsongLi commented on code in PR #207:
URL: https://github.com/apache/flink-table-store/pull/207#discussion_r917500198
##########
docs/content/docs/development/query-table.md:
##########
@@ -26,49 +26,67 @@ under the License.
# Query Table
-The Table Store is streaming batch unified, you can read full
-and incremental data depending on the runtime execution mode:
+You can directly SELECT the table in batch runtime mode of Flink SQL.
```sql
-- Batch mode, read latest snapshot
SET 'execution.runtime-mode' = 'batch';
SELECT * FROM MyTable;
+```
--- Streaming mode, read incremental snapshot, read the snapshot first, then
read the incremental
-SET 'execution.runtime-mode' = 'streaming';
-SELECT * FROM MyTable;
+## Query Engines
--- Streaming mode, read latest incremental
-SET 'execution.runtime-mode' = 'streaming';
-SELECT * FROM MyTable /*+ OPTIONS ('log.scan'='latest') */;
-```
+Table Store not only supports Flink SQL queries natively but also provides
+queries from other popular engines. See [Engines]({{< ref
"docs/engines/overview" >}})
## Query Optimization
It is highly recommended to specify partition and primary key filters
along with the query, which will speed up the data skipping of the query.
-along with the query, which will speed up the data skipping of the query.
-Supported filter functions are:
+The filter functions that can accelerate data skipping are:
- `=`
-- `<>`
- `<`
- `<=`
- `>`
- `>=`
-- `in`
-- starts with `like`
+- `IN (...)`
+- `LIKE '%abc'`
+- `IS NULL`
+
+Table Store will sort the data by primary key, which is good for point queries
+and range queries to speed up. When using a composite primary key, it is best
+for the query filters to form a [leftmost
prefix](https://dev.mysql.com/doc/refman/5.7/en/multiple-column-indexes.html)
+of the primary key for good acceleration.
+
+Suppose that a table has the following specification:
+
+```sql
+CREATE TABLE orders (
+ catalog_id BIGINT,
+ order_id BIGINT,
+ .....,
+ PRIMARY KEY (catalog_id, order_id) NOT ENFORCED
+)
+```
+
+The primary key is catalog_id + order_id. Good acceleration is obtained
+by specifying a range filter for the leftmost prefix of the primary key.
+
+```sql
+SELECT * FROM orders WHERE catalog_id=1025;
-## Real-time Streaming Consumption
+SELECT * FROM orders WHERE catalog_id=1025 AND order_id=29495;
Review Comment:
When I take a look to
https://dev.mysql.com/doc/refman/5.7/en/multiple-column-indexes.html
We don't have to add space here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]