...
- Query arguments are applied on the client.
- Target node is determined from the list of partitions. We assume that partition distribution for the given affinity topology versions has been requested in advance similarly how we do that for C++ thin client.
- If only one node is resolved, send request to it. If several nodes are resolved - send request to random node from the list.
- Request is executed on the server and current affinity topology version is attached to the response. If it differs from the one received from the client, new partition tree is built and attached.
- Client checks if current affinity topology version differs. If yes - old partition tree is invalidated.
Optimizations
If partition tree is extracted form the query successfully, then two types of optimizations are possible:
- If tree evaluation returned empty partition set, return empty result set immediately without actual query execution
- If tree evaluation returned one partition, then all data reside on a single node. Convert query to "local" and execute it on target node without two-phase flow
- If tree evaluation returned several partitions, and all of them appear to be on the same node, then try to execute query speculatively on a single node, provided that partitions are still on that node. Fallback to normal execution mode in case of concurrent eviction.
Management and Monitoring
It is very important to let user know if partition pruning is applicable to query for performance tuning. For every cached two-step query we may expose the following information:
- Whether partition pruning is applicable
- Formatted partition tree
- Affinity topology version of the plan
- If not applicable - explain why (e.g. non-equi join, incompatible affinity functions, etc.)
Also we need to let user disable this optimization. Otherwise a bug in implementation may lead to incorrect results with no workarounds. System on configuration property could be used for that.
Tickets
Jira |
---|
server | ASF JIRA |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
maximumIssues | 20 |
---|
jqlQuery | project = Ignite AND labels IN (iep-24) ORDER BY status |
---|
serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
---|
|