A Reproducible Benchmark for Vector-Relational Hybrid Queries in RAG Databases

DOI:

https://doi.org/10.63646/XYXR1140

Keywords:

Vector databases, hybrid query processing, approximate nearest-neighbor search, retrieval-augmented generation, benchmarking, reproducibility, data infrastructure

Abstract

Retrieval-augmented generation (RAG) systems increasingly issue hybrid queries that combine approximate nearest- neighbor (ANN) search over learned embeddings with selective relational predicates over structured attributes. Although individual vector indexes and relational operators are each well studied, the engineering problem of executing them together under a single latency budget remains poorly characterized, and existing ANN benchmarks ignore attribute filtering altogether. We present VR-Bench, a reproducible benchmark for vector-relational hybrid queries. VR-Bench isolates a concrete and consequential engineering failure that we call the selectivity valley: pre-filtering wins when predicates are highly selective, post-filtering wins when they are permissive, and both degrade sharply in the intermediate selectivity band that dominates real workloads. We formalize the hybrid query, specify a system architecture and relational schema, and define five workload classes, five datasets spanning 8M to 100M vectors, and a metric suite covering recall, throughput, tail latency, build cost, and memory. We evaluate four execution strategies (pre-filter, post-filter, block/filtered-graph, and a cost-based router) across five production systems. The router recovers 92 to 98 percent of the best achievable throughput across the full selectivity range while holding recall at the 0.95 target, whereas post-filtering loses up to 27 recall points on highly selective queries. Every result ships with pinned containers, seeded workloads, an oracle, a data dictionary, and a public artifact, so that each figure in this paper can be regenerated end to end with a single command.

How to Cite

Chen, Z. (2026). A Reproducible Benchmark for Vector-Relational Hybrid Queries in RAG Databases. DATAMIND, 4(3), 23-39. https://doi.org/10.63646/XYXR1140

References

Andoni, A., & Indyk, P. (2008). Near-optimal hashing algorithms for approximate nearest neighbor in high dimensions. Communications of the ACM, 51(1), 117–122. https://doi.org/10.1145/1327452.1327494

Andoni, A., & Razenshteyn, I. (2015). Optimal data-dependent hashing for approximate near neighbors. In Proceedings of the 47th Annual ACM Symposium on Theory of Computing (STOC '15) (pp. 793–801). https://doi.org/10.1145/2746539.2746553

Aumüller, M., Bernhardsson, E., & Faithfull, A. (2020). ANN-Benchmarks: A benchmarking tool for approximate nearest neighbor algorithms. Information Systems, 87, 101374. https://doi.org/10.1016/j.is.2019.02.006

Azizi, I., Echihabi, K., & Palpanas, T. (2023). ELPIS: Graph-based similarity search for scalable data science. Proceedings of the VLDB Endowment, 16(6), 1548–1559. https://doi.org/10.14778/3583140.3583166

Bentley, J. L. (1975). Multidimensional binary search trees used for associative searching. Communications of the ACM, 18(9), 509–517. https://doi.org/10.1145/361002.361007

Gollapudi, S., Karia, N., Sivashankar, V., Krishnaswamy, R., Begwani, N., Raz, S., Lin, Y., Zhang, Y., Mahapatro, N., Srinivasan, P., Singh, A., & Simhadri, H. V. (2023). Filtered-DiskANN: Graph algorithms for approximate nearest neighbor search with filters. In Proceedings of the ACM Web Conference 2023 (WWW '23) (pp. 3406–3416). https://doi.org/10.1145/3543507.3583552

Indyk, P., & Motwani, R. (1998). Approximate nearest neighbors: Towards removing the curse of dimensionality. In Proceedings of the 30th Annual ACM Symposium on Theory of Computing (STOC '98) (pp. 604–613). https://doi.org/10.1145/276698.276876

Jagadish, H. V., Ooi, B. C., Tan, K.-L., Yu, C., & Zhang, R. (2005). iDistance: An adaptive B+-tree based indexing method for nearest neighbor search. ACM Transactions on Database Systems, 30(2), 364–397. https://doi.org/10.1145/1071610.1071612

Jégou, H., Douze, M., & Schmid, C. (2011). Product quantization for nearest neighbor search. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33(1), 117–128. https://doi.org/10.1109/TPAMI.2010.57

Jégou, H., Tavenard, R., Douze, M., & Amsaleg, L. (2011). Searching in one billion vectors: Re-rank with source coding. In 2011 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) (pp. 861–864). https://doi.org/10.1109/ICASSP.2011.5946540

Johnson, J., Douze, M., & Jégou, H. (2019). Billion-scale similarity search with GPUs. IEEE Transactions on Big Data, 7(3), 535– 547. https://doi.org/10.1109/TBDATA.2019.2921572

Karpukhin, V., Oğuz, B., Min, S., Lewis, P., Wu, L., Edunov, S., Chen, D., & Yih, W. (2020). Dense passage retrieval for open- domain question answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP) (pp. 6769–6781). https://doi.org/10.18653/v1/2020.emnlp-main.550

Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Küttler, H., Lewis, M., Yih, W., Rocktäschel, T., Riedel, S., & Kiela, D. (2020). Retrieval-augmented generation for knowledge-intensive NLP tasks. Advances in Neural Information Processing Systems, 33, 9459–9474.

Li, C., Zhang, M., Andersen, D. G., & He, Y. (2020). Improving approximate nearest neighbor search through learned adaptive early termination. In Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data (pp. 2539– 2554). https://doi.org/10.1145/3318464.3380600

Li, J., Liu, X., Yin, J., & others. (2018). A general and efficient querying method for learning to hash. In Proceedings of the 2018 ACM SIGMOD International Conference on Management of Data (pp. 1333–1347). https://doi.org/10.1145/3183713.3183750

Li, W., Zhang, Y., Sun, Y., Wang, W., Li, M., Zhang, W., & Lin, X. (2020). Approximate nearest neighbor search on high dimensional data — Experiments, analyses, and improvement. IEEE Transactions on Knowledge and Data Engineering, 32(8), 1475–1488. https://doi.org/10.1109/TKDE.2019.2909204

Li, Z., Mozafari, B., & others. (2025). SIEVE: Effective filtered vector search with collection of indexes. Proceedings of the VLDB Endowment, 18(11), 4723–4736. https://doi.org/10.14778/3749646.3749725

Malkov, Y. A., & Yashunin, D. A. (2020). Efficient and robust approximate nearest neighbor search using hierarchical navigable small world graphs. IEEE Transactions on Pattern Analysis and Machine Intelligence, 42(4), 824–836. https://doi.org/10.1109/TPAMI.2018.2889473

Malkov, Y., Ponomarenko, A., Logvinov, A., & Krylov, V. (2014). Approximate nearest neighbor algorithm based on navigable small world graphs. Information Systems, 45, 61–68. https://doi.org/10.1016/j.is.2013.10.006

Manolescu, I., Afanasiev, L., Arion, A., Dittrich, J., Manegold, S., Polyzotis, N., Schnaitter, K., Senellart, P., Zoupanos, S., & Shasha, D. (2008). The repeatability experiment of SIGMOD 2008. ACM SIGMOD Record, 37(1), 39–45. https://doi.org/10.1145/1374780.1374791

Matsui, Y., Uchida, Y., Jégou, H., & Satoh, S. (2018). A survey of product quantization. ITE Transactions on Media Technology and Applications, 6(1), 2–10. https://doi.org/10.3169/mta.6.2

Pan, J. J., Wang, J., & Li, G. (2024). Survey of vector database management systems. The VLDB Journal, 33(5), 1591–1615. https://doi.org/10.1007/s00778-024-00864-x

Paparrizos, J., Edian, I., Liu, C., Elmore, A. J., & Franklin, M. J. (2022). Fast adaptive similarity search through variance-aware quantization. In 2022 IEEE 38th International Conference on Data Engineering (ICDE) (pp. 2969–2983). https://doi.org/10.1109/ICDE53745.2022.00268

Reimers, N., & Gurevych, I. (2019). Sentence-BERT: Sentence embeddings using Siamese BERT-networks. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP) (pp. 3982–3992). https://doi.org/10.18653/v1/D19-1410

