Query by partition in Vespa.ai

Viewed 109

When a query is issued, Vespa runs the query on all the content nodes (in the distribution group) and returns the results. I have two keys that are always present in the search query. Can I partition the data from the values of those keys, so that whenever I query Vespa knows where to look for instead of querying on all the content nodes?

2 Answers

In most cases you don't want to use attributes of the data to control distribution to content nodes because it will lead to uneven load on the nodes. Uneven load means increased cost (as your cost will be equal to the case where all nodes were as loaded as your most loaded node), and potentially operational problems (as adding nodes will not mitigate overload problems if you keep adding certain documents to the same node).

Usually the savings you might get from doing this are modest as it is very cheap to determine that there are no matches on a content node, and far from offsetting the disadvantages mentioned above. Exceptions might be if the query is very large (tensors with thousands of elements) or you would have a very large fan-out (hundreds of nodes) without this.

Related