ArangoDB. Long time query
I have ArangoDB query. This query executes generally normal, but suddenly too long
WITH
DependantPerson, PersonServiceProfile, MonitoringRule, DeviceSensor, PersonDevice, Subscription, Person, Link, DeviceApplication, Contact
FOR res IN @resource_from
LET sub = (FOR e, v, p IN @min_depth..@max_depth INBOUND res Link FILTER (p.vertices[*].type ANY == "DeviceSensor") RETURN p)
RETURN {
[res]:sub[*
RETURN {
relations: CURRENT.edges[* FILTER (CURRENT.type != "Link" && CURRENT.type != "ObserveLink") RETURN CURRENT ],
resources: CURRENT.vertices[* FILTER (CURRENT.type == "DeviceSensor" && CURRENT.attributes.deviceId == @id) RETURN CURRENT ]
}
]
}
Cache is turned off
require("@arangodb/aql/cache").properties()
{
"mode" : "off",
"maxResults" : 128
}
How can i optimize this? Thanks
nosql arangodb aql
add a comment |
I have ArangoDB query. This query executes generally normal, but suddenly too long
WITH
DependantPerson, PersonServiceProfile, MonitoringRule, DeviceSensor, PersonDevice, Subscription, Person, Link, DeviceApplication, Contact
FOR res IN @resource_from
LET sub = (FOR e, v, p IN @min_depth..@max_depth INBOUND res Link FILTER (p.vertices[*].type ANY == "DeviceSensor") RETURN p)
RETURN {
[res]:sub[*
RETURN {
relations: CURRENT.edges[* FILTER (CURRENT.type != "Link" && CURRENT.type != "ObserveLink") RETURN CURRENT ],
resources: CURRENT.vertices[* FILTER (CURRENT.type == "DeviceSensor" && CURRENT.attributes.deviceId == @id) RETURN CURRENT ]
}
]
}
Cache is turned off
require("@arangodb/aql/cache").properties()
{
"mode" : "off",
"maxResults" : 128
}
How can i optimize this? Thanks
nosql arangodb aql
What does too long mean, a full minute but normally below a second? Are the bind parameters the same each time? What do you set@min_depth
and@max_depth
to? And how does your graph look, as in how many edges need to be followed to fulfill the request (rough estimate)?
– CoDEmanX
Nov 22 '18 at 19:42
@CoDEmanX, Too Long is about 30 sec. Normally it executes for milliseconds. @min_depth=@max_depth=2. All parameters are the same each time. Edges is only Link collection. Person node has 7 edges with others nodes.
– Антон Козлов
Nov 27 '18 at 12:43
What's the exact ArangoDB version and which storage engine is in use? Are there any concurrent queries or imports, e.g. writes that might block any of the collections that are involved in the traversal? Is there anything notable in regards to the system resources in the moment the query takes much longer than usual, e.g. swapping?
– CoDEmanX
Nov 28 '18 at 22:06
@CoDEmanX, Version ArangoDB is 3.3.17. Storage engine is RocksDB. ReplicationFactor is 4 and NumberOfShards is 1 for all collections. System resources don't have unusual load in the moment the query
– Антон Козлов
Nov 29 '18 at 6:31
Do you see similar behavior with non-graph queries as well? Or any network latency spikes in general? Can you try with replication factor 1? If everything runs on one node locally and it still takes 30s sometimes, then it would be related to the query or storage engine I guess, otherwise it could be be problem with the cluster or network.
– CoDEmanX
Dec 3 '18 at 12:08
add a comment |
I have ArangoDB query. This query executes generally normal, but suddenly too long
WITH
DependantPerson, PersonServiceProfile, MonitoringRule, DeviceSensor, PersonDevice, Subscription, Person, Link, DeviceApplication, Contact
FOR res IN @resource_from
LET sub = (FOR e, v, p IN @min_depth..@max_depth INBOUND res Link FILTER (p.vertices[*].type ANY == "DeviceSensor") RETURN p)
RETURN {
[res]:sub[*
RETURN {
relations: CURRENT.edges[* FILTER (CURRENT.type != "Link" && CURRENT.type != "ObserveLink") RETURN CURRENT ],
resources: CURRENT.vertices[* FILTER (CURRENT.type == "DeviceSensor" && CURRENT.attributes.deviceId == @id) RETURN CURRENT ]
}
]
}
Cache is turned off
require("@arangodb/aql/cache").properties()
{
"mode" : "off",
"maxResults" : 128
}
How can i optimize this? Thanks
nosql arangodb aql
I have ArangoDB query. This query executes generally normal, but suddenly too long
WITH
DependantPerson, PersonServiceProfile, MonitoringRule, DeviceSensor, PersonDevice, Subscription, Person, Link, DeviceApplication, Contact
FOR res IN @resource_from
LET sub = (FOR e, v, p IN @min_depth..@max_depth INBOUND res Link FILTER (p.vertices[*].type ANY == "DeviceSensor") RETURN p)
RETURN {
[res]:sub[*
RETURN {
relations: CURRENT.edges[* FILTER (CURRENT.type != "Link" && CURRENT.type != "ObserveLink") RETURN CURRENT ],
resources: CURRENT.vertices[* FILTER (CURRENT.type == "DeviceSensor" && CURRENT.attributes.deviceId == @id) RETURN CURRENT ]
}
]
}
Cache is turned off
require("@arangodb/aql/cache").properties()
{
"mode" : "off",
"maxResults" : 128
}
How can i optimize this? Thanks
nosql arangodb aql
nosql arangodb aql
asked Nov 22 '18 at 13:44


