Row-Level Security Filter Ordering for Leak-Safe Query Optimization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Row-level security filters in database systems are vulnerable to error messages that leak information about restricted rows, which can be exploited by malicious users, and enforcing these filters first to prevent leaks leads to sub-optimal query execution and performance degradation.

Innovation Solution

A query optimizer that classifies user filters into safe and unsafe categories, ensuring the row-level security filter executes before unsafe filters while optimizing the execution order of safe filters to maintain performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the row-level security filter is enforced first to prevent information leaks, then security reliability is improved, but query execution performance deteriorates

Engineering Contradiction:
Improvesecurity reliabilityVSAvoidquery execution performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments user filters into two categories: safe filters ( incapable of causing information leaks) and unsafe filters (capable of causing information leaks). This segmentation allows the system to apply different execution strategies to different filter types, enforcing security for unsafe filters while optimizing performance for safe filters.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements dynamic filter execution ordering based on filter classification. The query optimizer dynamically determines the execution order of filters based on their safety classification, allowing safe filters to execute before the security filter (improving performance) while ensuring unsafe filters execute after the security filter (maintaining security).

Inventive Principle:
Principle #15Dynamics

2Loss of information

If the security filter executes before user filters to prevent information leaks, then information security is improved, but query optimization flexibility deteriorates

Engineering Contradiction:
Improveinformation securityVSAvoidquery optimization flexibility
Core Design Contradiction:
Loss of informationVSAdaptability or versatility

Solution Approach 1:

The patent segments filters into safe and unsafe categories, allowing the query optimizer to apply different execution strategies. Safe filters can be executed in optimized positions (before security filter) while unsafe filters are executed in secure positions (after security filter), thus maintaining both information security and query optimization flexibility.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent changes the execution order parameter of filters based on their safety classification. By dynamically adjusting the execution order parameter for different filter types, the system maintains information security for unsafe filters while allowing query optimization for safe filters.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentEP4441649B1Performance optimizations for row-level security filters
Publication Date: 2026.03.04 GOOGLE LLC
  • EP4441649B1 patent drawingFigure 1
  • EP4441649B1 patent drawingFigure 2
  • EP4441649B1 patent drawingFigure 3

AI summary

A method (400) for optimizing a database query (20) includes receiving a database query from a user (12) requesting a database (158) to conditionally return one or more rows (152) stored at the database and characterizing one or more user filters (212U). Each user filter filters rows from the database. The method includes determining that a security filter (212S) restricts the user from accessing one or more rows of the database. For each respective user filter, the method includes classifying the respective user filter as a safe user filter (212US) incapable of reporting an error or an unsafe user filter (212UU) capable of reporting an error. The method also includes determining a filter execution order (172) of the one or more user filters and the security filter based on the classified one or more user filters and executing, using the determined filter execution order, the one or more user filters and the security filter.