TUDB-Labs / TuDB

A distributed graph database system (GDBMS)
https://tudb-labs.github.io/TuDB/
Apache License 2.0
9 stars 1 forks source link

Stop using physical rule JoinToExpandRule and remove relevant tests #336

Closed LianxinGao closed 2 years ago

LianxinGao commented 2 years ago

What changes were proposed in this pull request?

as title

Why are the changes needed?

This rule is used to deal with this kind of pattern of cypher:

match (A)-[r1]->(B)
match (B)-[r2]->(C)

The two match pattern have the same B, default logic will produce a join, this rule change join to expand(for each B, find it's C).

  1. This optimization rule is a temporary rule to handle LDBC queries, but without careful thought.

  2. This rule need a new physical plan PhysicalExpandFromNode but it has similar logic with PhysicalExpand, and I don't want to translate PhysicalExpandFromNode to execution plan, maybe there's a better way to do it.

  3. I used to think join was always an inefficient operator, but now I don't think so...

Does this PR introduce any user-facing change?

No