B-trees and LSM trees are graph-shaped data structures optimized for disk I/O. Query planning treats the join graph as a graph-theory problem — find a low-cost spanning tree of the relations.