Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-09-2021 06:38 AM
Hello
I have the following request in GraphQL
query NewDefaultResults {
ARTICLE (first: 5000){
id
silhouette_score
cluster {
cluster_id
node_id
percent_articles_gt_ts
}
title
sentence
date_published {
formatted
}
hour_published {
formatted
}
link
img_url
source {
title
}
favorite
like
read
node_id
}
}
It takes 5 seconds to return all the results. I analyzed the query.log file but I don't know what I can improve ?
This is the same request on the analyzer (translated thanks to the resolver I guess):
MATCH (
aRTICLE:
ARTICLE) RETURN
aRTICLE { .id , .silhouette_score ,cluster: head([(
aRTICLE)<-[:
CONTAINS_ARTICLE]-(
aRTICLE_cluster:
CLUSTER)
aRTICLE_cluster { .cluster_id ,node_id: apoc.cypher.runFirstColumn("RETURN ID(this)", {this: aRTICLE_cluster}, false), .percent_articles_gt_ts }]) , .title , .sentence ,date_published: { formatted: toString(
aRTICLE.date_published) },hour_published: { formatted: toString(
aRTICLE.hour_published) }, .link , .img_url ,source: head([(
aRTICLE)-[:
HAS_SOURCE]->(
aRTICLE_source:
SOURCE)
aRTICLE_source{ .title }]) , .favorite , .like , .read ,node_id: apoc.cypher.runFirstColumn("RETURN ID(this)", {this: aRTICLE}, false)} AS
aRTICLE LIMIT toInteger($first)
I don't know what to analyze in the query log analyzer to see if my request is okay or not
06-16-2021 12:51 PM
Does it return all 5000 items?.. If so, why don't you paginate your query and return the items as small bites, perhaps 20 items per request.
All the sessions of the conference are now available online