-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix data export logic to avoid redundant high frequency query #17049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
iotdb-client/cli/src/main/java/org/apache/iotdb/tool/data/ExportDataTree.java
Outdated
Show resolved
Hide resolved
iotdb-client/cli/src/main/java/org/apache/iotdb/tool/data/ExportDataTree.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request refactors the SQL file export logic in IoTDB to eliminate redundant high-frequency queries that were executed during data export operations. The original implementation performed a SHOW TIMESERIES query for every single data point, which caused severe performance issues.
Changes:
- Split the
exportToSqlFilemethod into two specialized methods:exportToSqlFileWithAlignDevicefor align-by-device queries andexportToSqlFileWithoutAlignfor regular queries - Removed the redundant
SHOW TIMESERIESquery that was executed for each row in the original implementation - Simplified the file writing logic to use prepared SQL prefixes and avoid nested loops
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Major Changes