[go: up one dir, main page]

KR101550679B1 - Method For Combining Column-Wise Query Engine With Dynamic Compilation - Google Patents

Method For Combining Column-Wise Query Engine With Dynamic Compilation Download PDF

Info

Publication number
KR101550679B1
KR101550679B1 KR1020130120840A KR20130120840A KR101550679B1 KR 101550679 B1 KR101550679 B1 KR 101550679B1 KR 1020130120840 A KR1020130120840 A KR 1020130120840A KR 20130120840 A KR20130120840 A KR 20130120840A KR 101550679 B1 KR101550679 B1 KR 101550679B1
Authority
KR
South Korea
Prior art keywords
query
primitive
column
generating
query processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
KR1020130120840A
Other languages
Korean (ko)
Other versions
KR20150042084A (en
Inventor
박근태
이재영
안성화
최승운
Original Assignee
에스케이 텔레콤주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 에스케이 텔레콤주식회사 filed Critical 에스케이 텔레콤주식회사
Priority to KR1020130120840A priority Critical patent/KR101550679B1/en
Publication of KR20150042084A publication Critical patent/KR20150042084A/en
Application granted granted Critical
Publication of KR101550679B1 publication Critical patent/KR101550679B1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/83Querying
    • G06F16/835Query processing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/37Compiler construction; Parser generation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3885Concurrent instruction execution, e.g. pipeline or look ahead using a plurality of independent parallel functional units
    • G06F9/3887Concurrent instruction execution, e.g. pipeline or look ahead using a plurality of independent parallel functional units controlled by a single instruction for multiple data lanes [SIMD]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하기 위한 방법을 개시한다.
데이터베이스 시스템에서 동적 컴파일(Dynamic Compilation)과 칼럼우선(Column-Wise) 배열 방식의 질의 처리 엔진을 결합하는 방법에 있어서, 질의(Query)를 수신하는 과정; 상기 질의를 상기 데이터베이스 시스템에서 실행하기 위한 최소 연산 단위인 프리미티브(Primitive) 소스코드를 생성하는 과정; 상기 프리미티브 소스코드를 동적 컴파일러(Dynamic Compiler)를 이용하여 실행코드인 프리미티브를 생성하는 과정 및 상기 프리미티브를 실행하고 질의 처리 결과를 생성하는 과정을 포함하는 것을 특징으로 하는 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 방법을 제공한다.
A method for combining a query processing engine with dynamic compilation and a column prioritized approach is disclosed.
A method of combining dynamic compilation and a query processing engine of a column-wise arrangement type in a database system, the method comprising: receiving a query; Generating a primitive source code which is a minimum operation unit for executing the query in the database system; Generating a primitive as an execution code by using a dynamic compiler of the primitive source code, and executing the primitive and generating a query processing result. Provides a way to combine query processing engines.

Description

동적 컴파일과 컬럼우선 배열 방식의 질의 처리 엔진을 결합하는 방법 {Method For Combining Column-Wise Query Engine With Dynamic Compilation}[0001] The present invention relates to a method for combining dynamic compilation and a column-priority array query engine,

본 발명은 동적 컴파일(Dynamic Compilation) 방식과 컬럼우선(Column-Wise) 배열 방식의 질의 처리를 결합하는 방법에 관한 것이다.The present invention relates to a method of combining a dynamic compilation method with a query processing of a column-wise arrangement method.

이하에 기술되는 내용은 단순히 본 실시예와 관련되는 배경 정보만을 제공할 뿐 종래기술을 구성하는 것이 아님을 밝혀둔다.It should be noted that the following description merely provides background information related to the present embodiment and does not constitute the prior art.

현재 상용화된 많은 데이터베이스 시스템이 NSM(N-ary Storage Model) 방식의 데이터 저장 구조에 기반하여 Tuple-at-a-time 방식으로 질의(Query)를 처리하고 있다. 이와 같은 방식은 CPU(Central Processing Unit)가 실질적으로 데이터 처리가 아니라 질의 연산 트리를 순회(Traverse)하는데 대부분의 시간을 소비하게 된다. Tuple-at-a-time 질의 실행 방식은 튜플을 얻어오기 위한 함수 호출로 인해 명령어 캐쉬(Instruction Cache) 성능을 저하시키고, 잦은 분기(Branch)는 실행의 예측을 어렵게 하여 성능 저하의 주요 원인이 되고 있다. 더욱이 Tuple-at-a-time 실행 방식은 루프-언롤링(Loop-Unrolling), SIMD(Single Instruction Multiple Data) 명령어를 사용할 수 없고, 레지스터(Register)를 효율적으로 사용하지 못하는 등 최근 CPU가 제공하는 중요한 기능을 제대로 활용하지 못한다.Many commercialized database systems are processing queries in a Tuple-at-a-time manner based on NSM (N-ary Storage Model) data storage structure. Such a scheme consumes most of the time for the CPU (Central Processing Unit) to traverse the query operation tree, rather than the actual data processing. The Tuple-at-a-time query execution method degrades instruction cache performance due to function calls to obtain tuples, and frequent branching makes execution difficult to predict, leading to performance degradation have. Moreover, the Tuple-at-a-time execution method can not use the Loop-Unrolling, SIMD (Single Instruction Multiple Data) instructions, It does not make good use of important functions.

데이터베이스 관리 시스템(Database Management System; DBMS)의 질의 처리 엔진은 선언형 언어(Declarative Language)인 SQL(Structured Query Language)처럼 어떤 질의 구문이 입력될지 모르는 상황에서 입력된 질의 구문을 실시간으로 처리하기 위해 해석하고 컴파일하는 인터프리트(Interpret)방식을 사용한다. 인터프리트 방식은 질의 처리를 위한 내부 계산 순서 및 로직을 실행 중에 내부 자료구조(트리 또는 그래프)로 만들어 매 계산 시 마다 이 자료구조를 순회하는(Traverse) 방식이다. 인터프리트 방식에서 자료구조를 순회하며 데이터를 처리하는 것은 오버헤드(Overhead)가 크다는 단점을 가지고 있다.The query processing engine of the database management system (DBMS) analyzes the input query syntax in real time in the situation where the query syntax such as SQL (Structured Query Language), which is a declarative language, And interpreting it to compile it. The interpreting method is an internal data structure (tree or graph) during execution of the internal calculation sequence and logic for query processing, and traverses this data structure every calculation. In the interpreting method, it is disadvantageous that the data structure is circulated and the data is processed in a large amount of overhead.

인터프리트 방식에서 사용하는 자료구조와 이를 순회하는 구조는 도 1과 같은 형태로 나타난다. 하나의 튜플을 얻기 위해 연산자(Operator)의 get_next()함수가 호출되기 때문에 CPU(Central Processing Unit)의 명령어 캐쉬(Instruction Cache) 불일치(Miss)가 빈번하게 발생한다. 또한 각 물리적 연산자(Physical Operator)의 상태 값(Value)을 유지해야 하므로 데이터 캐쉬(Data Cache) 불일치도 자주 발생한다. The data structure used in the interpreting method and the structure for traversing the data structure are shown in FIG. Since the get_next () function of the operator is called to obtain one tuple, a mismatch occurs in the instruction cache of the CPU (Central Processing Unit) frequently. In addition, because the state value of each physical operator must be maintained, a data cache inconsistency often occurs.

인터프리트 방식은 질의 구문을 해석해야 하는 오버헤드 외에도 빈번한 분기(Branch)의 발생으로 명령어 캐쉬 불일치가 빈번하게 발생하고, 최근 대부분의 CPU에서 채택하고 있는 파이프라이닝(Pipelining) 및 SIMD(Single Instruction Multiple Data) 기술을 활용하기 어렵다는 문제점이 있다.In addition to the overhead of interpreting the query syntax, the interpreting method frequently generates instruction cache inconsistencies due to the frequent occurrence of branches, and the pipelining and SIMD (Single Instruction Multiple Data ) Technology is difficult to utilize.

본 실시예는, 데이터베이스 시스템의 질의 처리 엔진에 있어서, 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 방법을 제공하는 데 주된 목적이 있다.The main object of the present embodiment is to provide a method of combining a dynamic compilation and a query processing engine of a column priority arrangement type in a query processing engine of a database system.

본 실시예의 일 측면에 의하면, 데이터베이스 시스템에서 동적 컴파일(Dynamic Compilation)과 칼럼우선(Column-Wise) 배열 방식의 질의 처리 엔진을 결합하는 방법에 있어서, 질의(Query)를 수신하는 과정; 상기 질의를 상기 데이터베이스 시스템에서 실행하기 위한 최소 연산 단위인 프리미티브(Primitive) 소스코드를 생성하는 과정; 상기 프리미티브 소스코드를 동적 컴파일러(Dynamic Compiler)를 이용하여 실행코드인 프리미티브를 생성하는 과정 및 상기 프리미티브를 실행하고 질의 처리 결과를 생성하는 과정을 포함하는 것을 특징으로 하는 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 방법을 제공한다.According to an aspect of the present invention, there is provided a method of combining dynamic compilation and a query processing engine of a column-wise arrangement scheme in a database system, the method comprising: receiving a query; Generating a primitive source code which is a minimum operation unit for executing the query in the database system; Generating a primitive as an execution code by using a dynamic compiler of the primitive source code, and executing the primitive and generating a query processing result. Provides a way to combine query processing engines.

또한, 본 실시예의 다른 측면에 의하면, 동적 컴파일(Dynamic Compilation)과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 장치에 있어서, 데이터베이스 데이터를 저장하고 있는 데이터베이스 저장부; 질의(Query)를 수신하는 질의 수신부; 상기 질의를 데이터베이스 시스템에서 실행하기 위한 최소 연산단위인 프리미티브(Primitive) 소스코드를 생성하는 프리미티브 소스코드 생성부; 상기 프리미티브 소스코드를 동적 컴파일러(Dynamic Compiler)를 이용하여 실행코드인 프리미티브를 생성하는 동적 컴파일러 및 상기 프리미티브를 실행하여 질의 처리 결과를 생성하는 질의 수행부를 포함하는 것을 특징으로 하는 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 장치를 제공한다.According to another aspect of the present invention, there is provided an apparatus for combining dynamic compilation and a query processing engine of a column prioritization scheme, the apparatus comprising: a database storage unit for storing database data; A query receiving unit that receives a query; A primitive source code generation unit for generating a primitive source code which is a minimum operation unit for executing the query in a database system; A dynamic compiler for generating a primitive which is an execution code by using a dynamic compiler of the primitive source code and a query execution unit for executing the primitive and generating a query processing result, Method query processing engine.

이상에서 설명한 바와 같이 본 실시예에 의하면, 질의를 칼럼우선 배열에 기반하여 처리하는 칼럼우선 배열 방식의 질의 처리 엔진(Column-Wise Query Engine)에서 연산자(Operator)는 칼럼 데이터를 모두 처리한 후에 다음 단계의 연산을 수행하므로 함수 호출을 줄여 최신 CPU의 장점인 파이프라인(Pipeline)과 SIMD(Sing Instruction Multiple Data) 명령어를 사용할 수 있다. 칼럼우선 배열 방식의 질의 처리 엔진에서 사용하는 벡터 형태는 일차원 배열로 표현할 수 있어 해석하는 비용을 줄을 수 있다. 이것은 복수의 칼럼이 연속적으로 연산에 사용되는 경우 일정한 칼럼을 결합하여 한 번에 수행하도록 하여 가능하게 할 수 있다.As described above, according to the present embodiment, in the column-wise query engine of the column-priority arrangement type in which the query is processed based on the column priority array, the operator processes all the column data, By performing the operation of the step, you can reduce the function calls and use the pipeline (Pipeline) and Sing Instruction Multiple Data (SIMD) instructions which are the advantages of the latest CPU. The vector form used by the query processing engine of the column-first array type can be represented by a one-dimensional array, thereby reducing the cost of the interpretation. This may be possible by combining certain columns and performing them in one operation when a plurality of columns are continuously used in the operation.

또한 본 실시예에 의하면, 동적 컴파일 방식은 인터프리트 오버헤드를 줄이고 컴파일러(Compiler)에 의한 코드(Code) 생성은 인터프리터 방식 보다 빠르다. 게다가, 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 경우, CPU의 레지스터를 활용할 수 있어 칼럼 벡터 연산에 필요한 중간(Intermediate) 결과를 메모리에 저장하는 과정(Write Back)이 불필요하게 된다. 컴파일러에 의해 생성되는 프리미티브에서 메모리 접근 없이, 중간 결과를 CPU의 레지스터에 저장하고 다음 연산에 사용할 수 있어 중간 결과를 저장하기 위한 메모리 접근(Access)을 줄여 시스템의 성능을 향상시키는 효과가 있다. According to the present embodiment, the dynamic compilation method reduces the interpretation overhead and the code generation by the compiler is faster than the interpreter method. In addition, when combining the dynamic compilation and the query processing engine of the column priority arrangement method, the register of the CPU can be utilized, and a process of storing the intermediate result necessary for the column vector calculation in the memory (Write Back) becomes unnecessary. The primitives generated by the compiler can save the intermediate result to the CPU register without memory access, and can be used in the next operation, thereby reducing the memory access for storing the intermediate result, thereby improving the performance of the system.

또한 본 실시예에 의하면, 루프 언롤링(Loop-Unrolling) 기법은 루프에서 사용되는 인자(Argument)가 루프 내에서만 사용되는 경우 루프의 인덱스를 일정한 간격으로 증가시키고 그 사이의 칼럼 벡터에 대한 연산은 루프의 몸체(Body)에서 반복적으로 별도의 코드로 수행하도록 하여 루프에 의한 분기를 줄여 CPU의 파이프라인과 캐쉬 사용을 최적화하여 시스템의 성능을 향상 시킬 수 있다. 데이터베이스의 칼럼 벡터처럼 배열로 이루어진 데이터 형태는 루프 언롤링과 유사하게 복수의 로우(Row)를 하나의 연산처럼 수행할 수 있는 SIMD 명령어를 사용할 수 있다. SIMD 명령어는 CPU의 능력을 극대화시키는 효율적인 방법이지만 인터프리트 방식에서는 사용이 어렵지만 동적 컴파일이 가능하다면 CPU에 최적화된 SIMD 명령어 코드를 생성하는 것이 가능하다.According to the present embodiment, the loop unrolling technique increases the index of the loop at regular intervals when the argument used in the loop is used only in the loop, and the operation on the column vector between the It is possible to improve the performance of the system by optimizing the use of the pipeline and the cache of the CPU by reducing the branch caused by the loop by executing the code repeatedly in the separate body in the body of the loop. An array of data types, such as a database column vector, can use a SIMD instruction that can perform multiple rows as a single operation, similar to loop unrolling. The SIMD instruction is an efficient way to maximize the CPU's ability, but it is difficult to use it in the interpreting method, but it is possible to generate the CPU-optimized SIMD instruction code if dynamic compilation is possible.

동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합한다면 CPU의 파이프라인(Pipeline), 캐쉬(Cache), 레지스터(Register) 이용을 극대화 시킬 수 있을 뿐 아니라 최적화된 SIMD 명령도 이용할 수 있다. 사용 중인 시스템의 CPU가 변경되더라도 동적 컴파일러(Dynamic Compiler)의 SIMD 명령어 설정을 변경하는 것으로 변경된 CPU에 최적화된 실행 코드를 생성할 수 있는 효과가 있다.Combining dynamic compilation and column-oriented query processing engines can maximize the use of the CPU's pipeline, cache, and registers, as well as optimize SIMD instructions. Even if the CPU of the system in use is changed, the execution code optimized for the changed CPU can be generated by changing the SIMD instruction setting of the dynamic compiler.

도 1은 Tuple-at-a-time 방식의 엔진이 작동하는 방법의 예시도이다.
도 2a는 데이터베이스 테이블의 예시도이다.
도 2b는 로우우선 저장 방식의 예시도이다.
도 2c는 본 실시예에 따른 칼럼 우선 저장 방식의 예시도이다.
도 3a는 Tuple-at-a-time 방식의 데이터베이스의 질의 처리 과정의 순서도이다.
도 3b는 본 실시예에 따른 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하여 질의를 처리하는 과정의 순서도이다.
도 4a는 질의 구문의 예 및 이에 대한 프리미티브 소스코드의 예시이다.
도 4b는 본 실시예에 따른 루프 언롤링을 적용한 프리미티브 소스코드의 예시이다.
도 4c는 본 실시예에 따른 SIMD 명령어를 사용하는 프리미티브 소스코드의 예시이다.
도 5는 본 실시예에 따른 질의 구문에서 프리미티브를 생성하기 위한 연산을 결합하기 위한 방법의 예시이다.
도 6는 본 실시예에 따른 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 장치의 구성도이다.
FIG. 1 is an illustration of a method of operating a Tuple-at-a-time type engine.
2A is an illustration of an example of a database table.
2B is an illustration of an example of a low priority storage scheme.
2C is an illustration of an example of the column priority storage method according to the present embodiment.
3A is a flowchart of a query processing process of a database of a Tuple-at-a-time method.
FIG. 3B is a flowchart of a process of processing a query by combining the dynamic compilation according to the present embodiment and the query processing engine of the column priority arrangement method.
FIG. 4A is an example of a query syntax and an example of a primitive source code therefor.
4B is an example of a primitive source code to which loop unrolling according to the present embodiment is applied.
4C is an illustration of a primitive source code using a SIMD instruction according to the present embodiment.
5 is an illustration of a method for combining operations for generating primitives in a query syntax according to the present embodiment.
FIG. 6 is a block diagram of an apparatus for combining a dynamic compilation and a query processing engine of a column priority arrangement scheme according to the present embodiment.

이하, 본 실시예를 첨부된 도면을 참조하여 상세하게 설명한다.Hereinafter, the present embodiment will be described in detail with reference to the accompanying drawings.

본 실시예에 따른 데이터베이스의 질의 처리 엔진은 종래의 질의 처리 엔진에 비하여 마이크로 수준(Micro Level)에서 성능을 향상시키는 것을 특징으로 한다. 종래에는 질의 처리 엔진 성능을 향상시키기 위하여 질의 연산을 최적화하는 방법을 사용하였으나, 본 발명에서는 CPU의 파이프라인, CPU의 L1, L2 캐쉬, SIMD, 레지스터 등의 기술을 최대한 활용하여 성능을 향상시키기 위한 방법을 제공하는 것을 특징으로 한다.The database query processing engine according to the present embodiment is characterized in that the performance is improved at a micro level compared to a conventional query processing engine. Conventionally, a method of optimizing a query operation to improve the performance of a query processing engine is used. However, in the present invention, in order to improve the performance by making full use of the technologies of the pipeline of the CPU, L1, L2 cache, SIMD, The method comprising the steps of:

도 1은 Tuple-at-a-time 방식의 엔진이 작동하는 방법의 예시도이다.FIG. 1 is an illustration of a method of operating a Tuple-at-a-time type engine.

Tuple-at-a-time 방법은 MySQL 등 기존 데이터베이스에서도 널리 사용되는 처리 방식이다. 이 방식은 질의가 주어지면 질의 처리를 위해 질의 계획(Query Plan)으로부터 실행 시간에 물리적 연산자(Physical Operator)를 트리(Tree)로 구성한다. 튜플 하나를 얻기 위해서는 트리 최상위 노드(Node)에서 get_next() 함수를 호출하고 재귀적(Recursive)으로 하위 노드에 get_next() 함수가 호출되며 각 호출마다 튜플을 반환하게 되는데 이 튜플은 결국 최상위 노드의 get_next() 함수까지 전달된다.Tuple-at-a-time method is widely used in existing databases such as MySQL. In this method, when a query is given, a physical operator is constructed as a tree at execution time from a query plan for query processing. To get a single tuple, we call the get_next () function on the top node of the tree and the get_next () function on the descendant node recursively. Each call returns a tuple, It is passed to the get_next () function.

그런데 Tuple-at-a-time 방식의 엔진은 하나의 튜플을 얻기 위해 여러 연산자의 get_next()함수가 호출되기 때문에 CPU의 명령어 캐쉬(Instruction Cache) 불일치가 빈번하게 발생하는 문제가 있고, 각 물리적 연산자(Physical Operator)의 상태 값을 유지해야 하므로 데이터 캐쉬(Data Cache) 불일치도 자주 발생한다. 또한, 빈번한 get_next() 함수의 호출로 CPU는 많은 시간을 소비할 수 있다. C++ 프로그래밍 언어의 경우 가상 함수(Virtual Function)를 호출하는 데 소비되는 시간은 CPU에서 20 cycle에 해당한다. get_next()함수가 대부분 가상함수로 구현된다는 점에서 복잡한 질의의 경우 get_next()함수의 재귀적(Recursive) 호출로 CPU는 많은 시간을 소비하게 된다.However, the Tuple-at-a-time type of engine has a problem that Instruction Cache mismatch frequently occurs in the CPU because the get_next () function of several operators is called to obtain one tuple. (Data Cache) inconsistency often occurs because the state value of the Physical Operator must be maintained. Also, calling the get_next () function frequently can cause the CPU to spend a lot of time. In the case of the C ++ programming language, the time taken to call a virtual function corresponds to 20 cycles in the CPU. Since the get_next () function is mostly implemented as a virtual function, the recursive call of the get_next () function for a complex query consumes a lot of CPU time.

도 2a는 데이터베이스 테이블의 예시도이다.2A is an illustration of an example of a database table.

도 2a는 관계형 데이터베이스 데이터 저장의 기본 단위인 테이블의 구조에 대한 예시이다. 도 2a의 테이블은 ID, Name, Age의 칼럼(Column)이 있고, 각 칼럼에 대해, 첫 번째 로우(Row) 값인 "101", "안용진", "32"은 하나의 튜플(Tuple)을 이룬다. 데이터베이스에서 저장장치에 데이터를 물리적으로 저장하는 방법으로 로우우선(Row-Wise) 방식과 칼럼우선(Column-Wise) 방식이 있다. 이에 대해서는 도 2b 및 도 2c에서 상세하게 설명한다.FIG. 2A is an illustration of the structure of a table that is a basic unit of relational database data storage. 2A includes columns of ID, Name, and Age. For each column, the first row values "101 "," Yongjin ", and "32 " form one tuple . There are a row-wise method and a column-wise method for physically storing data in a storage device in a database. This will be described in detail in FIGS. 2B and 2C.

도 2b는 로우우선 저장 방식의 예시도이다.2B is an illustration of an example of a low priority storage scheme.

로우우선(Row-Wise) 저장 방식은 튜플을 이루는 값들을 연속된 공간에 저장한다. 도 2a의 테이블이 로우우선 저장 방식으로 저장되는 경우 튜플을 이루는 값인 "101", "안용진", "32"가 연속적인 공간에 저장되고 그 다음 튜플인 "102", "김우중", "47"이 다음으로 저장된다. 이러한 로우우선 저장 방식에서는 칼럼 단위의 연산이 특징인 데이터베이스에서 CPU 데이터 캐쉬 불일치가 발생하는 원인이 되고, SIMD 명령어와 레지스터를 효율적으로 사용하기 어렵다는 문제가 있다.Row-Wise storage stores tuple values in a contiguous space. When the table of FIG. 2A is stored in the low priority storage mode, "101", "Yong Jin Jin" and "32" are stored in successive spaces and the tuples "102" Is stored next. In such a low-priority storage method, a CPU data cache inconsistency occurs in a database characterized by a column-by-column operation, and there is a problem that SIMD instructions and registers are difficult to efficiently use.

도 2c는 본 실시예에 따른 칼럼 우선 저장 방식의 예시도이다.2C is an illustration of an example of the column priority storage method according to the present embodiment.

칼럼우선 저장 방식은 하나의 칼럼의 값들을 연속된 공간에 저장하는 것이다. ID 칼럼의 값인 "101", "102", …, "115"를 연속적인 공간에 저장을 하고, Name 칼럼의 값인 "안용진", "김우중", …, "한용주"를 연속적인 공간에 저장하고, Age 칼럼의 값인 "32", "47", …, "45"를 연속적인 공간에 저장하는 방식이다. 칼럼 우선 저장 방식을 사용하는 경우, 칼럼 단위의 연산을 많이 하는 데이터베이스에서 CPU의 데이터 캐쉬 히트(Hit)율을 높일 수 있고, 동적 컴파일과 결합하여 SIMD 명령어를 사용할 수 있으며, 레지스터를 효율적으로 사용하여 메모리 접근을 줄여 데이터베이스의 성능을 향상시킬 수 있는 장점이 있다.The column priority storage method stores the values of one column in a continuous space. "101 "," 102 ", " , "115" are stored in a continuous space, and the values of the Name column "Ahn Yong Jin", "Kim Woo Joong", ... , "Han Yong-Ju" is stored in a continuous space, and the values of Age column "32", "47", ... , And "45" in a continuous space. When the column priority storage method is used, it is possible to increase the data cache hit rate of the CPU in a database which performs a lot of operations on a column basis, to use a SIMD instruction in combination with dynamic compilation, There is an advantage of improving the performance of the database by reducing memory access.

도 3a는 Tuple-at-a-time 방식의 데이터베이스의 질의 처리 과정의 순서도이다.3A is a flowchart of a query processing process of a database of a Tuple-at-a-time method.

사용자 또는 응용프로그램에서 질의 처리 엔진에 SQL 같은 선언형 언어로 된 질의 구문을 전달하면, 질의 처리 엔진은 질의 문장을 수신한다(S310). 질의를 전달받은 질의 처리 엔진의 파서(Parser)는 질의 문장을 파싱(Parsing)하여 질의 구문으로부터 파스 트리(Parse Tree)를 생성한다(S312). 파서는 그 밖에도 질의 구문의 의미가 적합한지 검사한다. 파스 트리가 생성되면 파스 트리를 관계 대수 표현(Relational Algebra Expression)으로 변환하여 로지컬 플랜(Logical Plan)을 수립한다(S314). 질의 처리 엔진은 관계 대수 표현을 실행하기 위한 연산자로 변환하는 피지컬 플랜(Physical Plan)을 수립한다(S316). Tuple-at-a-time 방식의 질의 처리 엔진은 피지컬 플랜에 따라 질의를 수행하고(S318), 질의 수행 결과를 질의를 요청한 사용자 또는 응용프로그램에 전달한다(S320).When the user or the application program sends a query statement in a declarative language such as SQL to the query processing engine, the query processing engine receives the query statement (S310). The parser of the query processing engine having received the query generates a parse tree from the query syntax by parsing the query sentence (S312). The parser also checks whether the meaning of the query syntax is appropriate. When the parse tree is generated, the parse tree is converted into a relational algebra expression to establish a logical plan (S314). The query processing engine establishes a physical plan (S316) for converting the operator into an operator for executing the relational algebra expression. The query processing engine of the Tuple-at-a-time method performs a query according to the physical plan (S318), and transmits the query execution result to the user or application program requesting the query (S320).

도 3b는 본 실시예에 따른 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하여 질의를 처리하는 과정의 순서도이다.FIG. 3B is a flowchart of a process of processing a query by combining the dynamic compilation according to the present embodiment and the query processing engine of the column priority arrangement method.

본 실시예에 따른 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합한 경우에 있어서도 Tuple-at-a-time 방식과 마찬가지로 질의를 수신하여(S330), 질의를 파싱하고(S332), 로지컬 플랜을 수립하는(S334) 과정은 동일하다. 그러나, 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 경우 질의 처리를 위한 실행코드를 생성하는 방법에 있어서 차이가 있다. 본 발명의 실시예에서는 칼럼우선 배열 방식의 질의 처리 방식에서 연산의 최소 단위인 프리미티브(Primitive) 함수의 소스코드를 생성한다(S336). 그리고 프리미티브 소스코드를 동적 컴파일러(Dynamic Compiler)로 컴파일하여 프리미티브를 생성한다(S338). 프리미티브 소스코드를 컴파일하는 동적 컴파일러로는 LLVM(Low Level Virtual Machine)이 사용될 수 있다. 그러나 동적 컴파일러가 LLVM으로 한정되는 것은 아니다. 프리미티브를 생성할 때 프리미티브 소스코드의 다양한 연산들이 최적화될 수 있다.In the case of combining the dynamic compilation and the query processing engine of the column priority arrangement method according to the present embodiment, the query is received (S330) as in the Tuple-at-a-time method, the query is parsed (S332) The process of establishing (S334) is the same. However, there is a difference in the method of generating executable code for query processing when the dynamic compilation and the query processing engine of the column priority arrangement method are combined. In the embodiment of the present invention, a source code of a primitive function which is the minimum unit of operation in the query processing method of the column priority arrangement method is generated (S336). The primitive source code is then compiled into a dynamic compiler to generate a primitive (S338). A low level virtual machine (LLVM) can be used as a dynamic compiler to compile primitive source code. However, dynamic compilers are not limited to LLVM. The various operations of the primitive source code can be optimized when generating primitives.

이하, 프리미티브의 최적화 방법에 대해서 설명한다. 본 발명의 실시예에 따른 데이터베이스 시스템은 칼럼 벡터 연산을 루프를 수행하면서 실행한다. 프리미티브 생성 과정(S336)에서는 칼럼 벡터를 처리하기 위한 루프 연산을 수행하는 함수의 소스코드가 생성된다. 만약, 루프에서 사용되는 인자(argument)가 루프 내에서만 사용되는 경우 루프 언롤링(Loop-Unrolling) 과정을 수행할 수 있다. 루프 언롤링에 대해서는 도 4b에서 상세하게 설명한다.Hereinafter, a primitive optimization method will be described. The database system according to the embodiment of the present invention executes a column vector operation while performing a loop. In the primitive generation process (S336), a source code of a function for performing a loop operation for processing a column vector is generated. If an argument used in a loop is used only in a loop, a loop unrolling process can be performed. Loop unrolling will be described in detail in FIG. 4B.

동적 컴파일을 이용하는 경우 칼럼우선 방식으로 저장된 데이터의 처리를 SIMD(Single Instruction Multiple Data) 명령어를 이용하여 수행하기 용이하다. Tuple-at-a-time 방식에서 사용하는 로우우선 방식으로 데이터가 저장된 경우에는 칼럼 벡터에 의한 데이터를 처리하는 데이터베이스에서 데이터의 연속성이 보장되지 않으므로 SIMD를 사용하기 곤란하다. 그러나, 칼럼우선 방식의 데이터 레이아웃(Layout)을 가지는 경우 복수의 데이터를 한 번에 처리 할 수 있는 SIMD 명령어를 사용하여 실행 성능을 향상시킬 수 있다. SIMD에 대해서는 도 4c에서 상세하게 설명한다. When using dynamic compilation, it is easy to perform processing of data stored in a column priority manner using a SIMD (Single Instruction Multiple Data) instruction. When the data is stored in the low priority scheme used in the Tuple-at-a-time scheme, it is difficult to use the SIMD because the continuity of the data in the database for processing the data by the column vector is not ensured. However, in the case of having a data layout of a column priority scheme, execution performance can be improved by using a SIMD instruction that can process a plurality of data at one time. The SIMD is described in detail in FIG. 4C.

동적 컴파일러를 사용하지 않고 칼럼우선 배열 방식의 질의 처리 엔진만을 사용하는 경우, 튜플(Tuple) 단위로 인터프리트(Interpret)해야 하는 오버헤드(Overhead)는 없지만 일정한 크기의 벡터(Vector) 단위로 인터프리트해야 하는 오버헤드는 여전히 존재하고 벡터 단위의 연산 결과를 다시 메모리에 저장해야만 한다. 레지스터(Register)를 사용하여 중간 결과를 저장하고, 레지스터에 저장된 중간 결과를 다음 연산에 사용하여 메모리 접근을 줄이는 방식을 사용할 수 없다. 그러나 칼럼우선 배열 방식의 질의 처리 엔진에 동적 컴파일 방법을 적용한다면, 중간 결과를 메모리에 저장하는 과정(Write-Back) 없이 레지스터에 저장한 후 이를 다시 다음 연산에 사용하도록 프리미티브를 생성할 수 있다.In the case of using only the query processing engine of the column priority arrangement mode without using the dynamic compiler, there is no overhead to interpolate in a tuple unit, The overhead to be done still exists and the computation result of the vector unit must be stored back into memory. You can not use a register to save intermediate results, and an intermediate result stored in a register to the next operation to reduce memory access. However, if the dynamic compilation method is applied to the query processing engine of the column-priority arrangement method, a primitive can be generated so that the intermediate result is stored in a register without write-back to the memory and then used again for the next operation.

프리미티브 생성이 완료되면 질의 처리 엔진은 프리미티브를 실행하여 질의를 수행한다(S340). 그리고 질의 수행 결과를 다시 질의를 요청한 사용자 또는 응용프로그램에 전달한다(S342).When the primitive generation is completed, the query processing engine executes a query by executing a primitive (S340). Then, the query execution result is transmitted to the user or the application program which has requested the query again (S342).

도 4a는 질의 구문의 예 및 이에 대한 프리미티브 소스코드의 예시이다.FIG. 4A is an example of a query syntax and an example of a primitive source code therefor.

도 4a는 데이터베이스 시스템에 전달될 수 있는 질의 구문의 예이고, 이 구문에 대한 프리미티브 소스코드의 예시이다. 질의 문장에서는 l_extendedprice, l_discount, l_tax, sum_charge 4개의 칼럼 벡터가 사용된다. 칼럼우선 배열 방식의 질의 처리 엔진에서는 질의 구문을 처리하기 위해서는 4개의 프리미티브가 사용될 수 있다. 제1 프리미티브에서는 질의구문에서 l_discount 칼럼을 사용하여 1-l_discount를 계산하고 output_1 칼럼 벡터에 저장한다. 제2 프리미티브에서는 l_tax 칼럼을 사용하여 1+l_tax를 계산하여 output_2 칼럼 벡터에 저장한다. 제3 프리미티브에서는 앞에서 계산한 결과인 output_1 칼럼 벡터와 output_2 칼럼 벡터를 곱하여 output_3 칼럼 벡터에 저장한다. 제4 프리미티브에서는 l_extendedprice 칼럼 벡터와 제3 프리미티브에서 계산한 output_3 벡터를 곱하여 최종 결과로 output_4 벡터를 생성한다. 그러나 이와 같은 방식은 질의 처리 엔진 입장에서는 어떤 질의가 입력될지 알 수 없으므로 모든 가능한 프리미티브를 생성하고 있어야 하는 문제가 있다.Figure 4A is an example of a query syntax that can be passed to a database system and is an example of primitive source code for this syntax. In the query statement, four column vectors l_extendedprice, l_discount, l_tax, and sum_charge are used. In the query processing engine of the column priority arrangement type, four primitives can be used to process the query statement. In the first primitive, 1-l_discount is computed using the l_discount column in the query statement and stored in the output_1 column vector. In the second primitive, 1 + l_tax is calculated using the l_tax column and stored in the output_2 column vector. In the third primitive, the output_1 column vector is multiplied by the output_2 column vector, and the result is stored in the output_3 column vector. In the fourth primitive, the output_4 vector is generated by multiplying the l_extendedprice column vector by the output_3 vector calculated from the third primitive. However, there is a problem in that it is necessary to generate all possible primitives because the query processing engine does not know which query is to be input.

도 4b는 본 실시예에 따른 루프 언롤링을 적용한 프리미티브 소스코드의 예시이다.4B is an example of a primitive source code to which loop unrolling according to the present embodiment is applied.

도 4a에서는 질의를 수행하기 위해서 루프 연산을 수행한다. 이로 인해 루프로 인한 분기(Branch)가 발생하게 된다. 이와 같은 분기는 CPU의 파이프라인 성능을 저하시키는 원인이 된다. 루프로 인한 분기를 줄이기 위해서, 루프내에서 사용되는 인자(Argument)가 루프 외에서 사용되지 않을 경우에 루프의 일정 범위 내에서는 분기가 발생하지 않도록 프로그램 코드를 작성할 수 있다. 이러한 과정을 루프 언롤링(Loop-Unrolling)이라고 한다. 루프 언롤링이 적용되면 분기가 줄어들어 CPU의 파이프라인에 최적화할 수 있어 질의 처리 엔진 성능을 향상시킨다. 도 4b의 프리미티브 소스코드는 루프 연산에 사용하는 인덱스를 4씩 증가시키고 그 사이의 칼럼에 대한 계산은 루프의 바디(Body)에 반복하여 별도의 코드로 작성하여 수행하도록 한 것이다.In FIG. 4A, a loop operation is performed to perform a query. This causes a branch due to the loop. Such a branch causes degradation of the pipeline performance of the CPU. In order to reduce the branch due to the loop, the program code can be written so that no branch occurs within a certain range of the loop when the argument used in the loop is not used outside the loop. This process is called Loop-Unrolling. When loop unrolling is applied, branching is reduced and optimized for the CPU pipeline, improving query processing engine performance. In the primitive source code of FIG. 4B, the index used for the loop operation is incremented by 4, and the calculation between the columns is repeatedly performed in the body of the loop in a separate code.

도 4c는 본 실시예에 따른 SIMD 명령어를 사용하는 프리미티브 소스코드의 예시이다.4C is an illustration of a primitive source code using a SIMD instruction according to the present embodiment.

배열(Array) 형태의 데이터를 처리하는 경우 복수의 배열 요소를 하나로 묶어 벡터 연산처럼 한 번에 처리할 수 있다. 이를 SIMDization이라고 한다. 도 4c는 l_extendedprice, l_discount 칼럼에서 4개의 값을 연속된 메모리 공간에 로딩하고, 이들에 대한 연산을 수행한 후 그 결과를 메모리에 저장하는 과정의 프리미티브 소스코드의 예시이다. SIMD는 단일 명령어로 복수의 데이터를 한 번에 병렬적으로 처리하여 시스템의 처리 능력을 향상시킨다.When processing data in the form of an array, a plurality of array elements can be grouped together and processed as a vector operation at a time. This is called SIMDization. 4C is an example of a primitive source code of a process of loading four values in the l_dependentprice and l_discount columns into consecutive memory spaces, performing an operation on them, and storing the results in a memory. SIMD improves the throughput of a system by processing multiple pieces of data in parallel at the same time with a single instruction.

CPU에서 사용되는 SIMD 명령어는 CPU의 작은 변화에도 변경될 수 있어 동적 컴파일러가 이런 변화에 대처하기는 쉽지 않다. 그러므로 동적 컴파일러는 프리미티브를 생성하면서 어떤 SIMD 명령어 사용할 것인지에 대한 정보를 외부로부터 수신할 수 있는 수단이 필요하다. 이런 방식은 동적 컴파일러의 API를 이용하거나 설정 파일 등 다양한 방법으로 가능하며 어느 하나의 방법에 한정되지 않는다.SIMD instructions used in the CPU can be changed even with small changes in the CPU, making it difficult for the dynamic compiler to cope with these changes. Therefore, the dynamic compiler needs a means to receive information from outside about which SIMD instruction to use while generating a primitive. This can be done in various ways, such as using a dynamic compiler API or a configuration file, and is not limited to any one method.

도 5는 본 실시예에 따른 질의 구문에서 프리미티브를 생성하기 위한 연산을 결합하기 위한 방법의 예시이다.5 is an illustration of a method for combining operations for generating primitives in a query syntax according to the present embodiment.

도 5의 질의 구문에는 l_returnflag, l_extendedprice, l_discount, l_tax, l_quantity, refund의 6 개 칼럼 벡터가 사용되고 있다. 6 개의 칼럼 벡터를 행과 열로 하여 도 5의 예시와 같은 행렬을 생성하고, 질의 구문에 등장하는 칼럼 쌍의 회수를 구하면 l_extendedprice와 l_discount 칼럼 쌍은 2회, l_extendedprice와 l_tax, l_discount와 l_tax, l_quantity와 refund 칼럼 쌍은 각 1회씩 등장한다. 등장하는 회수에 따라 우선순위가 부여되고 일정한 우선순위 이상인 경우 그 칼럼 쌍을 포함하는 연산은 하나로 묶어 프리미티브를 생성한다. l_extendedprice와 l_discount 칼럼 쌍이 가장 많은 빈도로 등장하여 가장 높은 우선순위가 부여된다. 따라서 등장 회수가 가장 많은 l_extendedprice와 l_discount 칼럼 쌍이 포함된 연산은 하나로 묶어 프리미티브를 생성할 수 있다. l_extendedprice*(1-l_discount), (l_extendedprice*(1-l_discount)*(1+l_tax)) 연산은 일정한 우선순위 이상으로 등장하는 칼럼 쌍에 대해서 연산을 결합하여 하나의 프리미티브를 생성하고 각 연산별로 별도의 프리미티브를 생성하지 않는다. 만약, 연산을 결합하지 않는다면 l_extendedprice*(1-l_discount)은 1-l_discount를 계산하여 output1에 저장하는 프리미티브와 l_extendedprice*output1을 계산하여 output2에 저장하기 위한 프리미티브가 필요할 것이다. 그러나 이 연산자를 결합한 것을 연산의 단위로 하여 하나의 프리미티브에서 수행한다면 1-l_discount를 저장하기 위해 ouput1을 메모리에 저장하는 과정이 불필요하게 되고 CPU의 레지스터에 1-1_discount의 결과가 저장되고 레지스터와 l_extendedprice가 연산을 수행할 수 있게 된다.In the query syntax shown in FIG. 5, six column vectors l_returnflag, l_extendedprice, l_discount, l_tax, l_quantity, and refund are used. When the matrix of the example shown in FIG. 5 is generated by using the six column vectors as rows and columns, and the number of column pairs appearing in the query syntax is obtained, the l_extendedprice and l_discount column pairs are divided into two columns, l_extendedprice, l_tax, l_discount, l_tax, l_quantity The refund column pair appears once each time. Priority is assigned according to the number of occurrences. If the priority is higher than a certain priority, operations including the column pair are combined into one to generate a primitive. The l_extendedprice and l_discount column pairs appear with the highest frequency, giving the highest priority. Therefore, operations including l_extendedprice and l_discount column pairs with the greatest number of occurrences can be combined into a single primitive. l_extendedprice * (1-l_discount), (l_extendedprice * (1-l_discount) * (1 + l_tax)) operation generates a primitive by combining operations on column pairs appearing above a certain priority. Lt; / RTI > primitive. If you do not combine operations, l_extendedprice * (1-l_discount) will need primitives to calculate 1-l_discount and store it in output1 and a primitive to calculate l_extendedprice * output1 and store it in output2. However, if we combine this operator with a single primitive in units of operations, it is not necessary to store ouput1 in memory in order to store 1-l_discount, and the result of 1-1_discount is stored in the CPU register, and the register and l_extendedprice Lt; / RTI >

도 6는 본 실시예에 따른 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 장치의 구성도이다.FIG. 6 is a block diagram of an apparatus for combining a dynamic compilation and a query processing engine of a column priority arrangement scheme according to the present embodiment.

데이터베이스 시스템의 질의 처리 엔진에 있어서, 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 장치(500)에는 사용자 또는 응용프로그램으로 부터 질의를 수신하는 질의 수신부(510), 수신한 질의 구문에서 파스 트리를 생성하고 질의 구문의 적합성을 검사하는 파서(520), 파스 트리에서 관계 대수 표현을 생성하는 로지컬 플랜 생성부(530), 로지컬 플랜에서 실제 질의의 연산을 수행하는 프리미티브에 대한 소스코드를 생성하는 프리미티브 소스코드 생성부(540), 프리미티브 소스코드를 컴파일하여 프리미티브의 바이너리 코드를 생성하는 프리미티브 생성부(550), 프리미티브를 실행하여 질의를 수행하는 질의 수행부(560), 질의 수행부(560)에서 질의 수행한 결과로 얻어진 질의 수행 결과를 사용자 또는 응용프로그램에 전달하는 질의 결과 전달부(570)을 포함한다.In the query processing engine of the database system, the apparatus 500 for combining the dynamic compilation and the query processing engine of the column prioritizing method includes a query receiving unit 510 for receiving a query from a user or an application program, A logical plan generation unit 530 for generating a relational algebra expression in the parse tree, a source code generation unit 530 for generating a source code for a primitive that performs an actual query operation in the logical plan, A primitive generating unit 550 for generating primitive binary codes by compiling primitive source codes, a query executing unit 560 for executing a query by executing primitives, a query executing unit 560 ), The query execution result obtained from the query execution result is transmitted to the user or the application program And a transfer unit 570.

