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

repaire optimizer bug ref #150 #151

Merged
merged 2 commits into from
Jan 22, 2024
Merged

Conversation

qidi1
Copy link
Contributor

@qidi1 qidi1 commented Jan 22, 2024

Close: #150

Summary

The optimized sql of the code is not running as expected.
The result of the run
image

Solution Description

The index optimization bug: It is caused by the index did not check for duplicate columns. Add a column_set to check if a column has already been added.

     if column_name not in column_set:
                    column_set.add(column_name)
                    column_list.append(column_name)

The SQL rewrite bug: It is caused by Oceanbase not applying RewriteMySQLORRule. Add RewriteMySQLORRule to common_rules

common_rules = [
    RewriteSupplementColumnRule(),
    RemoveOrderByInDeleteUpdateRule(),
    RewriteMySQLORRule(),
]

@CLAassistant
Copy link

CLAassistant commented Jan 22, 2024

CLA assistant check
All committers have signed the CLA.

@qidi1 qidi1 merged commit 11b668c into oceanbase:main Jan 22, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Question]: SQL Optimize:SQL优化建议中,1.索引创建有问题 2.优化后的SQL为空
2 participants