The patent badge is an abbreviated version of the USPTO patent document. The patent badge does contain a link to the full patent document.
The patent badge is an abbreviated version of the USPTO patent document. The patent badge covers the following: Patent number, Date patent was issued, Date patent was filed, Title of the patent, Applicant, Inventor, Assignee, Attorney firm, Primary examiner, Assistant examiner, CPCs, and Abstract. The patent badge does contain a link to the full patent document (in Adobe Acrobat format, aka pdf). To download or print any patent click here.
Patent No.:
Date of Patent:
Jun. 17, 2025
Filed:
Sep. 07, 2023
Amperity, Inc., Seattle, WA (US);
Kailashnath Reddy Kavalakuntla, Apex, NC (US);
AMPERITY, INC., Seattle, WA (US);
Abstract
The present disclosure describes a system and method for optimizing SQL queries, specifically addressing challenges in handling and optimization of nested Common Table Expressions (CTEs). The system comprises a SQL optimization engine configured to receive SQL scripts from a SQL editor application and output optimized SQL to a query engine for execution on a database. The optimization engine utilizes three primary stages: a CTE normalization stage, a materialization stage, and a caching stage. The CTE normalization stage unnests nested CTEs into single-level CTEs. The materialization stage implements a materialized Create Table As Select (CTAS) strategy for materializing the base query. The caching stage enables reusability of the materialized base query across multiple queries, increasing efficiency and performance. This system provides technical solutions to enhance the capabilities of SQL engines that lack native support for nested CTEs, offering improved query performance and management of large datasets.