본 발명의 실시예에 따른 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 장치(500)는 개인용 컴퓨터(PC: Personal Computer), 노트북 컴퓨터, 태블릿(Tablet), 개인 휴대 단말기(PDA: Personal Digital Assistant), 게임 콘솔, 휴대형 멀티미디어 플레이어(PMP: Portable Multimedia Player), 플레이스테이션 포터블(PSP: PlayStation Portable), 무선 통신 단말기(Wireless Communication Terminal), 스마트폰(Smart Phone), TV, 미디어 플레이어 등과 같은 사용자 단말기일 수 있다. 본 발명의 실시예에 따른 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 장치(500)는 응용 서버와 서비스 서버 등 서버 단말기일 수 있다. 본 발명의 실시예에 따른 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 장치(500)는 각기 (i) 각종 기기 또는 유무선 통신망과 통신을 수행하기 위한 통신 모뎀 등의 통신 장치, (ii) 프로그램을 실행하기 위한 데이터를 저장하기 위한 메모리, (iii) 프로그램을 실행하여 연산 및 제어하기 위한 마이크로프로세서 등을 구비하는 다양한 장치를 의미할 수 있다. 적어도 일 실시예에 따르면, 메모리는 램(Random Access Memory: RAM), 롬(Read Only Memory: ROM), 플래시 메모리, 광 디스크, 자기 디스크, 솔리드 스테이트 디스크(Solid State Disk: SSD) 등의 컴퓨터로 판독 가능한 기록/저장매체일 수 있다. 적어도 일 실시예에 따르면, 마이크로프로세서는 명세서에 기재된 동작과 기능을 하나 이상 선택적으로 수행하도록 프로그램될 수 있다. 적어도 일 실시예에 따르면, 마이크로프로세서는 전체 또는 부분적으로 특정한 구성의 주문형반도체(Application Specific Integrated Circuit: ASIC) 등의 하드웨어로써 구현될 수 있다.The apparatus 500 for combining the dynamic compilation and the query processing engine of the column priority arrangement method according to the embodiment of the present invention may be a personal computer (PC), a notebook computer, a tablet, a personal digital assistant Digital assistant, a game console, a portable multimedia player (PMP), a PlayStation Portable (PSP), a wireless communication terminal, a smart phone, a TV, User terminal. The apparatus 500 for combining the dynamic compilation and the column priority arrangement query processing engine according to the embodiment of the present invention may be a server terminal such as an application server and a service server. The apparatus 500 for combining the dynamic compilation and the column priority arrangement query processing engine according to the embodiment of the present invention includes (i) a communication device such as a communication modem for performing communication with various devices or wired / wireless communication networks, (ii) A memory for storing data for executing the program, and (iii) a microprocessor for executing and controlling the program by executing the program. According to at least one embodiment, the memory may be a computer such as a random access memory (RAM), a read only memory (ROM), a flash memory, an optical disk, a magnetic disk, or a solid state disk Readable recording / storage medium. According to at least one embodiment, a microprocessor can be programmed to selectively perform one or more of the operations and functions described in the specification. In accordance with at least one embodiment, the microprocessor may be implemented in hardware, such as an Application Specific Integrated Circuit (ASIC), in wholly or partially of a particular configuration.

