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

normalize insert query more efficiently #1149

Open
eurekaka opened this issue Jan 7, 2021 · 1 comment
Open

normalize insert query more efficiently #1149

eurekaka opened this issue Jan 7, 2021 · 1 comment
Labels
type/enhancement New feature or request

Comments

@eurekaka
Copy link
Contributor

eurekaka commented Jan 7, 2021

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(...).

@eurekaka eurekaka added the type/enhancement New feature or request label Jan 7, 2021
@kennytm
Copy link
Contributor

kennytm commented Jan 7, 2021

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
Labels
type/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants