Skip to content

Count two-hop patterns grouped by a node from degrees #136

Open

Description

@prrao87

Problem

RETURN count(*) over two hops is counted from node degrees, but a grouped count is counted that way in one shape only. #113 handles RETURN m.name, count(x) over (x)-[:R]-(m)...: it counts the first hop per m in place, but the rest of the pattern still emits one row per match. Other groupings keep the join plan and build every path:

  • by the root of a two-hop pattern: MATCH (a)-[:R]->(b)-[:S]->(c) RETURN a.id, count(*);
  • by the middle node, RETURN b.id, count(*), which counts only the first hop per b, and only with the CSR.

Idea

Both keep the two-hop count's conditions: each WHERE condition reads one hop, and the corrections for same-type hops apply per group.

Split from #78.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions