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

queries use literals instead of parameters, preventing the re-use of query plans [DATACOUCH-532] #840

Closed
spring-projects-issues opened this issue May 6, 2020 · 1 comment
Assignees
Labels
type: enhancement

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented May 6, 2020

Michael Reiche opened DATACOUCH-532 and commented

queries use literals instead of parameters, preventing the re-use of query plans

 

For example, for   findByLastname("Robertson"), the following query is generated :

SELECT meta().id as __id, meta().cas as __cas, travel-sample.* FROM travel-sample WHERE lastname = "Robertson" AND _class = "org.springframework.data.couchbase.domain.Person"

It would be more efficient to parameterized "Robertson" , so the query plan can be reused:

SELECT meta().id as __id, meta().cas as __cas, travel-sample.* FROM travel-sample WHERE lastname = $1 AND _class = "org.springframework.data.couchbase.domain.Person"

It is not so important to parameterize the 'type', as this query will always be on the same type


Referenced from: pull request #239

Backported to: 4.0.2 (Neumann SR2)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented May 6, 2020

Michael Reiche commented

There is a related issue when handling. String-n1ql queries.   The parameters in the query string need to be bound to the parameters[]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants