Skip to content

[Client] Support Fast Last Query in C++ session - #18860

Merged
jt2594838 merged 1 commit into
apache:masterfrom
hongzhi-gao:feat/cpp-fast-last-query-20261014
Oct 16, 2026
Merged

jt2594838 merged 1 commit into
apache:masterfrom
hongzhi-gao:feat/cpp-fast-last-query-20261014

Conversation

@hongzhi-gao

@hongzhi-gao hongzhi-gao commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

Change

Add the C++ Session::executeFastLastDataQueryForOnePrefixPath API for tree-model prefixes. It calls the existing Fast Last Thrift RPC, rejects wildcard prefixes, and returns a SessionDataSet. Add an integration test for multiple devices, sparse latest values, an empty result, and wildcard rejection.

Performance test on a storage server

  • Machine: 16 CPU cores, 31 GiB RAM; 1 ConfigNode + 1 DataNode.
  • Workload: 400 devices × 100 series = 40,000 series. Results matched ordinary SELECT LAST ** for all 40,000 series.
  • Measurement: 20 warm-up queries per method, then three runs of 100 alternating samples per method. Each sample includes querying, reading all rows, and closing the result set.
Query Samples Mean P50 P95 P99 Maximum Over 100 ms
Fast Last 300 56.84 ms 55.74 ms 61.02 ms 62.51 ms 83.31 ms 0
Ordinary SQL Last 300 107.62 ms 104.45 ms 119.62 ms 136.89 ms 146.81 ms 300

This PR has:

  • been self-reviewed.
  • added comments describing the new public API and its constraints.
  • added an integration test.
  • been tested against a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR
  • Session, SessionConnection, and sessionIT.cpp in iotdb-client/client-cpp

@hongzhi-gao
hongzhi-gao force-pushed the feat/cpp-fast-last-query-20261014 branch from 8e25661 to b95d055 Compare October 14, 2026 03:26
@hongzhi-gao

Copy link
Copy Markdown
Contributor Author

Hi @jt2594838 @JackieTien97 @Caideyipi , could you please review this PR when you have a chance? Thanks!

@jt2594838
jt2594838 merged commit aa365aa into apache:master Oct 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants