Skip to content

normalize insert query more efficiently #1149

Open

Description

@eurekaka

Feature Request

Is your feature request related to a problem? Please describe:

For an insert query containing large strings in the VALUES part, the normalize procedure is not that efficient since it processes the query from beginning to the end.

Describe the feature you'd like:

For insert ... values (xx), we can specially normalize it to be insert ... values(...), i.e, we can skip processing the possible large string after values.

Since normalize only involves lex analysis, with no grammar analysis, we have to specially check the insert and values keywords, which makes it pretty tricky.

Besides, there may be ON DUPLICATE UPDATE in the end of the query, we need to specially handle them as well.

Describe alternatives you've considered:

N/A

Teachability, Documentation, Adoption, Migration Strategy:

Side effect of this improvement is that, both insert into t values(1,1) and insert into t values(1,1),(2,2) would be normalized to insert into t values(...).

Activity

  1. kennytm commented on Jan 7, 2021

    @kennytm
    Contributor

    this should also recognize replace into. the keyword values can also be value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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