Skip to content

Feature: Add some rewrite rules that WeTune discovers #17607

@b41sh

Description

@b41sh

Summary

WeTune is a rule generator that automatically discovers new rewrite rules. We can add some rewrite rules in Databend.

for example:

SELECT id FROM notes
WHERE
  type = 'D'
  AND id IN (
    SELECT id FROM notes WHERE commit_id = 7
  )

can rewrite as

SELECT id FROM notes
  notes
WHERE
  type = 'D' AND commit_id = 7
SELECT
  o_auth_applications.id
FROM
  o_auth_applications
  INNER JOIN authorizations ON o_auth_applications.id = authorizations.o_auth_application_id
WHERE
  authorizations.user_id = 1465

can rewrite as

SELECT
  authorizations.o_auth_application_id AS o_auth_application_id
FROM
  authorizations AS authorizations
WHERE
  authorizations.user_id = 1465

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions