Compiling sql intrinsics for parallel execution
AssigneeMicrosoft Technology Licensing, LLC
InventorsKaushik RAJAN, Sampath RAJENDRA, Avery Sumner LAIRD
Life of this patent
Estimating the term…
Abstract
A structured query language (SQL) query including an SQL intrinsic function is processed using native code including single instruction multiple data (SIMD) or single instruction multiple thread (SIMT) processor instructions for execution on a processor having native parallelism. The native code is compiled from an implementation of the SQL intrinsic function in a platform-independent source code. The compiling comprises compiling the source code to generate a platform-independent intermediate representation (IR) of the source code. The IR is optimized for improved performance through parallelization. The optimized IR is lowered to generate the native code.
Claims20
A system for compiling an implementation of an intrinsic structured query language (SQL) function of an SQL query processor for execution leveraging data parallelism, the system comprising:
- a processor for executing instructions;
- and
- a data storage medium embodying instructions for execution on the processor, wherein the instructions cause the processor to:
- receive the implementation of the intrinsic SQL function, the implementation being an implementation of the intrinsic SQL function in source code using a programming language, the implementation being targeted for execution on a central processing unit (CPU) and not including (i) any calls to a graphics processing unit (GPU) library or (ii) single instruction multiple data (SIMD)-specific instructions;
- compile the source code to generate an intermediate representation (IR) of the implementation of the intrinsic SQL function, the IR being platform independent;
- optimize the IR of the implementation of the intrinsic SQL function, the optimizing comprising modifying the IR to include data-parallelization, thereby resulting in an optimized IR;
- and
- lower the optimized IR to native code for execution on a processor with native parallelism.
A computerized method for processing structured query language (SQL) queries, the method comprising:
- receiving an SQL query at an SQL query processor, the SQL query processor comprising a processor with native parallelism;
- identifying, within the SQL query, an intrinsic SQL function;
- processing the intrinsic SQL function on the processor using native code, the native code being generated from an implementation of the intrinsic SQL function in a platform-independent source code;
- the generating of the native code comprising:
- compiling the source code to generate an intermediate representation (IR) of the implementation of the intrinsic SQL function, the IR being platform independent and retargetable;
- optimizing the IR of the implementation of the intrinsic SQL function to generate an optimized IR, the optimizing comprising modifying the IR for improved performance through data parallelism;
- and
- lowering the optimized IR to the native code, the native code comprising single instruction multiple data (SIMD) or single instruction multiple thread (SIMT) instructions for implementing the intrinsic SQL function.
A computer storage medium embodying computer program instructions for execution by a processor to process structured query language (SQL) queries, the instructions causing the processor to:
- receive an SQL query;
- identify, within the SQL query, an intrinsic SQL function;
- process the intrinsic SQL function on a processor using native code, the native code being compiled from an implementation of the SQL intrinsic function in a platform-independent source code;
- the compiling of the native code comprising:
- compiling the source code to generate an intermediate representation (IR) of the implementation of the intrinsic function, the IR being platform independent and retargetable;
- optimizing the IR of the implementation of the intrinsic function to generate an optimized IR, the optimizing comprising modifying the IR for improved performance through data parallelism;
- and
- lowering the optimized IR to the native code, the native code comprising single instruction multiple data (SIMD) or single instruction multiple thread (SIMT) instructions for implementing the intrinsic SQL function.
Dependencies are inferred from the claim text.