이상의 설명은 본 실시예의 기술 사상을 예시적으로 설명한 것에 불과한 것으로서, 본 실시예가 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 실시예의 본질적인 특성에서 벗어나지 않는 범위에서 다양한 수정 및 변형이 가능할 것이다. 따라서, 본 실시예들은 본 실시예의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시예에 의하여 본 실시예의 기술 사상의 범위가 한정되는 것은 아니다. 본 실시예의 보호 범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술 사상은 본 실시예의 권리범위에 포함되는 것으로 해석되어야 할 것이다.The foregoing description is merely illustrative of the technical idea of the present embodiment, and various modifications and changes may be made to those skilled in the art without departing from the essential characteristics of the embodiments. Therefore, the present embodiments are to be construed as illustrative rather than restrictive, and the scope of the technical idea of the present embodiment is not limited by these embodiments. The scope of protection of the present embodiment should be construed according to the following claims, and all technical ideas within the scope of equivalents thereof should be construed as being included in the scope of the present invention.

500 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합한 장치
510 질의 수신부 520 파서
530 로지컬 플랜 생성부 540 프리미티브 소스코드 생성부
550 동적 컴파일러 560 질의 수행부
570 질의 결과 전달부
500 Dynamic compilation and a device that combines a query processing engine in a column-first array manner
510 query receiver 520 parser
530 Logical Plan Generation Unit 540 Primitive Source Code Generation Unit
550 dynamic compiler 560 query execution unit
570 < tb >

