PrivateSQL: A Differentially Private SQL Query Engine

Ios Kotsogiannis, Yuchao Tao, Xi He, Maryam Fanaeepour, Ashwin Machanavajjhala, Michael Hay, Gerome MiklauPVLDB 2019

TL;DR

This paper introduces PrivateSQL, a novel system for performing differentially private SQL queries on relational databases. It addresses the challenge of applying differential privacy to complex, multi-table schemas and workloads, offering a way for analysts to query sensitive data without requiring deep privacy expertise.

What Problem Does This Paper Address?

Differential privacy (DP) is a powerful tool for protecting sensitive data while allowing analysis. However, existing DP techniques and systems primarily focus on flat tables and simple queries. Applying DP to relational databases with multiple tables, foreign key constraints, and complex SQL queries (like JOINS and GROUPBY) is significantly more challenging. Furthermore, ensuring a fixed privacy budget across an entire workload of queries, rather than just a single query, is a critical but difficult problem. This gap leaves many real-world data analysis scenarios unprotected or requires specialized privacy experts for each application.

Methods

PrivateSQL tackles these challenges with several key innovations:

  • Multi-resolution Privacy: It extends DP to multi-relational schemas by allowing data owners to specify a "primary private relation" and defining privacy policies at different granularities (e.g., protecting individual records vs. entire households). This is achieved through a novel generalization of DP for relational data that accounts for foreign key constraints.
  • View-based Synopsis Generation: Instead of directly querying the private database, PrivateSQL generates "synopses" – compressed, differentially private summaries – for a carefully selected set of "views" over the base relations. These views are chosen to efficiently answer the expected query workload.
  • Workload-Aware Query Answering: Queries are rewritten to operate on these synopses, ensuring that the entire workload is answered within a fixed privacy budget. This is crucial because answering queries sequentially without this approach would lead to privacy budget depletion.
  • Constraint-Oblivious Sensitivity Analysis and Truncation: To accurately bound the privacy loss, PrivateSQL employs a rule-based system (SENSCALC) to estimate query sensitivity, even in complex relational schemas. It also uses "truncation" to limit the impact of high-sensitivity data points, preventing excessive noise injection.
  • Semi-join Rewrite: For complex privacy policies involving secondary private relations, a semijoin rewrite technique is used to accurately capture transitive dependencies and ensure correct sensitivity bounds.

Datasets

The paper evaluates PrivateSQL on:

  • Synthetic U.S. Census Datasets: CENSUSPM and CENSUSNC, derived from public Census data, with schemas including PERSON and HOUSEHOLD relations.
  • TPC-H Benchmark: A standard database benchmark with 8 relations, scaled to different sizes.

The authors also constructed representative workloads (W1, W2, W3) based on these datasets, including complex SQL queries with joins and correlated subqueries, and queries inspired by U.S. Census Summary File 1.

Key Insights and Ideas

  • Privacy is Contextual: The paper highlights that privacy needs vary. Protecting an individual's record has different implications than protecting an entire household's data, and PrivateSQL's multi-resolution privacy addresses this.
  • Views are Key to Workload Privacy: By pre-computing synopses for carefully chosen views, PrivateSQL can answer many queries efficiently without further privacy cost, effectively "spending" the privacy budget upfront.
  • Sensitivity Calculation is Hard, but Solvable: Accurately determining how much a query's output can change due to a single data point's removal in a relational database is complex. PrivateSQL's SENSCALC and semijoin rewrite provide robust methods for this.
  • Truncation is a Trade-off: While truncation helps bound sensitivity and reduce noise, it introduces bias. The paper empirically explores this bias-variance trade-off.

Key Results

  • PrivateSQL offers significantly better error rates than prior work (like FLEX) for workload answering, achieving at least 1,000x better error rates for 50% of queries on a real-world dataset.
  • For the Person policy on CENSUSNC, PrivateSQL achieves <2% relative error for 75% of W1 queries and <6% for 50% of W2 queries.
  • The Household policy, which is more complex, leads to higher error rates but still provides usable results.
  • The system demonstrates strong performance on the TPC-H benchmark as well.
  • The SENSCALC sensitivity analysis provides tighter bounds than existing methods, leading to reduced error.

Limitations and Future Work

  • Query Expressivity: Currently, PrivateSQL primarily supports COUNT queries. Extending support to other aggregate functions like SUM, AVG, MEDIAN, and QUANTILE is a key area for future work.
  • Query Answering Efficiency: While PrivateSQL answers queries accurately, further improvements in the query answering phase itself are possible by leveraging existing view-based query answering techniques.
  • Truncation Bias: The paper acknowledges that truncation introduces bias and empirically studies this trade-off, suggesting that a truncation value between 4 and 6 offers a good balance.
  • Data Owners' Expertise: While PrivateSQL aims to lower the barrier for non-experts, selecting optimal representative workloads and privacy policies still requires some understanding.

Summary updated

BibTeX
@article{kotsogiannis2019privatesql,
  author = {Ios Kotsogiannis and Yuchao Tao and Xi He and Maryam Fanaeepour and Ashwin Machanavajjhala and Michael Hay and Gerome Miklau},
  title = {{PrivateSQL: A Differentially Private SQL Query Engine}},
  journal = {Proc. VLDB Endow.},
  year = {2019},
  url = {https://openreview.net/forum?id=xH-LrugXtpf},
}
Figure