Query Cost Model Calibration in Confidential Virtual Machines Conference: Workshop on Secure and Private Data Management; May 31-June 05, 2026; Bengaluru, India Workshop on Secure and Private Data Management (SeQureDB ’26), May 31-June 05, 2026, Bengaluru, India DOI: 10.1145/3807894.3810270 ISBN: 979-8-4007-2219-6/2026/05
Qihan Zhang, Mengyuan Li, Ibrahim Sabek · 2026
Read Query Cost Model Calibration in Confidential Virtual Machines Conference: Workshop on Secure and Private Data Management; May 31-June 05, 2026; Bengaluru, India Workshop on Secure and Private Data Management (SeQureDB ’26), May 31-June 05, 2026, Bengaluru, India DOI: 10.1145/3807894.3810270 ISBN: 979-8-4007-2219-6/2026/05 by Qihan Zhang, Mengyuan Li, Ibrahim Sabek (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2606-26385.txt.
Introduction
Qihan Zhang, Mengyuan Li, and Ibrahim Sabek fix database slowness inside confidential virtual machines, secure cloud machines that protect data while it is in use. Queries there run much slower than in ordinary virtual machines, and the authors trace the cause to the query optimizer.
Optimizers still price query plans using cost assumptions from unencrypted machines, which no longer match reality. The team's light calibration models two overhead sources, data movement and address-translation effects, using simple stand-ins the optimizer already tracks. Experiments recover up to 48 percent of lost performance and sometimes beat the unencrypted baseline outright.
Catalog record
| CREATOR | Qihan Zhang, Mengyuan Li, Ibrahim Sabek |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 24 KB |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2606.26385
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Query Cost Model Calibration in Confidential Virtual Machines Conference: Workshop on Secure and Private Data Management; May 31-June 05, 2026; Bengaluru, India Workshop on Secure and Private Data Management (SeQureDB ’26), May 31-June 05, 2026, Bengaluru, India DOI: 10.1145/3807894.3810270 ISBN: 979-8-4007-2219-6/2026/05 Qihan Zhang, Mengyuan Li, Ibrahim Sabek Abstract . With the growing adoption of Confidential Computing, running databases in confidential virtual machines (CVMs) such as AMD SEV-SNP has become an attractive way to protect sensitive cloud data with minimal changes to legacy DBMSs. However, analytical queries in such CVMs often suffer substantial overhead, and prior database work has largely stopped at benchmarking these slowdowns rather than optimizing them. We show that this problem stems from a hardware–software mismatch: query optimizers still rely on KVM-oriented (non-encrypted VM) cost assumptions that no longer hold in CVMs. To address this, we propose a lightweight CVM-aware cost calibration. It models two dominant sources of optimizer-facing overhead: data-movement and RMP-related translation using simple physical proxies already available to the optimizer. Experiments show that the calibration significantly narrows the KVM/CVM performance gap, recovering up to 48% performance and even outperforming the KVM baseline on some workloads. † † cc-license: by 1. Introduction As cloud infrastructure increasingly hosts critical database workloads on third-party platforms ( 4 ; 12 ; 42 ) , protecting sensitive data without sacrificing performance has become a central challenge ( 10 ; 15 ; 36 ) . Confidential computing addresses this by protecting data in use within Trusted Execution Environments (TEEs). TEEs broadly fall into two classes: process-based designs such as Intel SGX ( 11 ) , which offer strong isolation but often require intrusive application changes, and VM-based designs such as AMD SEV-SNP ( 41 ) , which protect entire virtual machines with better compatibility but a larger trusted software stack. We focus on the latter, namely Confidential Virtual Machines (CVMs), such as AMD SEV-SNP, because they let legacy DBMSs like PostgreSQL ( 38 ) run with no source-code change, making them attractive for practical deployment ( 35 ; 32 ; 5 ; 3 ; 21 ) . Throughout the paper, we use CVM to denote a hardware-protected confidential VM, and KVM to denote the conventional unencrypted VM baseline. However, this convenience comes with non-trivial overheads in memory protection, address translation, and I/O ( 32 ; 1 ) . Prior studies on DBMSs in CVMs mainly focus on benchmarking these penalties ( 28 ; 25 ; 26 ; 6 ; 39 ) . While they show that CVMs can substantially slow down database workloads, they do not examine how such overhead distorts core DBMS components, especially the query optimizer. Since optimizers choose among scan paths, join methods, and execution structures by comparing estimated costs ( 40 ; 16 ; 17 ) , a CVM-unaware cost model can misrank operators and produce poor plans. This creates a hardware–software mismatch: cost estimations for KVMs no longer hold in CVMs. Focusing on AMD SEV-SNP, we attribute this mismatch to two architectural properties of CVM (empirically evaluated in Section 2 ). First, data movement in a CVM more often involves encryption-related processing and extra copying across the storage–memory hierarchy. This gives rise to data movement overhead , including bounce-buffer copying on I/O paths and the higher cost of transferring large volumes of encrypted data under memory- or bandwidth-intensive execution ( 33 ; 34 ) . Second, SEV-SNP introduces the Reverse Map Table (RMP), a hardware metadata structure that validates page ownership and access permissions during address translation (i.e., mapping virtual addresses to physical pages). This gives rise to RMP overhead , which raises the cost of memory-access paths triggering page-table walks and metadata checks, making random-access operators such as index scans and probe-heavy nested-loops more expensive ( 41 ; 2 ; 45 ; 44 ) . These penalties are highly non-uniform across operators, so plans that are reasonable in KVM can become poor choices in SEV-SNP. To address this problem, we propose a lightweight CVM-aware calibration centered on the query optimizer’s cost model . Rather than redesigning the execution engine, it adjusts operator costing so that the DBMS better reflects the true relative prices of scan paths and join strategies in SEV-SNP. The key idea is to use simple physical proxies already exposed to the optimizer, such as pages touched, tuple volume, and memory usage, to inject targeted penalties for RMP-sensitive random access and data movement. This preserves the optimizer’s architecture while making plan decisions more faithful to CVMs. This calibration introduces essentially negligible overhead, as it only lightly modifies the optimizer’s cost estimation logic without adding new execution-time mechanisms. We implement the calibration in PostgreSQL and evaluate it on standard OLAP benchmarks (JOB ( 23 ) , CEB ( 37 ) , Stack ( 30 ) , and TPC-DS ( 8 ) ), saving at most 48% execution time in CVMs. In summary, our contributions are: (1) We show that RMP and data movement overheads explain the main optimizer-facing performance distortions relevant to query planning. Considering them in the cost model can improve DBMS performance in CVMs. (2) We propose a CVM-calibrated cost model, which is a practical CVM-aware cost-model calibration extension that significantly narrows the KVM/CVM performance gap and can even outperform the KVM baseline. (3) We implement the CVM-aware calibration inside PostgreSQL for CVMs, recovering up to 48% performance and even outperforming the non-encrypted baseline on some workloads. 2. Motivation SEV-SNP introduces at least two optimizer-relevant penalties, both rooted in its security mechanisms. The first is data movement cost . In a CVM, transfers along the storage–memory path are no longer plain copies: they typically involve encrypted guest memory, additional I/O copying, and synchronization through intermediate software or hardware layers. A key mechanism is the bounce buffer , a shared staging area used when data cannot be moved directly between devices and protected guest memory ( 33 ) . Since different query plans stress this path differently, the resulting overhead is strongly plan-dependent. The second is RMP-check cost . SEV-SNP protects guest memory with additional metadata and validation, commonly tied to the Reverse Map Table (RMP) ( 41 ; 45 ) . On translation-related events such as TLB or cache misses, the processor may perform page-table walks and protected-memory checks before completing the access. As a result, SEV-SNP can raise address-translation and memory-access latency even when the query plan is identical between KVM and CVM. Figure 1 . Evidence of data movement cost in SEV-SNP. Hash join induces denser bounce-buffer activity, while nested-loop join induces less frequent but burstier activity. Experimental Evidence. Figure 1 and Table 1 show that both penalties are observable. To expose the data movement cost , we repeatedly run JOB ( 23 ) in SEV-SNP under two settings, hash-join-only and nested-loop-only (disable other join strategies), with all other settings unchanged. For each setting, we monitor bounce-buffer activity for 300 seconds, partition the trace into 1-second buckets, and record transferred bytes ( mapped bytes ) per bucket. The figure reveals clear operator-dependent movement patterns: hash join yields denser, more continuous activity, consistent with sustained movement during scans and hash build/probe phases, whereas nested loop is less frequent but more bursty, matching its operator behavior. This shows that SEV-SNP overhead is