Claims (11)

데이터베이스 시스템에서 동적 컴파일(Dynamic Compilation)과 칼럼우선(Column-Wise) 배열 방식의 질의 처리 엔진을 결합하는 방법에 있어서,
질의(Query)를 수신하는 과정;
상기 질의를 상기 데이터베이스 시스템에서 실행하기 위한 최소 연산 단위인 프리미티브(Primitive) 소스코드를 생성하는 과정;
상기 프리미티브 소스코드를 동적 컴파일러(Dynamic Compiler)를 이용하여 실행코드인 프리미티브를 생성하는 과정 및
상기 프리미티브를 실행하고 질의 처리 결과를 생성하는 과정을 포함하되,
상기 프리미티브를 생성하는 과정에서는, 상기 질의가 복수 개의 연산자를 포함하는 경우 상기 질의의 구문에 포함된 칼럼 쌍에 대한 접근 빈도수에 기초하여 상기 복수 개의 연산자를 결합하여 하나의 프리미티브를 생성하는 것을 특징으로 하는 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 방법.
A method for combining dynamic compilation and a column-wise array query processing engine in a database system,
Receiving a query;
Generating a primitive source code which is a minimum operation unit for executing the query in the database system;
Generating a primitive which is an execution code by using a dynamic compiler;
Executing the primitive and generating a query processing result,
In the generating of the primitive, when the query includes a plurality of operators, the primitives are generated by combining the plurality of operators based on the frequency of accesses to the column pairs included in the query syntax. A method to combine dynamic compilation and query processing engines in a column-by-array manner.
제 1 항에 있어서,
상기 데이터베이스 시스템의 테이블 저장 방식은 칼럼우선(Column-Wise) 배열 방식인 것을 특징으로 하는 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 방법.
The method according to claim 1,
Wherein the table storing method of the database system is a column-wise arrangement method.
제 1 항에 있어서,
상기 프리미티브 소스코드는 칼럼 벡터 단위의 루프 연산을 포함하는 것을 특징으로 하는 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 방법.
The method according to claim 1,
Wherein the primitive source code comprises a loop operation on a column vector basis.
제 1 항에 있어서,
상기 프리미티브를 생성하는 과정은 상기 프리미티브 소스코드내의 루프에서 사용하는 인자가 상기 루프내에서만 사용되는 경우,
상기 루프에 대하여 루프 언롤링(Loop-Unrolling) 과정을 포함하는 것을 특징으로 하는 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 방법.
The method according to claim 1,
Wherein the generating of the primitive includes: when a factor used in the loop in the primitive source code is used only in the loop,
And a loop unrolling process for the loop. ≪ Desc / Clms Page number 21 >
제 1 항에 있어서,
상기 프리미티브를 생성하는 과정은 배열(array) 형태의 데이터 형식이 발견되는 경우, SIMD 명령어를 생성하는 과정을 포함하는 것을 특징으로 하는 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 방법.
The method according to claim 1,
Wherein the step of generating the primitive includes a step of generating an SIMD instruction when an array type data format is found, the method comprising combining a dynamic compilation and a column priority arrangement query processing engine.
제 1 항에 있어서,
상기 동적 컴파일러는 중앙처리장치(Central Processing Unit; CPU)에서 처리할 수 있는 SIMD 명령어 정보를 획득하는 과정을 포함하는 것을 특징으로 하는 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 방법.
The method according to claim 1,
Wherein the dynamic compiler includes a step of acquiring SIMD instruction information that can be processed by a central processing unit (CPU).
삭제delete 제 1 항에 있어서,
상기 하나의 프리미티브를 생성하는 과정은,
상기 질의의 구문에 포함된 칼럼 쌍에 대한 접근 빈도수를 저장하는 과정;
상기 접근 빈도수의 값이 클수록 높은 우선순위를 부여하는 과정 및
기 설정된 우선순위 보다 큰 우선순위를 갖는 상기 칼럼 쌍을 포함하는 연산을 결합하여 상기 프리미티브를 생성하는 과정
을 포함하는 것을 특징으로 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 방법.
The method according to claim 1,
The generating of the one primitive includes:
Storing an access frequency for a column pair included in the syntax of the query;
A process of assigning a higher priority to the access frequency as the value of the access frequency is larger, and
Preset Combining the operations including the column pair having a priority higher than the priority to generate the primitive
And a query processing engine for performing dynamic compilation and column prioritization.
컴퓨터에,
질의(Query)를 수신하는 과정;
상기 질의를 데이터베이스 시스템에서 실행하기 위한 최소 연산 단위인 프리미티브(Primitive) 소스코드를 생성하는 과정;
상기 프리미티브 소스코드를 동적 컴파일러(Dynamic Compiler)를 이용하여 실행코드인 프리미티브를 생성하는 과정 및
상기 프리미티브를 실행하고 질의 처리 결과를 생성하는 과정을 실행하되,
상기 프리미티브를 생성하는 과정에서는, 상기 질의가 복수 개의 연산자를 포함하는 경우 상기 질의의 구문에 포함된 칼럼 쌍에 대한 접근 빈도수에 기초하여 상기 복수 개의 연산자를 결합하여 하나의 프리미티브를 생성하는 과정을 실행하기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체.
On the computer,
Receiving a query;
Generating a primitive source code that is a minimum operation unit for executing the query in the database system;
Generating a primitive which is an execution code by using a dynamic compiler;
Executing the primitive and generating a query processing result,
In the process of generating the primitive, when the query includes a plurality of operators, a process of generating a single primitive by combining the plurality of operators based on an access frequency for a column pair included in the query syntax A computer-readable recording medium having recorded thereon a program for performing the method.
동적 컴파일(Dynamic Compilation)과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 장치에 있어서,
데이터베이스 데이터를 저장하고 있는 데이터베이스 저장부;
질의(Query)를 수신하는 질의 수신부;
상기 질의를 데이터베이스 시스템에서 실행하기 위한 최소 연산단위인 프리미티브(Primitive) 소스코드를 생성하는 프리미티브 소스코드 생성부;
상기 프리미티브 소스코드를 동적 컴파일러(Dynamic Compiler)를 이용하여 실행코드인 프리미티브를 생성하는 동적 컴파일러 및
상기 프리미티브를 실행하여 질의 처리 결과를 생성하는 질의 수행부를 포함하되,
상기 동적 컴파일러는 상기 질의가 복수 개의 연산자를 포함하는 경우 상기 질의의 구문에 포함된 칼럼 쌍에 대한 접근 빈도수에 기초하여 상기 복수 개의 연산자를 결합하여 하나의 프리미티브를 생성하는 것을 특징으로 하는 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 장치.
1. An apparatus for combining dynamic compilation and a query processing engine in a column prioritized manner,
A database storage unit for storing database data;
A query receiving unit that receives a query;
A primitive source code generation unit for generating a primitive source code which is a minimum operation unit for executing the query in a database system;
A dynamic compiler for generating a primitive which is an execution code using the dynamic compiler;
And a query execution unit for executing the primitive to generate a query processing result,
Wherein when the query includes a plurality of operators, the dynamic compiler combines the plurality of operators based on the frequency of accesses to the column pairs included in the syntax of the query to generate one primitive. A device that combines a query processing engine of the column priority arrangement type.
제 10 항에 있어서,
상기 데이터베이스 저장부의 테이블 저장 방식은 칼럼우선(Column-Wise) 배열 방식인 것을 특징으로 하는 동적 컴파일과 칼럼우선 배열 방식의 질의 처리 엔진을 결합하는 장치.
11. The method of claim 10,
Wherein the table storing method of the database storing unit is a column-wise arranging method.
KR1020130120840A 2013-10-10 2013-10-10 Method For Combining Column-Wise Query Engine With Dynamic Compilation Active KR101550679B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020130120840A KR101550679B1 (en) 2013-10-10 2013-10-10 Method For Combining Column-Wise Query Engine With Dynamic Compilation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020130120840A KR101550679B1 (en) 2013-10-10 2013-10-10 Method For Combining Column-Wise Query Engine With Dynamic Compilation

