Graph problems: connect by NOCYCLE prior replacement in SQL server?

后端 未结 1 1023
谎友^
谎友^ 2021-01-11 21:19

question:

I have the following (directed) graph: \"Graph\"

And this table:

CREATE TABLE         


        
相关标签:
1条回答
  • 2021-01-11 22:01

    To improve select performance store possible paths between nodes in a permanent table

    TABLE T_Hops_Path
    (
      FromNode,
      ToNode,
      HopCount,
      TotalDistance
    )
    

    If your tree structure does not change often you can write a stored procedure that generates this table every N hours.

    0 讨论(0)
提交回复
热议问题