Database / Weaviate Vector database Interview questions
Why should you avoid excessive cross-reference traversal in a single query?
Each cross-reference traversal in a query effectively requires Weaviate to resolve a link from one object to another, potentially in a completely different collection, which is a fundamentally different operation from evaluating a property directly on the object already being searched. Chaining several of these traversals together in one query (following a reference, then a reference from that result, and so on) compounds this cost with each additional hop.
Unlike a property-based filter or the vector/BM25 search itself, which Weaviate's core indexes are specifically optimized to handle efficiently at scale, multi-hop cross-reference resolution doesn't benefit from those same optimizations, so a query with several chained traversals can become significantly slower than an equivalent query against a more denormalized schema where the same information lives directly on one object's own properties.
This is exactly the reasoning behind Weaviate's guidance to minimize cross-reference use in the first place: a schema designed with search performance in mind generally embeds frequently-needed related information directly into an object rather than requiring a query to chain through several linked collections to assemble the same answer, reserving cross-references for relationships that are either genuinely impractical to denormalize or rarely traversed in performance-sensitive query paths.
More Related questions...