Skip to content
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

cherry pick "optimize plan for update with secondary index column (#14856)" to 1.1 #15454

Merged
merged 2 commits into from Apr 11, 2024

Conversation

badboynt1
Copy link
Contributor

change left join to right join and push down runtime filter

Approved by: @ouyuanning, @aunjgr

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue # https://github.com/matrixorigin/MO-Cloud/issues/2939

What this PR does / why we need it:

cherry pick "optimize plan for update with secondary index column (#14856)" to 1.1

)

change left join to right join and push down runtime filter

Approved by: @ouyuanning, @aunjgr
@matrix-meow matrix-meow added the size/S Denotes a PR that changes [10,99] lines label Apr 11, 2024
@mergify mergify bot requested a review from sukki37 April 11, 2024 03:25
@matrix-meow
Copy link
Contributor

@badboynt1 Thanks for your contributions!

Pull Request Review:

Title:

The title of the pull request is clear and concise, indicating that a specific commit related to optimizing a plan for update with a secondary index column is being cherry-picked to version 1.1.

Body:

The body of the pull request provides context about the type of PR, the related issue, and the purpose of the changes. It also lists the approval from specific individuals. The information is relevant and helps in understanding the motivation behind the changes.

Changes:

  1. Code Optimization:

    • The change from a left join to a right join in the appendDeleteUniqueTablePlan function is a significant optimization. This modification can improve query performance by changing the join type to better suit the query logic.
    • The addition of a new function getProjectionByLastNodeForRightJoin specifically tailored for right join scenarios enhances code readability and maintainability.
  2. Security Concerns:

    • The use of runtime filters in the code raises potential security concerns. Runtime filters can be exploited for data leakage or injection attacks if not properly sanitized or validated. It is crucial to ensure that the runtime filter expressions are secure and do not expose sensitive information.
  3. Code Clarity:

    • In some parts of the code, there are hardcoded values like RelPos: 0 and RelPos: 1. It would be beneficial to use constants or variables instead of hardcoded values to improve code clarity and maintainability.
  4. Consistency:

    • There are inconsistencies in the use of variable names like orginIndexColumnName instead of originIndexColumnName. Maintaining consistent naming conventions throughout the codebase can enhance readability and reduce confusion.

Suggestions for Improvement:

  1. Security Enhancement:

    • Validate and sanitize the runtime filter expressions to prevent any potential security vulnerabilities. Implement input validation and parameterized queries to mitigate the risk of SQL injection attacks.
  2. Code Refactoring:

    • Consider refactoring the code to use constants or enums for hardcoded values to improve code maintainability and make future modifications easier.
  3. Naming Consistency:

    • Ensure consistent naming conventions for variables and functions to enhance code readability and maintainability. Correct any typos or inconsistencies in variable names.
  4. Code Review:

    • Conduct a thorough code review to identify any other areas where optimizations or security enhancements can be implemented. Collaborate with team members to ensure code quality and adherence to best practices.

By addressing the security concerns, enhancing code clarity, and maintaining consistency in naming conventions, the overall quality and security of the codebase can be improved. Additionally, continuous code reviews and collaboration among team members can help in identifying and resolving any potential issues in the future.

@mergify mergify bot merged commit 2b858c8 into matrixorigin:1.1-dev Apr 11, 2024
18 checks passed
@badboynt1 badboynt1 deleted the update1.1 branch April 11, 2024 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement size/S Denotes a PR that changes [10,99] lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants