oceanbase/sql-lifecycle-management

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

onekilogram opened this issue · 1 comments

Description

我使用的SQL是如下

SELECT
db_id,
user_id,
database_alias
FROM
database_asset
WHERE
version = '5.7'
or version = '5.6'

数据库表结构是 sqless 自己的,sql-lifecycle-management/init/init.sql 里的提供的sql

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(),
]