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

Unexpected behavior and very slow query response, hence compromised functionality #131

Closed
nidaca opened this issue Sep 1, 2015 · 3 comments

Comments

@nidaca
Copy link
Contributor

nidaca commented Sep 1, 2015

Hello,

I have a very simple use case (from a large project): two models, model Person and model File, a simple one-way association between them, let's say 'avatar' (which is an optional attribute). So the waterline model of Person contains the definition of the association: { .... avatar: { model: 'file'; } ... }.

Now I make the following waterline query: Person.find( { key: 'value' } ).populate('avatar').exec(...), where the 'key' attribute is mapped to a string (indexed) field from the database, from class Person. For the previous query, the key needs to match a given input string value which leads to a record from the Person class with no associated avatar, meaning that the LINK property 'avatar' for this record has no value.

The problem is: two OrientDB queries are generated (taken from the debug console):

  • one for the initial find:
    SELECT ..., avatar, ... FROM Person WHERE key='value'
  • and second:
    SELECT ... FROM File WHERE @Rid=:param0 ,
    for the populate functionality ... this approach rise a first (implementation) question, is this second query really necessary ? Isn't the fetchplan approach a more suitable solution for populating simple LINKs ?

Anyway, this is not the main goal of this issue description, but:

For the above case scenario the execution of the waterline query will last forever (more than 6 SECONDS !!!). The problem seems to be that the last query receives a parameter with a 'null' value, which completely overwhelms the OrientDB database, I don't know why because it is a straightforward invalid usecase. Shouldn't this null parameter be verified on the adapter side and removed from the query execution ?

Thanks !

[sails-orientdb version: 0.10.55, OrientDB server version: 2.0.12]

@nidaca
Copy link
Contributor Author

nidaca commented Sep 8, 2015

@dmarcelino, any thoughts on this issue ? I'm trying to find a workaround and some feedback would be really great and appreciated ...

@nidaca
Copy link
Contributor Author

nidaca commented Oct 3, 2015

it seems that the issue was solved a few days ago in [email protected]: balderdashy/waterline-cursor#8

@dmarcelino
Copy link
Member

Cool! Thanks for the update, closing this.

dmarcelino added a commit that referenced this issue Oct 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants