Hi,
I took a look at the count store documentation and as I understand, it's the best solution to count high volume of nodes/relations but there is a limitation on the where clause.
It mentioned that workarounds will be discussed at the end of this topics but I didn't find any answers to my questions so I'm posting here to take your advice.
Let's suppose we have Movies with a unique property "name" and billions of Persons who can like a movie.
If I want to get all the Person who like matrix1, what's the best approach ?
MATCH (:Person)-[r:LIKE]->(:Movie {name : 'matrix1'})
RETURN count(r) as count
I was thinking about 2 workarounds to get fast like count :
- Use the property as a label (which should be used only once).
MATCH (:Person)-[r:LIKE]->(:Matrix1)
RETURN count(r) as count
- Store the count store on the property. The idea is to increment a likeCounter property on the node each time a relation is made.
Do you think one of these solutions works better than the other ? Do you have a better idea ? I would be glad to know your opinion.