Hello guys,
I would like to speed up the following use case, not sure how to do it:
I have a Vertex of Users and a Vertex of Articles
Users visit articles.
I want to get the list of non yet visited articles for a given user.
So I do:
select @rid from indexvaluesdesc:Article.publishDate where @rid = (select out('Visit') from User where guid = 'f60c1880-4c45-5efc-88cb-a54ed9a030bb') limit 1
which is rather slow (500ms) ti give me #13:0
select out('Visit') from User where guid = 'f60c1880-4c45-5efc-88cb-a54ed9a030bb' gives me 15 @rid and is fast
Note that the article has been inserted in the cluster in the publishDate desc order, so #13:0 is the latest.
When I do:
select @rid from Article where @rid not in (select out('Visit') from User where guid = 'f60c1880-4c45-5efc-88cb-a54ed9a030bb') limit 1
it gives me the response #13:0 in 17ms
Yet I need the index as my articles won't always be inserted in this order and the cluster can grow pretty big, (right now around 500 000 records) and most articles won't have been visited for a user
Any idea how I could do that?
Thanks