matrixone
matrixone copied to clipboard
Refactor partition state 1
What type of PR is this?
- [ ] API-change
- [ ] BUG
- [ x] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring
Which issue(s) this PR fixes:
issue #15530
What this PR does / why we need it:
- refactor partition state to optimize memory usage.
@triump2020 Thanks for your contributions!
Here are review comments for file pkg/vm/engine/disttae/logtailreplay/rows_iter.go:
Pull Request Review:
Title: Refactor partition state 1
Body:
- The PR is categorized as an Improvement.
- It references issue #15530.
- The purpose of the PR is to refactor the partition state to optimize memory usage.
Changes in pkg/vm/engine/disttae/logtailreplay/rows_iter.go:
-
Addition of NewRowsIter Function:
- A new function
NewRowsIterhas been added to create a new iterator for data rows and tombstones. This function is intended to improve the handling of iterators in the codebase.
- A new function
-
Code Modification in
NextFunction:- An additional comment
//FIXME::??has been added without clear context or explanation. - The logic in the
Nextfunction seems to be related to skipping rows with the sameRowIDas the last one encountered.
- An additional comment
Suggestions and Feedback:
-
Comment Clarity:
- The comment
//FIXME::??lacks clarity and does not provide sufficient information about the purpose or intention of the code. It should be revised to explain the reason for the conditional check.
- The comment
-
Code Optimization:
- Consider providing a more descriptive comment for the logic in the
Nextfunction to enhance code readability and maintainability.
- Consider providing a more descriptive comment for the logic in the
-
Security Concerns:
- Ensure that the refactoring does not introduce any security vulnerabilities, especially when handling sensitive data like tombstones.
-
Testing:
- It would be beneficial to include relevant tests to validate the changes made in the
NewRowsIterfunction and the modified logic in theNextfunction.
- It would be beneficial to include relevant tests to validate the changes made in the
-
Code Consistency:
- Ensure that the refactored code aligns with the existing code style and conventions to maintain consistency across the codebase.
-
Documentation:
- Update any relevant documentation to reflect the changes introduced by this refactoring.
-
Collaboration:
- Collaborate with team members to review the refactored code and gather feedback to ensure the changes align with the overall project goals.
By addressing the mentioned points, the pull request can be enhanced in terms of clarity, security, and maintainability.
对于普通表没有问题,主要是 mo_tables, mo_columns, mo_database 这三张表有问题,因为其没有主键,rowid 也 不唯一,需要特殊处理.