Simhadri, H. V., Williams, G., Aumüller, M., Douze, M., Babenko, A., Baranchuk, D., Chen, Q., Hosseini, L., Krishnaswamy, R., Srinivasa, G., Subramanya, S. J., & Wang, J. (2022). Results of the NeurIPS '21 challenge on billion-scale approximate nearest neighbor search. In Proceedings of Machine Learning Research (Vol. 176, pp. 177–189).

Subramanya, S. J., Devvrit, F., Simhadri, H. V., Krishnawamy, R., & Kadekodi, R. (2019). DiskANN: Fast accurate billion-point nearest neighbor search on a single node. Advances in Neural Information Processing Systems, 32.

Wang, G., Zhang, K., Wang, Y., & others. (2024). MeTMaP: Metamorphic testing for detecting false vector matching problems in LLM augmented generation. In Proceedings of the 2024 IEEE/ACM First International Conference on AI Foundation Models and Software Engineering (FORGE) (pp. 12–23). https://doi.org/10.1145/3650105.3652297

Wang, J., Yi, X., Guo, R., Jin, H., Xu, P., Li, S., Wang, X., Guo, X., Li, C., Xu, X., Yu, K., Yuan, Y., Zou, Y., Long, J., Cai, Y., Li, Z., Zhang, Z., Mo, Y., Gu, J., … Xie, C. (2021). Milvus: A purpose-built vector data management system. In Proceedings of the 2021 ACM SIGMOD International Conference on Management of Data (pp. 2614–2627). https://doi.org/10.1145/3448016.3457550

Wang, J., Zhang, T., Song, J., Sebe, N., & Shen, H. T. (2018). A survey on learning to hash. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(4), 769–790. https://doi.org/10.1109/TPAMI.2017.2699960

Wang, M., Xu, X., Yue, Q., & Wang, Y. (2021). A comprehensive survey and experimental comparison of graph-based approximate nearest neighbor search. Proceedings of the VLDB Endowment, 14(11), 1964–1978. https://doi.org/10.14778/3476249.3476255

Wei, C., Wu, B., Wang, S., Lou, R., Zhan, C., Li, F., & Cai, Y. (2020). AnalyticDB-V: A hybrid analytical engine towards query fusion for structured and unstructured data. Proceedings of the VLDB Endowment, 13(12), 3152–3165. https://doi.org/10.14778/3415478.3415541

Wei, J., Lee, X., Liao, Z., Palpanas, T., & Peng, B. (2025). Subspace collision: An efficient and accurate framework for high-dimensional approximate nearest neighbor search. Proceedings of the ACM on Management of Data, 3(1), Article 79. https://doi.org/10.1145/3709729

Yang, W., Li, T., Fang, G., & Wei, H. (2020). PASE: PostgreSQL ultra-high-dimensional approximate nearest neighbor search extension. In Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data (pp. 2241–2253). https://doi.org/10.1145/3318464.3386131