PLOP: Cost-Based Placement of Semantic Operators in Hybrid Query Plans

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Mang, Qiuyang, Xiang, Yufan, Zhou, Hangrui, He, Runyuan, Yu, Jiaxiang, Li, Hanchen, Parameswaran, Aditya, Cheung, Alvin
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918466556002304
author Mang, Qiuyang
Xiang, Yufan
Zhou, Hangrui
He, Runyuan
Yu, Jiaxiang
Li, Hanchen
Parameswaran, Aditya
Cheung, Alvin
author_facet Mang, Qiuyang
Xiang, Yufan
Zhou, Hangrui
He, Runyuan
Yu, Jiaxiang
Li, Hanchen
Parameswaran, Aditya
Cheung, Alvin
contents Recent database systems have introduced semantic operators that leverage large language models (LLMs) to filter, join, and project over structured data using natural language predicates. In practice, these operators are combined with traditional relational operators, e.g., equi-joins, producing hybrid query plans whose execution cost depends on both expensive LLM calls and conventional database processing. A key optimization question is where to place each semantic operator relative to the relational operators in the plan: placing them earlier reduces the data that subsequent operators process, but requires more LLM calls; placing them later reduces LLM calls through deduplication, but forces relational operators to process larger intermediate data. Existing systems either ignore this placement question or apply simple heuristics without considering the full cost trade-off. We present PLOP, a plan-level optimizer for hybrid semantic-relational queries. PLOP reduces hybrid query planning to semantic filter placement via two equivalence-preserving rewrites. We prove that deferring all semantic filters to the latest possible position minimizes LLM invocations under function caching, but show that this can cause relational processing costs to dominate on complex multi-table queries. To balance LLM cost against relational cost, PLOP uses a dynamic-programming-based cost model that finds the placement minimizing their weighted sum. On 44 semantic SQL queries across five schemas and two benchmarks, PLOP achieves up to 1.5$\times$ speedup and 4.29$\times$ cost reduction while maintaining high output quality: an average F1 of 0.85 against the unoptimized baseline and 0.84 against human-annotated ground truth on SemBench. Overall, PLOP achieves a significant cost reduction while preserving the highest accuracy among six publicly available systems.
format Preprint
id arxiv_https___arxiv_org_abs_2604_09944
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle PLOP: Cost-Based Placement of Semantic Operators in Hybrid Query Plans
Mang, Qiuyang
Xiang, Yufan
Zhou, Hangrui
He, Runyuan
Yu, Jiaxiang
Li, Hanchen
Parameswaran, Aditya
Cheung, Alvin
Databases
Recent database systems have introduced semantic operators that leverage large language models (LLMs) to filter, join, and project over structured data using natural language predicates. In practice, these operators are combined with traditional relational operators, e.g., equi-joins, producing hybrid query plans whose execution cost depends on both expensive LLM calls and conventional database processing. A key optimization question is where to place each semantic operator relative to the relational operators in the plan: placing them earlier reduces the data that subsequent operators process, but requires more LLM calls; placing them later reduces LLM calls through deduplication, but forces relational operators to process larger intermediate data. Existing systems either ignore this placement question or apply simple heuristics without considering the full cost trade-off. We present PLOP, a plan-level optimizer for hybrid semantic-relational queries. PLOP reduces hybrid query planning to semantic filter placement via two equivalence-preserving rewrites. We prove that deferring all semantic filters to the latest possible position minimizes LLM invocations under function caching, but show that this can cause relational processing costs to dominate on complex multi-table queries. To balance LLM cost against relational cost, PLOP uses a dynamic-programming-based cost model that finds the placement minimizing their weighted sum. On 44 semantic SQL queries across five schemas and two benchmarks, PLOP achieves up to 1.5$\times$ speedup and 4.29$\times$ cost reduction while maintaining high output quality: an average F1 of 0.85 against the unoptimized baseline and 0.84 against human-annotated ground truth on SemBench. Overall, PLOP achieves a significant cost reduction while preserving the highest accuracy among six publicly available systems.
title PLOP: Cost-Based Placement of Semantic Operators in Hybrid Query Plans
topic Databases
url https://arxiv.org/abs/2604.09944