Using match and exists to check if a relationship exists

Hi Team,

I'd like to check if a (User) node has a -[:relationship]-> with Group node. Should I just use MATCH or both MATCH and EXISTS to check if a relationship exists between to nodes with given unique ID.

Thanks,
Arun

Wow! This is a perfect solution. However, it may be slow when we have many nodes and relationships. Should we add an index on relationships or nodes with the name to make it faster?