Publications (2)

Publication Number Publication Date
KR20150042084A KR20150042084A (en) 2015-04-20
KR101550679B1 true KR101550679B1 (en) 2015-09-07

Family

ID=53035335

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020130120840A Active KR101550679B1 (en) 2013-10-10 2013-10-10 Method For Combining Column-Wise Query Engine With Dynamic Compilation

Country Status (1)

Country Link
KR (1) KR101550679B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102774660B1 (en) 2023-11-29 2025-03-05 주식회사 리얼타임테크 Method for performing progressive query processing and system thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008084259A (en) 2006-09-29 2008-04-10 Japan Tobacco Inc Data gathering system
US20090119641A1 (en) 2007-11-07 2009-05-07 Microsoft Corporation Programming language extensions in structured queries
US20110219020A1 (en) 2010-03-08 2011-09-08 Oks Artem A Columnar storage of a database index

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008084259A (en) 2006-09-29 2008-04-10 Japan Tobacco Inc Data gathering system
US20090119641A1 (en) 2007-11-07 2009-05-07 Microsoft Corporation Programming language extensions in structured queries
US20110219020A1 (en) 2010-03-08 2011-09-08 Oks Artem A Columnar storage of a database index

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102774660B1 (en) 2023-11-29 2025-03-05 주식회사 리얼타임테크 Method for performing progressive query processing and system thereof

