You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]
The text was updated successfully, but these errors were encountered:
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):
SELECT ..., avatar, ... FROM Person WHERE key='value'
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]
The text was updated successfully, but these errors were encountered: