← Latest papers
💻 computer science

Query Cost Model Calibration in Confidential Virtual Machines

This paper addresses the performance degradation of analytical queries in Confidential Virtual Machines by identifying a hardware-software mismatch in query optimizers and proposing a lightweight, CVM-aware cost calibration that significantly narrows the performance gap with non-encrypted environments, recovering up to 48% of lost performance.

Original authors: Qihan Zhang, Mengyuan Li, Ibrahim Sabek

Published 2026-06-26
📖 4 min read☕ Coffee break read

Original authors: Qihan Zhang, Mengyuan Li, Ibrahim Sabek

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a very secure, high-tech vault (a Confidential Virtual Machine, or CVM) where you store your most sensitive data. This vault is designed so that even the building manager (the cloud provider) can't peek inside. However, there's a catch: getting things in and out of this vault is slower and more complicated than getting them from a regular, unlocked room (a standard KVM).

The problem isn't just that the vault is slow; it's that the manager (the database's Query Optimizer) doesn't realize it.

The Problem: A Map for the Wrong Terrain

Think of the database manager as a GPS navigation system.

  • The Old Map (KVM): For years, the GPS has been using a map designed for open highways. It assumes that driving a car (moving data) is fast and that checking your location (memory access) is instant.
  • The New Terrain (CVM): Now, the car is driving through a mountainous, encrypted tunnel system. Every time it turns, it has to stop and show a special ID card (RMP check), and every time it moves cargo, it has to unpack it, move it through a secure airlock, and repack it (data movement/bounce buffers).

Because the GPS still uses the "open highway" map, it keeps suggesting the fastest-looking routes. But in the mountain tunnel, those "fast" routes are actually the slowest because they involve too many ID checks or too much cargo handling. The database ends up picking the wrong plan, making the whole system sluggish.

The Solution: Recalibrating the GPS

The authors of this paper didn't try to rebuild the mountain tunnel or invent a faster car. Instead, they recalibrated the GPS.

They created a new, lightweight "cost model" that tells the database manager: "Hey, in this secure vault, moving a lot of data at once is expensive, and jumping around randomly (like looking up specific items in a list) is even more expensive because of the ID checks."

They added two simple "penalties" to the manager's calculations:

  1. The "Moving Box" Penalty: If a plan requires moving a huge pile of data (like a Hash Join), the manager now knows this will trigger extra "airlock" steps and adds a time cost to that plan.
  2. The "ID Check" Penalty: If a plan requires jumping around randomly to find data (like an Index Scan or Nested Loop), the manager knows this will trigger many "ID card" checks (RMP checks) and adds a time cost to that plan.

The Results: Finding the Real Fast Lane

By updating the GPS with these new rules, the database manager started choosing different routes. Instead of picking the "fast highway" route that turned out to be a traffic jam in the tunnel, it picked slightly longer routes that were actually smoother in the secure environment.

What happened?

  • Faster Queries: In their tests, this simple adjustment made queries run up to 48% faster in the secure vault.
  • Beating the Unlocked Room: In some cases, the optimized secure vault was actually faster than the standard, unlocked room! This sounds counterintuitive, but it happened because the standard room was using a "bad plan" (based on the old map), while the secure vault was using a "smart plan" (based on the new, accurate map).

In a Nutshell

The paper shows that you don't need to completely redesign secure computer systems to make them fast. You just need to teach the database's decision-maker (the optimizer) that the rules of the road have changed. By giving it a few simple, realistic "costs" for moving data and checking IDs in a secure environment, the system automatically finds better ways to work, closing the performance gap between secure and standard computing.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →