Open kmcginnes opened 8 months ago
I believe that query could be improved significantly. That query appears to be counting the number of neighbours for the "new resource", grouped by the neighbour's class.
I don't see a need for it to have the subquery to select all of the neighbours, nor do I see a need for using DISTINCT
here. To the best of my knowledge, the only way that subquery could produce duplicate results would be if there were 2 duplicate statements of the form ?subject a ?class
. I don't believe that Neptune allows for duplicate statements (this should be verified).
Given this, I would expect a query such as this to perform much better and produce equivalent results:
SELECT ?class (COUNT(?class) AS ?count) {
?neighbour a ?class .
{ ?neighbour ?p <http://aws.amazon.com/neptune/csv2rdf/resource/414> }
UNION
{ <http://aws.amazon.com/neptune/csv2rdf/resource/414> ?p ?neighbour }
}
GROUP BY ?class
Possibly related to
Community Note
Describe the bug On a larger RDF database, when I add a resource from the search panel to the canvas it can take anywhere from 30 seconds to 10 minutes to complete. During this time no indication is given to the user that something is happening.
To Reproduce Steps to reproduce the behavior:
You can see the pending request in the browser's network tab.
Slow response
In this example, the request took 1.4 min to complete:
And here you can see there are not that many neighbors:
And here is the query that was executed:
Out of Memory Error
The query that was executed was:
This resulted in an out of memory error:
Expected behavior Adding a single resource to the canvas should not be slow or cause errors.