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

Reduce number of binding parameters #893

Open
Tigrov opened this issue Oct 25, 2024 · 6 comments
Open

Reduce number of binding parameters #893

Tigrov opened this issue Oct 25, 2024 · 6 comments
Labels
status:ready for adoption Feel free to implement this issue. type:enhancement Enhancement

Comments

@Tigrov
Copy link
Member

Tigrov commented Oct 25, 2024

We can reduce the number of binding parameters by binding only values that need to be quoted (string and binary values).
It is not necessary to bind null, bool, int and float, these values can be converted to an unquoted string.

Expect this to improve performance slightly.

Related issue

@samdark samdark added type:enhancement Enhancement status:ready for adoption Feel free to implement this issue. labels Oct 25, 2024
@xepozz
Copy link
Member

xepozz commented Oct 25, 2024

It is not necessary to bind null, bool, int and float, these values can be converted to an unquoted string.

Expect this to improve performance slightly.

Why do you think so?

@samdark
Copy link
Member

samdark commented Oct 27, 2024

@xepozz about these being unnecessary or about performance?

@xepozz
Copy link
Member

xepozz commented Oct 27, 2024

About unnecessary binding for null, bool, etc

@samdark
Copy link
Member

samdark commented Oct 27, 2024

Well, it might be good to bind it for database optimizer but security-wise binding is not needed.

@Tigrov
Copy link
Member Author

Tigrov commented Oct 28, 2024

It is not necessary to bind null, bool, int and float, these values can be converted to an unquoted string.
Expect this to improve performance slightly.

Why do you think so?

  1. The answer is in the sentence: "these values can be converted to an unquoted string" and it is safely.
  2. Less calls of methods and less stored values should improve performance.

@xepozz
Copy link
Member

xepozz commented Oct 28, 2024

I'm just wondering why should changing q=select ?, ?, ?, p=[null,1,true] to q=select null, 1, true, p=[] improve performance?
Anyway, we can test it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue. type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants