Row-Level Security Filter Ordering for Leak-Free 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 distinct 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, executing safe filters before the security filter to optimize performance while executing unsafe filters after the security filter to maintain security reliability.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent applies different execution ordering rules to different types of filters based on their local characteristics. Safe filters are positioned earlier in the execution order before the security filter, while unsafe filters are positioned later after the security filter. This local quality approach allows optimization in safe areas without compromising security in critical areas.

Inventive Principle:
Principle #3Local quality

2Loss of information

If the security filter is placed earlier in the execution order, then information leak prevention is improved, but query optimization flexibility deteriorates

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

Solution Approach 1:

The patent segments the filter execution plan into multiple stages based on filter safety classification. Safe filters are executed in an optimization-friendly order before the security filter, while unsafe filters are executed after. This segmentation restores flexibility to query optimization by allowing the optimizer to rearrange safe filters without compromising security.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent changes the execution order parameter dynamically based on the safety classification of each filter. By adjusting the position of filters in the execution plan according to their safety status, the system maintains both security requirements and optimization flexibility.

Inventive Principle:
Principle #35Parameter changes

3Speed

If unsafe user filters are executed before the security filter, then query execution speed is improved, but information security deteriorates

Engineering Contradiction:
Improvequery execution speedVSAvoidinformation security
Core Design Contradiction:
SpeedVSObject-affected harmful factors

Solution Approach 1:

The patent segments filters into safe and unsafe categories and enforces a specific execution order: safe filters before the security filter, and unsafe filters after. This segmentation allows unsafe filters to be executed at optimal positions without compromising security, as the security filter has already filtered out restricted rows before unsafe filters process the data.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary classification of filters into safe and unsafe categories before determining the execution order. This preliminary action enables the system to plan the optimal execution sequence in advance, ensuring that unsafe filters are positioned after the security filter while maintaining overall query execution efficiency.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS12380170B2Performance optimizations for row-level security filters
Publication Date: 2025.08.05 GOOGLE LLC
  • US12380170B2 patent drawing
  • US12380170B2 patent drawing
  • US12380170B2 patent drawing

AI summary

A method for optimizing a database query includes receiving a database query from a user requesting a database to conditionally return one or more rows stored at the database and characterizing one or more user filters. Each user filter filters rows from the database. The method includes determining that a security filter 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 incapable of reporting an error or an unsafe user filter capable of reporting an error. The method also includes determining a filter execution order 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.