Also Published As

Publication number Publication date
KR20150042084A (en) 2015-04-20

Similar Documents

Publication Publication Date Title
KR100991091B1 (en) Data transformations for multiprocessor streaming applications
CN100550019C (en) OODB Object Oriented Data Base access method and system
EP2585950B1 (en) Apparatus and method for data stream processing using massively parallel processors
US8856103B2 (en) Predicate pushdown with late materialization in database query processing
Wang et al. BENU: Distributed subgraph enumeration with backtracking-based framework
CN112286961A (en) SQL optimization query method and device
Dees et al. Efficient many-core query execution in main memory column-stores
Yabuta et al. Relational joins on GPUs: A closer look
CN114328612A (en) Data processing method and device of query optimizer and electronic equipment
Fegaras et al. Compile-time code generation for embedded data-intensive query languages
Xu et al. Fast multi-column sorting in main-memory column-stores
Rayhan et al. SIMD-ified R-tree Query Processing and Optimization
Lv et al. RTScan: Efficient Scan with Ray Tracing Cores
KR101550679B1 (en) Method For Combining Column-Wise Query Engine With Dynamic Compilation
US12436951B2 (en) Dynamic operator pruning based on state dependencies and intermediate results
US10997175B2 (en) Method for predicate evaluation in relational database systems
Ogden et al. AT-GIS: highly parallel spatial query processing with associative transducers
CN118820292A (en) Query optimization method and system for multi-mode database
CN118312535A (en) SQL-based method and device for realizing efficient paging query of elastic search
Nguyen et al. GPU-accelerated VoltDB: A case for indexed nested loop join
Szárnyas et al. Evaluation of optimization strategies for incremental graph queries
Volk et al. GPU-Based Speculative Query Processing for Database Operations.
CN119065716A (en) Operator compilation method and device
CN115248686A (en) Analysis and optimization of compiler-generated code
Wheatman Cache and Memory Optimized Data Structures for High Performance Applications

