Added flags to mark whether a device has device descendants to optimize query like select xx from xxx.**#17672
Added flags to mark whether a device has device descendants to optimize query like select xx from xxx.**#17672Caideyipi wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #17672 +/- ##
============================================
+ Coverage 40.38% 40.43% +0.05%
Complexity 2574 2574
============================================
Files 5178 5178
Lines 349134 349328 +194
Branches 44665 44697 +32
============================================
+ Hits 140988 141252 +264
+ Misses 208146 208076 -70 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| final IMNodeIterator<IMemMNode> iterator = store.getChildrenIterator(node); | ||
| try { |
There was a problem hiding this comment.
Done. IMNodeIterator now extends AutoCloseable, and the newly added child-iterator scans use try-with-resources in memory, cached, and traverser paths.
luoluoyuyu
left a comment
There was a problem hiding this comment.
Review summary
Adds hasDeviceDescendant flags on schema nodes and maintains them when creating devices and when deleting empty internal nodes. This should speed up queries that need to know if a prefix has device descendants.
Please fix CI failures and add tests for flag updates on delete/move paths touched in this PR.
| entityMNode = device.getAsDeviceMNode(); | ||
| } else { | ||
| entityMNode = store.setToEntity(device); | ||
| entityMNode = setToEntityAndUpdateFlags(device); |
There was a problem hiding this comment.
setToEntityAndUpdateFlags marks ancestors when a node becomes a device. Please confirm refreshAncestorsHavingDeviceDescendant on deleteEmptyInternalMNode keeps flags correct when the last device under a prefix is removed.
There was a problem hiding this comment.
Confirmed and covered with tests. The delete refresh recomputes ancestors from children, so when the last device under one prefix is removed, higher ancestors stay true if another sibling device subtree still exists and become false only after the last remaining device subtree is removed. I extended both memory and cached MTree tests for that case, and added memory-mode table-device drop coverage as well.
|
Addressed the review comments in commit 2a68c38:
Verification:
For current CI: the latest failing Simple (17) job failed during �ctions/checkout with a GitHub TLS fetch error before build/test. The dual-tree-auto-basic failure is in IoTDBPipeLifeCycleIT.testLifeCycleLogMode, unrelated to this schema flag change. |
|



Description
As the title said.
This PR has:
for an unfamiliar reader.
for code coverage.
Key changed/added classes (or packages if there are too many classes) in this PR