Антон КозловАнтон Козлов
11
11
What does too long mean, a full minute but normally below a second? Are the bind parameters the same each time? What do you set@min_depth
and@max_depth
to? And how does your graph look, as in how many edges need to be followed to fulfill the request (rough estimate)?
– CoDEmanX
Nov 22 '18 at 19:42
@CoDEmanX, Too Long is about 30 sec. Normally it executes for milliseconds. @min_depth=@max_depth=2. All parameters are the same each time. Edges is only Link collection. Person node has 7 edges with others nodes.
– Антон Козлов
Nov 27 '18 at 12:43
What's the exact ArangoDB version and which storage engine is in use? Are there any concurrent queries or imports, e.g. writes that might block any of the collections that are involved in the traversal? Is there anything notable in regards to the system resources in the moment the query takes much longer than usual, e.g. swapping?
– CoDEmanX
Nov 28 '18 at 22:06
@CoDEmanX, Version ArangoDB is 3.3.17. Storage engine is RocksDB. ReplicationFactor is 4 and NumberOfShards is 1 for all collections. System resources don't have unusual load in the moment the query
– Антон Козлов
Nov 29 '18 at 6:31
Do you see similar behavior with non-graph queries as well? Or any network latency spikes in general? Can you try with replication factor 1? If everything runs on one node locally and it still takes 30s sometimes, then it would be related to the query or storage engine I guess, otherwise it could be be problem with the cluster or network.
– CoDEmanX
Dec 3 '18 at 12:08
add a comment |
What does too long mean, a full minute but normally below a second? Are the bind parameters the same each time? What do you set@min_depth
and@max_depth
to? And how does your graph look, as in how many edges need to be followed to fulfill the request (rough estimate)?
– CoDEmanX
Nov 22 '18 at 19:42
@CoDEmanX, Too Long is about 30 sec. Normally it executes for milliseconds. @min_depth=@max_depth=2. All parameters are the same each time. Edges is only Link collection. Person node has 7 edges with others nodes.
– Антон Козлов
Nov 27 '18 at 12:43
What's the exact ArangoDB version and which storage engine is in use? Are there any concurrent queries or imports, e.g. writes that might block any of the collections that are involved in the traversal? Is there anything notable in regards to the system resources in the moment the query takes much longer than usual, e.g. swapping?
– CoDEmanX
Nov 28 '18 at 22:06
@CoDEmanX, Version ArangoDB is 3.3.17. Storage engine is RocksDB. ReplicationFactor is 4 and NumberOfShards is 1 for all collections. System resources don't have unusual load in the moment the query
– Антон Козлов
Nov 29 '18 at 6:31
Do you see similar behavior with non-graph queries as well? Or any network latency spikes in general? Can you try with replication factor 1? If everything runs on one node locally and it still takes 30s sometimes, then it would be related to the query or storage engine I guess, otherwise it could be be problem with the cluster or network.
– CoDEmanX
Dec 3 '18 at 12:08
What does too long mean, a full minute but normally below a second? Are the bind parameters the same each time? What do you set
@min_depth
and @max_depth
to? And how does your graph look, as in how many edges need to be followed to fulfill the request (rough estimate)?– CoDEmanX
Nov 22 '18 at 19:42
What does too long mean, a full minute but normally below a second? Are the bind parameters the same each time? What do you set
@min_depth
and @max_depth
to? And how does your graph look, as in how many edges need to be followed to fulfill the request (rough estimate)?– CoDEmanX
Nov 22 '18 at 19:42
@CoDEmanX, Too Long is about 30 sec. Normally it executes for milliseconds. @min_depth=@max_depth=2. All parameters are the same each time. Edges is only Link collection. Person node has 7 edges with others nodes.
– Антон Козлов
Nov 27 '18 at 12:43
@CoDEmanX, Too Long is about 30 sec. Normally it executes for milliseconds. @min_depth=@max_depth=2. All parameters are the same each time. Edges is only Link collection. Person node has 7 edges with others nodes.
– Антон Козлов
Nov 27 '18 at 12:43
What's the exact ArangoDB version and which storage engine is in use? Are there any concurrent queries or imports, e.g. writes that might block any of the collections that are involved in the traversal? Is there anything notable in regards to the system resources in the moment the query takes much longer than usual, e.g. swapping?
– CoDEmanX
Nov 28 '18 at 22:06
What's the exact ArangoDB version and which storage engine is in use? Are there any concurrent queries or imports, e.g. writes that might block any of the collections that are involved in the traversal? Is there anything notable in regards to the system resources in the moment the query takes much longer than usual, e.g. swapping?
– CoDEmanX
Nov 28 '18 at 22:06
@CoDEmanX, Version ArangoDB is 3.3.17. Storage engine is RocksDB. ReplicationFactor is 4 and NumberOfShards is 1 for all collections. System resources don't have unusual load in the moment the query
– Антон Козлов
Nov 29 '18 at 6:31
@CoDEmanX, Version ArangoDB is 3.3.17. Storage engine is RocksDB. ReplicationFactor is 4 and NumberOfShards is 1 for all collections. System resources don't have unusual load in the moment the query
– Антон Козлов
Nov 29 '18 at 6:31
Do you see similar behavior with non-graph queries as well? Or any network latency spikes in general? Can you try with replication factor 1? If everything runs on one node locally and it still takes 30s sometimes, then it would be related to the query or storage engine I guess, otherwise it could be be problem with the cluster or network.
– CoDEmanX
Dec 3 '18 at 12:08
Do you see similar behavior with non-graph queries as well? Or any network latency spikes in general? Can you try with replication factor 1? If everything runs on one node locally and it still takes 30s sometimes, then it would be related to the query or storage engine I guess, otherwise it could be be problem with the cluster or network.
– CoDEmanX
Dec 3 '18 at 12:08
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432364%2farangodb-long-time-query%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53432364%2farangodb-long-time-query%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What does too long mean, a full minute but normally below a second? Are the bind parameters the same each time? What do you set
@min_depth
and@max_depth
to? And how does your graph look, as in how many edges need to be followed to fulfill the request (rough estimate)?– CoDEmanX
Nov 22 '18 at 19:42
@CoDEmanX, Too Long is about 30 sec. Normally it executes for milliseconds. @min_depth=@max_depth=2. All parameters are the same each time. Edges is only Link collection. Person node has 7 edges with others nodes.
– Антон Козлов
Nov 27 '18 at 12:43
What's the exact ArangoDB version and which storage engine is in use? Are there any concurrent queries or imports, e.g. writes that might block any of the collections that are involved in the traversal? Is there anything notable in regards to the system resources in the moment the query takes much longer than usual, e.g. swapping?
– CoDEmanX
Nov 28 '18 at 22:06
@CoDEmanX, Version ArangoDB is 3.3.17. Storage engine is RocksDB. ReplicationFactor is 4 and NumberOfShards is 1 for all collections. System resources don't have unusual load in the moment the query
– Антон Козлов
Nov 29 '18 at 6:31
Do you see similar behavior with non-graph queries as well? Or any network latency spikes in general? Can you try with replication factor 1? If everything runs on one node locally and it still takes 30s sometimes, then it would be related to the query or storage engine I guess, otherwise it could be be problem with the cluster or network.
– CoDEmanX
Dec 3 '18 at 12:08