Legal Events

Date Code Title Description
PA0109 Patent application

Patent event code: PA01091R01D

Comment text: Patent Application

Patent event date: 20131010

A201 Request for examination
PA0201 Request for examination

Patent event code: PA02012R01D

Patent event date: 20131023

Comment text: Request for Examination of Application

Patent event code: PA02011R01I

Patent event date: 20131010

Comment text: Patent Application

E902 Notification of reason for refusal
PE0902 Notice of grounds for rejection

Comment text: Notification of reason for refusal

Patent event date: 20150223

Patent event code: PE09021S01D

PG1501 Laying open of application
E701 Decision to grant or registration of patent right
PE0701 Decision of registration

Patent event code: PE07011S01D

Comment text: Decision to Grant Registration

Patent event date: 20150826

GRNT Written decision to grant
PR0701 Registration of establishment

Comment text: Registration of Establishment

Patent event date: 20150901

Patent event code: PR07011E01D

PR1002 Payment of registration fee

Payment date: 20150901

End annual number: 3

Start annual number: 1

PG1601 Publication of registration
FPAY Annual fee payment

Payment date: 20180903

Year of fee payment: 4

PR1001 Payment of annual fee

Payment date: 20180903

Start annual number: 4

End annual number: 4

PR1001 Payment of annual fee

Payment date: 20200701

Start annual number: 6

End annual number: 6

PR1001 Payment of annual fee

Payment date: 20210615

Start annual number: 7

End annual number: 7

PR1001 Payment of annual fee

Payment date: 20230622

Start annual number: 9

End annual number: 9