KR20210007665A - Apparatus and method for a query processing for in-memomry data in numa-based hardware - Google Patents

Apparatus and method for a query processing for in-memomry data in numa-based hardware Download PDF

Info

Publication number
KR20210007665A
KR20210007665A KR1020190084497A KR20190084497A KR20210007665A KR 20210007665 A KR20210007665 A KR 20210007665A KR 1020190084497 A KR1020190084497 A KR 1020190084497A KR 20190084497 A KR20190084497 A KR 20190084497A KR 20210007665 A KR20210007665 A KR 20210007665A
Authority
KR
South Korea
Prior art keywords
query
numa
numa node
operation group
query processing
Prior art date
Application number
KR1020190084497A
Other languages
Korean (ko)
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 KR1020190084497A priority Critical patent/KR20210007665A/en
Publication of KR20210007665A publication Critical patent/KR20210007665A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/24569Query processing with adaptation to specific hardware, e.g. adapted for using GPUs or SSDs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24532Query optimisation of parallel queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5033Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering data affinity

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Provided is a query processing method for in-memory data in a multiprocessor system environment of the NUMA structure, which comprises the steps of: configuring a query operation group based on a dependency relationship between query operations and the number of threads allocated to query processing; determining at least one candidate NUMA node in which a thread to perform query processing of the query operation group is to be executed based on a distribution rate for each NUMA node of query operation group input data; and determining a NUMA node in which a thread to perform query processing of the query operation group is executed in consideration of the candidate NUMA node and the NUMA node in which the thread is located.

Description

불균일 메모리 접근(NUMA) 구조를 가진 하드웨어에서 인-메모리 데이터에 대한 질의 처리 방법 및 장치{APPARATUS AND METHOD FOR A QUERY PROCESSING FOR IN-MEMOMRY DATA IN NUMA-BASED HARDWARE}Query processing method and device for in-memory data in hardware with non-uniform memory access (NUMA) structure {APPARATUS AND METHOD FOR A QUERY PROCESSING FOR IN-MEMOMRY DATA IN NUMA-BASED HARDWARE}

본 발명은 질의 처리 방법 및 장치에 관한 것으로 더욱 상세하게는 메모리 장치 접근 속도가 불균일한 NUMA(Non-Uniform Memory Access) 구조를 가진 하드웨어 환경에서 인-메모리 데이터에 대한 질의 처리 방법 및 장치에 관한 것이다. The present invention relates to a query processing method and apparatus, and more particularly, to a query processing method and apparatus for in-memory data in a hardware environment having a non-uniform memory access (NUMA) structure in which memory device access speed is non-uniform. .

NUMA 구조의 다중 프로세서 시스템은 다수의 NUMA 노드들로 구성되며 하나의 NUMA 노드 내에 다수의 CPU, 여러 계층의 캐시들, 메모리 컨트롤러 및 CPU간 링크가 패키징되어 있고, 여러 NUMA 노드들이 노드간 링크로 상호 연결된다. NUMA 노드 연결망은 모든 NUMA 노드들이 1홉 거리에 접근 가능한 완전 연결 구조 혹은 여러 홉 거리에 접근 가능한 부분 연결 구조를 갖는다.A multiprocessor system with a NUMA structure consists of a number of NUMA nodes, and a number of CPUs, caches of multiple layers, memory controllers, and links between CPUs are packaged in one NUMA node, and several NUMA nodes are interconnected by link between nodes. Connected. The NUMA node network has a fully connected structure in which all NUMA nodes can access one hop distance or a partial connection structure that can access several hop distances.

다중 프로세서 구조에서는 메모리 접근시 메모리 컨트롤러를 통해 직접 접근 가능한 지역 메모리와 NUMA 노드간 링크를 통해 접근 가능한 원격 메모리간에 접근 지연 속도가 상이한 NUMA 특성을 갖는다.In a multiprocessor architecture, NUMA characteristics have different access delay speeds between local memory that can be accessed directly through a memory controller and remote memory that can be accessed through a link between NUMA nodes when accessing memory.

NUMA 구조의 다중 프로세서 시스템에 탑재되는 인-메모리 데이터베이스 시스템에서는 데이터 접근 속도가 질의 처리 성능에 미치는 영향이 크므로 데이터 적재 위치를 고려하여 질의를 스케줄링 할 필요가 있다.In an in-memory database system mounted on a multiprocessor system with a NUMA structure, the data access speed has a large effect on the query processing performance, so it is necessary to schedule queries in consideration of the data loading location.

따라서, 데이터가 저장된 NUMA 노드의 CPU에서 질의 처리가 수행되도록 질의를 스케줄링하여 원격 메모리 접근을 최소화할 필요가 있다. 또한, 다른 NUMA 노드에서 실행 중인 스레드를 특정 NUMA 노드에 배치하기 위해서는 스레드 이전 비용이 발생하므로 스레드 이전에 소요되는 비용과 원격 메모리 접근 감소로 얻어지는 이점을 비교하여 이익이 더 큰 경우에만 스레드를 이전할 필요가 있다.Therefore, it is necessary to minimize remote memory access by scheduling queries so that query processing is performed in the CPU of the NUMA node where data is stored. In addition, in order to place a thread running on another NUMA node on a specific NUMA node, thread transfer costs are incurred, so the cost of transferring a thread is compared with the benefits of reducing remote memory access. There is a need.

즉, 데이터가 저장된 메모리와 질의 처리를 수행할 CPU가 같은 NUMA 노드에 위치하도록 데이터 지역성을 고려해야 하고 특정 NUMA 노드에서 질의 처리를 수행함으로써 얻는 이점이 특정 NUMA 노드로 스레드 이전 비용보다 높은지를 고려하여 질의를 스케줄링하여야 한다.In other words, the data locality should be considered so that the memory in which the data is stored and the CPU to perform the query processing are located in the same NUMA node, and the benefit of performing the query processing in a specific NUMA node is higher than the cost of transferring a thread to a specific NUMA node. Should be scheduled.

또한, 운영체제에서 제공하는 질의 스케줄링은 데이터베이스 시스템과 같은 특정 환경에서는 효율적이 아니므로 데이터베이스 서비스 환경 및 데이터베이스 시스템 구조 등을 고려하여 질의를 스케줄링할 필요가 있다.Also, since query scheduling provided by the operating system is not efficient in a specific environment such as a database system, it is necessary to schedule a query in consideration of the database service environment and database system structure.

데이터베이스 서비스를 위한 시스템 자원이 기 확보되어 운영되는 경우와 클라우드 서비스 환경처럼 자원을 동적으로 배정하는 환경의 요구 사항이 다르며, 데이터베이스 시스템의 데이터 관리 및 질의 처리 방법에 따라서도 최적의 질의 스케줄링 방법이 다르다. 즉, 질의 처리 성능 향상 혹은 필요한 자원 절감 등 달성하고자 하는 목표와 데이터베이스 시스템의 구조에 따라 최적의 질의 스케줄링 방법이 다르다.The requirements of an environment that dynamically allocates resources like a cloud service environment are different from the case where system resources for database services are already secured and operated, and the optimal query scheduling method is also different depending on the data management and query processing method of the database system. . That is, the optimal query scheduling method differs according to the goal to be achieved, such as improving query processing performance or reducing necessary resources, and the structure of the database system.

따라서, 데이터베이스 서비스용으로 자원이 미리 배정된 시스템에서 질의 처리 성능 향상을 위해 데이터를 파티션하여 파티션별로 인-메모리에 적재하고, 질의에서 접근하는 파티션이 저장된 NUMA 노드에 속한 CPU에서만 질의 처리를 수행하도록 제어하는 방식이 제안되고 있다. 하지만 이 방식의 경우 원격 메모리 접근은 최소화되나 특정 CPU 과부하로 성능 저하를 야기할 수 있고 서로 다른 NUMA 노드에 저장된 파티션들을 접근하는 질의는 고려하지 않고 있으므로 주기적으로 파티션을 재구성 및 재배치하여야 한다. Therefore, in a system where resources are pre-allocated for database service, to improve query processing performance, data is partitioned and loaded into in-memory for each partition, and query processing is performed only on the CPU belonging to the NUMA node where the partition accessed by the query is stored. A method of controlling has been proposed. However, in this method, remote memory access is minimized, but it may cause performance degradation due to a specific CPU overload, and since queries that access partitions stored in different NUMA nodes are not considered, partitions must be reconfigured and relocated periodically.

또한, 데이터를 동적으로 인-메모리에 적재 운영하는 환경을 위해 데이터베이스 서버별로 메모리 할당 이력과 CPU 활용율 등을 고려하여 질의 처리 스레드가 운영될 CPU 집합을 동적으로 제어하는 방식이 제안되고 있다. 하지만 이 방식의 경우 CPU 과부하는 방지되나 질의 연산에서 접근하는 데이터의 저장 위치에 따라 성능 저하가 야기될 수 있다.In addition, for an environment in which data is dynamically loaded into in-memory and operated, a method of dynamically controlling a CPU set in which a query processing thread is to be operated is proposed in consideration of memory allocation history and CPU utilization rate for each database server. However, in this method, CPU overload is prevented, but performance may be degraded depending on the storage location of the data accessed in the query operation.

상기와 같은 문제점을 해결하기 위한 본 발명의 목적은, 데이터를 파티션별로 인-메모리에 적재한 환경에서 질의 처리 성능 향상을 위해 NUMA-aware 질의 스케줄링 방법을 제공하는 데 있다.An object of the present invention to solve the above problems is to provide a NUMA-aware query scheduling method to improve query processing performance in an environment in which data is loaded into in-memory for each partition.

상기와 같은 문제점을 해결하기 위한 본 발명의 다른 목적은, 여러 NUMA 노드에 저장된 데이터 파티션들에 접근하는 질의에 대한 대처를 제공하면서 원격 메모리 접근을 최소화하고 자원 과부하 대처가 가능한 질의 스케줄링을 제공하는 데 있다. Another object of the present invention for solving the above problems is to provide query scheduling that minimizes remote memory access and can cope with resource overload while providing a response to queries that access data partitions stored in several NUMA nodes. have.

상기와 같은 문제점을 해결하기 위한 본 발명의 또 다른 목적은 질의 연산에서 참조하는 접근 데이터의 NUMA 노드 분포율, 질의 처리에 할당된 스레드 수, NUMA 노드의 자원 상황을 반영하여 질의 처리를 수행할 스레드가 실행될 NUMA 노드를 제어하는 방법을 제공하는 데 있다.Another object of the present invention for solving the above problems is to reflect the distribution ratio of NUMA nodes of access data referenced in the query operation, the number of threads allocated for query processing, and the resource status of the NUMA node, and the number of threads to perform query processing is It is to provide a way to control the NUMA node to be executed.

상기 목적을 달성하기 위한 본 발명의 일 실시예에 따른 불균일 메모리 접근(Non-Uniform Memory Access; NUMA) 구조의 다중 프로세서 시스템 환경에서 인-메모리 데이터에 대한 질의 처리 방법으로서, 질의 연산 간의 의존 관계 및 질의 처리 수행에 할당된 스레드 수를 기반으로 질의 연산 그룹 구성하는 단계; 질의 연산 그룹 입력 데이터의 NUMA 노드별 분포율에 기반하여 질의 연산 그룹의 질의 처리를 수행할 스레드가 실행될 적어도 하나의 후보 NUMA 노드를 결정하는 단계; 및 상기 후보 NUMA 노드 및 상기 스레드가 위치한 NUMA 노드를 고려하여 질의 연산 그룹의 질의 처리를 수행할 스레드가 실행될 NUMA 노드를 결정하는 단계를 포함할 수 있다.A method for processing a query for in-memory data in a non-uniform memory access (NUMA) multiprocessor system environment according to an embodiment of the present invention for achieving the above object, comprising: a dependency relationship between query operations and Configuring a query operation group based on the number of threads allocated to perform query processing; Determining at least one candidate NUMA node in which a thread to perform query processing of the query operation group is to be executed based on a distribution ratio of the query operation group input data for each NUMA node; And determining a NUMA node in which a thread to perform query processing of a query operation group is executed in consideration of the candidate NUMA node and the NUMA node in which the thread is located.

본 발명의 일 실시예에 따르면, NUMA 구조의 하드웨어 환경에서 원격 메모리 접근을 최소화함으로써 인-메모리 데이터에 대한 질의 처리 성능을 향상시키는 장점을 가진다. According to an embodiment of the present invention, it has an advantage of improving query processing performance for in-memory data by minimizing remote memory access in a hardware environment of a NUMA structure.

도 1은 본 발명이 적용되는 데이터베이스 서비스 시스템의 블록 구성도이다.
도 2는 본 발명이 적용되는 데이터베이스 서버의 블록 구성도이다.
도 3은 본 발명의 일 실시예에 따른 NUMA 노드별 접근 데이터에 기반하여 NUMA 노드를 선정하는 방법의 흐름도이다.
도 4는 본 발명의 일 실시예에 따른 연산 그룹을 구성하는 방법을 설명하기 위한 개념도이다.
도 5는 본 발명의 일 실시예에 따른 질의 처리 환경에 따른 NUMA-aware 질의 스케줄링을 설명하기 위한 개념도이다.
도 6은 본 발명의 일 실시예에 따른 NUMA-aware 질의 스케줄러의 질의 스케줄링 과정을 도시한다.
도 7은 본 발명의 일 실시예에 따른 질의 처리 방법의 동작 순서도이다.
도 8은 본 발명의 일 실시예에 따른 질의 처리 장치의 하드웨어 블록 구성도이다.
1 is a block diagram of a database service system to which the present invention is applied.
2 is a block diagram of a database server to which the present invention is applied.
3 is a flowchart of a method of selecting a NUMA node based on access data for each NUMA node according to an embodiment of the present invention.
4 is a conceptual diagram illustrating a method of configuring an operation group according to an embodiment of the present invention.
5 is a conceptual diagram illustrating NUMA-aware query scheduling according to a query processing environment according to an embodiment of the present invention.
6 shows a query scheduling process of the NUMA-aware query scheduler according to an embodiment of the present invention.
7 is a flowchart illustrating a query processing method according to an embodiment of the present invention.
8 is a hardware block diagram of a query processing apparatus according to an embodiment of the present invention.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다. In the present invention, various modifications may be made and various embodiments may be provided, and specific embodiments will be illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the present invention to a specific embodiment, it is to be understood to include all changes, equivalents, and substitutes included in the spirit and scope of the present invention. In describing each drawing, similar reference numerals have been used for similar elements.

제1, 제2, A, B 등의 용어는 다양한 구성요소들을 설명하는 데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. "및/또는"이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다. Terms such as first, second, A, and B may be used to describe various elements, but the elements should not be limited by the terms. These terms are used only for the purpose of distinguishing one component from another component. For example, without departing from the scope of the present invention, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element. The term "and/or" includes a combination of a plurality of related stated items or any of a plurality of related stated items.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다. When a component is referred to as being "connected" or "connected" to another component, it is understood that it may be directly connected or connected to the other component, but other components may exist in the middle. Should be. On the other hand, when a component is referred to as being "directly connected" or "directly connected" to another component, it should be understood that there is no other component in the middle.

본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terms used in the present application are only used to describe specific embodiments, and are not intended to limit the present invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. In the present application, terms such as "comprise" or "have" are intended to designate the presence of features, numbers, steps, actions, components, parts, or combinations thereof described in the specification, but one or more other features. It is to be understood that the presence or addition of elements or numbers, steps, actions, components, parts, or combinations thereof, does not preclude in advance.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥 상 가지는 의미와 일치하는 의미를 가지는 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless otherwise defined, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art to which the present invention belongs. Terms as defined in a commonly used dictionary should be interpreted as having a meaning consistent with the meaning in the context of the related technology, and should not be interpreted as an ideal or excessively formal meaning unless explicitly defined in this application. Does not.

이하, 본 발명에 따른 바람직한 실시예를 첨부된 도면을 참조하여 상세하게 설명한다. Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명이 적용되는 데이터베이스 서비스 시스템의 블록 구성도이다.1 is a block diagram of a database service system to which the present invention is applied.

데이터베이스 서비스 시스템은 데이터베이스 서버(1000), 인-메모리 데이터베이스(2000) 및 영속 데이터베이스(3000)를 포함하여 구성될 수 있다.The database service system may include a database server 1000, an in-memory database 2000, and a persistent database 3000.

도 1을 참조하면, 데이터베이스 서버(1000)는 2 개 이상의 NUMA 노드(2100)들로 구성된 다중 프로세서 시스템상에서 운영될 수 있고, 인-메모리 데이터베이스(2000)는 각 NUMA 노드의 메모리에 하나 이상의 데이터 파티션(2200)들이 적재되는 것을 포함하여 구성될 수 있고, 데이터베이스 서버(1000)는 인-메모리 데이터베이스(2000)를 대상으로 하는 질의 처리 수행 요청을 처리할 수 있다. 질의는 하나의 NUMA 노드에 적재된 데이터만을 대상으로 하는 질의일 수도 있고, 여러 NUMA 노드에 적재된 데이터들을 대상으로 하는 질의일 수도 있다. 인-메모리 데이터베이스(2000)는 데이터의 지속적인 저장 및 관리를 위해 필요한 경우 데이터를 영속 DB(3000)로 부터 가져오거나 영속 DB에 저장할 수 있다. Referring to FIG. 1, the database server 1000 may be operated on a multiprocessor system composed of two or more NUMA nodes 2100, and the in-memory database 2000 includes one or more data partitions in the memory of each NUMA node. 2200 may be loaded, and the database server 1000 may process a query processing request for the in-memory database 2000. The query may be a query that targets only the data loaded in one NUMA node, or it may be a query that targets data loaded in several NUMA nodes. The in-memory database 2000 may fetch data from the persistent DB 3000 or store the data in the persistent DB when necessary for continuous storage and management of data.

도 2는 본 발명이 적용되는 데이터베이스 서버의 블록 구성도이다.2 is a block diagram of a database server to which the present invention is applied.

데이터베이스 서버(1000)는 데이터를 인-메모리 DB 및 영속 DB에 저장, 동시성 제어 및 트랜잭션 관리 등을 담당하는 데이터 스토리지(1200)와 질의문 파싱, 질의 최적화, 질의 처리 수행 기능을 담당하는 질의 처리 장치(1100)를 포함하여 구성될 수 있다. 질의 처리 장치는 질의문 파서(1110), 질의 최적화기(1120), 질의 수행 NUMA 노드 선정기(1130), NUMA-aware 질의 스케줄러(1140)와 질의 수행기(1150)를 포함하여 구성될 수 있다.The database server 1000 stores data in an in-memory DB and a persistent DB, a data storage 1200 in charge of concurrency control and transaction management, and a query processing device in charge of query parsing, query optimization, and query processing execution functions. It may be configured to include (1100). The query processing apparatus may include a query parser 1110, a query optimizer 1120, a query execution NUMA node selector 1130, a NUMA-aware query scheduler 1140, and a query executer 1150.

질의문 파서(1110)는 질의문을 파싱하여 파스 트리를 생성하고, 질의 최적화기(1120)는 파스 트리로부터 정제된 질의로 변환 및 비용 기반 최적화를 수행하여 질의 처리 수행 계획을 생성할 수 있다. 질의 수행 NUMA 노드 선정기(1130)는 질의 처리 수행 계획을 기반으로 질의 연산 그룹으로의 분할 및 질의 연산 그룹의 질의를 처리할 스레드가 실행될 후보 NUMA 노드를 선정할 수 있다. NUMA-aware 질의 스케줄러(1140)는 후보 NUMA 노드의 상태를 고려하여 스레드 이전을 최소화하여 선정된 후보 NUMA 노드에서 질의 처리 스레드가 실행될 수 있도록 제어하는 기능을 담당할 수 있다. 질의 수행기(1150)는 질의 처리를 실제로 수행하는 역할을 담당할 수 있다. The query parser 1110 may parse the query to generate a parse tree, and the query optimizer 1120 may generate a query processing execution plan by converting from the parse tree to a refined query and performing cost-based optimization. The query execution NUMA node selector 1130 may divide into a query operation group and select a candidate NUMA node in which a thread to process a query of the query operation group will be executed based on a query processing execution plan. The NUMA-aware query scheduler 1140 may be in charge of controlling a query processing thread to be executed in a selected candidate NUMA node by minimizing thread transfer in consideration of the state of the candidate NUMA node. The query executer 1150 may play a role of actually performing query processing.

도 3은 본 발명의 일 실시예에 따른 NUMA 노드별 접근 데이터에 기반하여 NUMA 노드를 선정하는 방법의 흐름도이다.3 is a flowchart of a method of selecting a NUMA node based on access data for each NUMA node according to an embodiment of the present invention.

질의 처리 수행할 스레드를 할당하기 위한 NUMA 노드 선정은 먼저, NUMA 노드별 접근 데이터 규모로부터 전체 접근 데이터 규모를 계산하고(S301), NUMA 노드별로 전체 접근 데이터 규모 대비 비율을 계산한다(S302). 이어서, NUMA 노드별로 전체 접근 데이터 규모 대비 비율이 기준치 이상인지 분석하여(S303), 기준치 이상이면 후보 NUMA 노드 리스트에 추가한다(S304). 다음으로 모든 NUMA 노드에 대한 분석이 완료되었는지 확인하여(S305) 완료되었으면 최종 NUMA 노드를 선정(S306)하고 종료한다. 최종 NUMA 노드는 하나 혹은 여러 노드일 수 있다. In selecting a NUMA node for allocating a thread to perform query processing, first, the total access data size is calculated from the access data size for each NUMA node (S301), and a ratio of the total access data size for each NUMA node is calculated (S302). Subsequently, it is analyzed whether the ratio of the total access data size to each NUMA node is greater than or equal to the reference value (S303), and if it is greater than or equal to the reference value, the candidate NUMA node list is added (S304). Next, it is checked whether the analysis of all NUMA nodes has been completed (S305), and if the analysis is completed, the final NUMA node is selected (S306) and is terminated. The final NUMA node can be one or several nodes.

질의 처리는 각 질의 연산에서 접근하는 데이터의 NUMA 노드별 접근 데이터 규모를 기반으로 접근 데이터가 편중된 NUMA 노드에서 수행하는 것이 이득일 수 있다. 또한, 스레드를 이전하는 비용이 다른 NUMA 노드 내의 원격 메모리로 접근하는 비용보다 더 적은 경우 NUMA 노드별 접근 데이터 규모를 기반으로 특정한 NUMA 노드로 스레드 이전하여 질의 처리를 수행하는 것이 이득일 수 있다. 예를 들어, NUMA 노드 4개로 구성된 인-메모리 DB에서 접근 데이터 규모가 100이고, 각 NUMA 노드별 접근 데이터 규모가 (50, 25, 25, 0)인 경우가 각 NUMA 노드별 접근 데이터 규모가 (28, 25, 25, 22)인 경우보다 노드 0으로 스레드를 이전하여 질의 처리를 수행하는 것이 이득일 수 있다. It may be beneficial to perform query processing in a NUMA node where access data is biased based on the size of access data for each NUMA node of data accessed in each query operation. In addition, when the cost of transferring a thread is less than the cost of accessing a remote memory in another NUMA node, it may be beneficial to perform query processing by transferring a thread to a specific NUMA node based on the size of access data for each NUMA node. For example, in an in-memory DB consisting of 4 NUMA nodes, if the access data size is 100 and the access data size for each NUMA node is (50, 25, 25, 0), the access data size for each NUMA node is ( 28, 25, 25, 22), it may be more beneficial to transfer the thread to node 0 to perform query processing.

그러므로 질의 처리를 수행할 후보 NUMA 노드 선정은 NUMA 노드의 접근 데이터 분포율이 기준치 이상일 때 선정할 수 있다. 즉, 전체 접근 데이터 규모 대비 기준치를 넘는 접근 데이터 규모를 갖는 NUMA 노드가 있을 때 질의 처리를 수행할 후보 NUMA 노드로 선정할 수 있다. 기준치는 운영되는 시스템 환경의 NUMA 노드 수를 고려하여 최적의 값이 선정될 수 있다.Therefore, the selection of candidate NUMA nodes to perform query processing can be selected when the access data distribution ratio of the NUMA node is greater than or equal to the reference value. That is, when there is a NUMA node with an access data size that exceeds the reference value compared to the total access data size, it can be selected as a candidate NUMA node to perform query processing. The reference value may be selected in consideration of the number of NUMA nodes in the operating system environment.

후보 NUMA 노드는 수학식 1을 이용하여 선정될 수 있다. 후보 NUMA 노드는

Figure pat00001
가 기준치 이상인 노드로 선정될 수 있다. The candidate NUMA node may be selected using Equation 1. Candidate NUMA nodes are
Figure pat00001
May be selected as a node that is equal to or greater than the reference value.

Figure pat00002
Figure pat00002

여기서,

Figure pat00003
는 NUMA 노드 i의 접근 데이터 규모, n은 NUMA 노드의 수,
Figure pat00004
는 전체 접근 데이터 규모 대비 NUMA 노드 i의 접근 데이터 규모 비율을 의미한다.here,
Figure pat00003
Is the size of the access data of NUMA node i, n is the number of NUMA nodes,
Figure pat00004
Is the ratio of the size of the access data of NUMA node i to the size of the total access data.

예를 들어, 각 NUMA 노드별 접근 데이터 규모가 (45, 40, 10, 5)인 경우 노드 0에서 질의 처리를 수행하는 것과 노드 1에서 질의 처리를 수행하는 것의 이득 차이가 적을 수 있다. 그러므로, 최종 NUMA 노드는 접근 데이터 규모가 최상위인 후보 NUMA 노드만 선정될 수도 있고, 접근 데이터 규모 비율이 기준치를 넘는 후보 NUMA 노드를 모두 선정하고 실제 질의 처리를 수행하는 중에 자원 상황에 따라 최종 NUMA 노드를 선정할 수도 있다. 실제 질의 처리 수행하는 중에 자원 상황에 따라 최종 NUMA 노드를 선정하는 경우 질의 처리 수행 결과를 활용하는 이후 질의에 대한 후보 NUMA 노드 선정은 질의 처리 수행 직전에 동적으로 수행할 수 있어야 한다. For example, when the size of the access data for each NUMA node is (45, 40, 10, 5), the difference in gains between performing query processing in node 0 and performing query processing in node 1 may be small. Therefore, only candidate NUMA nodes with the highest access data size may be selected as the final NUMA node, or the final NUMA node depending on the resource situation during the actual query processing by selecting all candidate NUMA nodes whose access data size ratio exceeds the standard value. You can also select. If the final NUMA node is selected according to the resource situation during actual query processing, the selection of candidate NUMA nodes for the query after the query processing execution result is used must be dynamically executed immediately before the query processing is executed.

접근하는 데이터 규모는 입력 데이터 규모, 입력 데이터를 참조하는 질의 연산 종류를 고려하여 예측할 수 있다. 즉, 입력 데이터가 선행 질의 연산의 처리 결과이면 접근하는 데이터 규모는 선행 질의 연산 처리 결과로 생성될 데이터에 대한 예측 데이터 규모일 수 있고, 입력 데이터가 영속 데이터이면 레코드 수, 데이터 타입 등을 고려하여 접근 데이터의 규모를 산정할 수 있다. 또한, 입력 데이터를 참조하는 질의 연산 종류에 따라 접근하는 데이터의 집합이 입력 데이터 전체일 수 있고 입력 데이터의 일부일 수 있다. 예를 들어, 특정 값을 갖는 질의 연산이 인덱스 기반 질의 연산이면 접근하는 데이터 집합에 속하는 모든 데이터에 접근하는 대신 몇 개의 인덱스 레코드와 인덱스가 지정하는 데이터에만 접근하여 입력 데이터 규모를 예측할 수 있다.The size of the accessed data can be predicted by considering the size of the input data and the type of query operation that refers to the input data. That is, if the input data is the result of processing the preceding query operation, the size of the data accessed may be the size of the predicted data for the data to be generated as a result of processing the preceding query operation, and if the input data is persistent data, consider the number of records and data type. The size of the access data can be estimated. In addition, the set of accessed data may be the entire input data or part of the input data according to the type of query operation referring to the input data. For example, if a query operation with a specific value is an index-based query operation, the size of the input data can be predicted by accessing only a few index records and data designated by the index instead of accessing all data belonging to the accessed data set.

질의 연산 처리 결과에 기반한 접근 데이터 규모를 예측하는 것은 선택 인자(selectivity factor)와 같은 기준을 이용하여 계산 가능하며, 질의 최적화기(1120)에 의해 질의 연산 처리 결과에 기반한 접근 데이터 규모를 예측할 수 있으므로 본 발명에서는 접근 데이터 규모는 이미 알고 있는 것으로 간주한다. Estimating the size of the access data based on the result of the query operation processing can be calculated using the same criteria as the selectivity factor, and the size of the access data based on the result of the query operation processing can be predicted by the query optimizer 1120. In the present invention, it is assumed that the size of the access data is already known.

도 4는 본 발명의 일 실시예에 따른 질의 연산 그룹을 구성하는 방법을 설명하기 위한 개념도이다.4 is a conceptual diagram illustrating a method of configuring a query operation group according to an embodiment of the present invention.

본 발명에서는 질의 처리 수행할 NUMA 노드를 질의 연산 그룹을 구성하여 질의 연산 그룹별로 선정할 수 있다. 즉, 질의 연산간의 의존 관계에 따라 선행 질의 연산의 결과만을 이용하는 질의 연산이라면 선행 질의 연산과 같은 NUMA 노드에서 질의 처리를 수행하면 되므로 선행 질의 연산과 함께 질의 연산 그룹을 구성할 수 있다.In the present invention, a NUMA node to perform query processing may be selected for each query operation group by configuring a query operation group. In other words, if a query operation that uses only the result of the preceding query operation according to the dependency relationship between query operations, the query processing can be performed in the same NUMA node as the preceding query operation, so a query operation group can be formed together with the preceding query operation.

질의 연산들을 질의 연산 그룹으로 분할하는 것은 선행 질의 연산과 같은 NUMA 노드에서 질의 처리를 수행하는 게 최적인 질의 연산들로 구성하는 것으로 다음과 같이 실시할 수 있다. 먼저, 저장 프로시저(stored procedure) 호출처럼 별도로 구성된 질의 블록을 호출하는 경우에는 질의 블록별로 질의 연산 그룹 분할을 실시할 수 있다. 그 다음, 질의 연산들의 관계가 DAG(Directed Acyclic Graph)로 구성된 질의 블록을 기반으로 영속 데이터에 접근하는 질의 연산은 새로운 그룹을 구성하고, 바로 이전 질의 연산 처리 결과만이 접근하는 질의 연산은 바로 이전 질의 연산과 같은 그룹을 구성하고, 여러 선행 질의 연산들의 처리 결과를 고려하는 질의 연산은 새로운 그룹을 구성한다.Dividing query operations into query operation groups consists of query operations that are optimal to perform query processing in the NUMA node, such as the preceding query operation, and can be performed as follows. First, when calling a separately configured query block, such as calling a stored procedure, a query operation group can be divided for each query block. Then, the relationship between the query operations is based on a query block composed of DAG (Directed Acyclic Graph), and the query operation that accesses persistent data constitutes a new group, and the query operation that only accesses the result of the previous query operation is immediately previous. A query operation that composes the same group as the query operation and considers the processing results of several preceding query operations constitutes a new group.

예를 들어, 도 4의 개념도처럼 질의 블록이 e1 질의 연산부터 e10 질의 연산으로 구성된 10개의 질의 연산들이 그래프 의존 관계를 갖는 경우 4개의 질의 연산 그룹으로 구성될 수 있다. e1 질의 연산이나 e8 질의 연산은 영속 데이터에 접근하는 질의 연산이므로 각각 연산 그룹1 및 연산 그룹2로 구성될 수 있다. e2 질의 연산부터 e7 질의 연산은 바로 이전 질의 연산 처리 결과만을 고려하는 질의 연산들이므로 연산 그룹1로 구성될 수 있다. e9 질의 연산 및 e10 질의 연산은 여러 선행 질의 연산들의 처리 결과를 고려하므로 각각 연산그룹 3 및 연산그룹 4로 구성될 수 있다.For example, as shown in the conceptual diagram of FIG. 4, when a query block has a graph dependency relationship between 10 query operations consisting of an e1 query operation to an e10 query operation, it may be composed of four query operation groups. Since the e1 query operation or the e8 query operation is a query operation that accesses persistent data, it can be composed of operation group 1 and operation group 2, respectively. Since query operations e2 to e7 are query operations that consider only the result of the previous query operation processing, they can be composed of operation group 1. Since the e9 query operation and the e10 query operation consider the processing results of several preceding query operations, they can be composed of operation group 3 and operation group 4, respectively.

연산 그룹에 대한 질의 처리 수행 NUMA 노드는 연산 그룹 내에서 참조하는 데이터 중 입력 데이터의 위치에 의해 선정될 수 있다. 따라서, 연산 그룹 입력 데이터의 NUMA 노드별 분포율을 기반으로 연산 그룹에 대한 질의 처리 수행 NUMA 노드를 선정할 수 있다. The NUMA node that performs query processing on the operation group may be selected according to the location of the input data among data referenced within the operation group. Accordingly, a NUMA node that performs query processing for an operation group can be selected based on the distribution ratio of the operation group input data by NUMA node.

도 5는 본 발명의 일 실시예에 따른 질의 처리 환경에 따른 NUMA-aware 질의 스케줄링을 설명하기 위한 개념도이다.5 is a conceptual diagram illustrating NUMA-aware query scheduling according to a query processing environment according to an embodiment of the present invention.

본 발명에서는 연산 그룹의 질의 처리 수행 NUMA 노드 및 연산 그룹간의 의존 관계를 기반으로 NUMA-aware 질의 스케줄링을 실시할 수 있다. 순차 처리 환경과 병렬 처리 환경을 고려하여 질의 스케줄링을 실시할 수 있다.In the present invention, NUMA-aware query scheduling may be performed based on a dependency relationship between a NUMA node performing query processing of an operation group and an operation group. Query scheduling can be performed in consideration of the sequential processing environment and the parallel processing environment.

순차 처리 환경에서는 스레드가 질의 처리 수행할 다음 연산 그룹은 연산 그룹간의 의존 관계 그래프에서 DFS(Depth First Search) 방식으로 탐색하여 선정되므로 질의 처리를 수행할 순서대로 연산 그룹을 선정하여 스레드에 할당할 수 있다. 또한, 병렬 처리 환경에서는 스레드가 질의 처리 수행할 다음 연산 그룹은 의존 관계에 있는 다음 후보 연산 그룹 중 스레드와 지역성이 높은 연산 그룹을 우선적으로 선정되어 스레드에 할당할 수 있다. 즉, 질의 처리 수행 NUMA 노드와 스레드가 위치한 NUMA 노드가 동일한지 여부 또는 NUMA 노드간 토폴로지(topology)를 고려하여 가까운 NUMA 노드 순으로 스레드가 질의 처리를 수행할 다음 연산 그룹이 선정될 수 있다. In the sequential processing environment, the next operation group that the thread will perform query processing is selected by searching for the next operation group in the dependency relationship graph between operation groups in DFS (Depth First Search) method, so the operation group can be selected and assigned to the thread in the order in which the query will be processed. have. In addition, in a parallel processing environment, a thread and an operation group having a high locality among the next candidate operation groups having a dependency relationship may be preferentially selected and assigned to the thread as the next operation group to be processed by the thread. That is, the next operation group in which the thread performs query processing may be selected in the order of the nearest NUMA node in consideration of whether the query processing NUMA node and the NUMA node in which the thread is located are the same, or in consideration of the topology between NUMA nodes.

선정된 연산 그룹의 질의 처리 수행 NUMA 노드와 스레드가 위치한 NUMA 노드가 다르면 질의 처리를 수행하기 전에 선정된 NUMA 노드 정보 기반으로 자원 상황을 파악하여 과부하가 아니면 질의 처리를 수행할 스레드를 선정된 NUMA 노드로 이전하고 선정된 NUMA 노드내에서 질의 처리가 수행되도록 환경을 설정할 수 있다. 선정된 NUMA 노드의 자원이 과부하인 경우에는 운영 체제의 스케줄링 정책에 따라 질의 처리를 수행한다. If the NUMA node and the NUMA node where the thread is located are different from each other, the selected NUMA node determines the resource status based on the selected NUMA node information before performing the query processing, and if it is not overloaded, the thread to perform the query processing is selected. The environment can be set so that query processing is performed within the selected NUMA node after moving to. When the resource of the selected NUMA node is overloaded, query processing is performed according to the scheduling policy of the operating system.

예를 들어, 도 5의 개념도를 참고하여 질의 처리 수행 NUMA 노드가 선정된 연산 그룹 1부터 연산 그룹 8로 구성된 질의 처리 수행 계획을 순차 처리하는 경우에는 우선 깊이 탐색(Depth First Search) 방식으로 연산 그룹간의 의존 관계에 따라 1개의 스레드를 할당하여 연산 그룹 1 -연산 그룹2 - 연산 그룹4 - 연산 그룹 3 - 연산 그룹 5 - 연산 그룹 7 - 연산 그룹 6 - 연산 그룹8순으로 질의 처리를 수행한다. 또한, 연산 그룹1의 질의 처리를 수행한 후 연산 그룹 2의 질의 처리를 수행하기 위해 노드 2로 스레드 이전이 발생하고, 연산 그룹 4의 질의 처리를 수행한 후 연산 그룹 3의 질의 처리를 수행하기 위해 노드 1로 스레드 이전이 발생한다.For example, when the query processing execution plan consisting of operation group 1 to operation group 8 in which the NUMA node is selected for query processing is sequentially processed by referring to the conceptual diagram of FIG. 5, a depth first search method is used. One thread is allocated according to the dependency relationship between them and query processing is performed in the order of operation group 1-operation group 2-operation group 4-operation group 3-operation group 5-operation group 7-operation group 6-operation group 8. In addition, a thread transfer occurs to node 2 to perform query processing of operation group 2 after performing query processing of operation group 1, and query processing of operation group 3 is performed after query processing of operation group 4 is performed. For this, a thread transfer to node 1 occurs.

질의 처리 수행 계획을 병렬 처리하는 경우에는 연산 그룹들을 그룹핑한 4개 묶음(510 520, 530, 540)에서 묶음 내의 연산 그룹들 간에는 의존 관계가 없으므로 선행 연산 그룹의 질의 처리 수행이 완료되면 바로 다음 연산 그룹의 질의 처리 수행이 가능하다. 예를 들어, 3 개의 스레드가 할당된 경우 각각 노드 0, 2, 1에 위치한 스레드가 연산 그룹 1, 연산 그룹 2, 연산 그룹 3을 담당하여 동시에 질의 처리를 수행할 수 있다. 즉, 연산 그룹4는 연산 그룹1과 연산 그룹2의 질의 처리 수행이 완료되면 질의 처리 수행이 가능하며, 연산 그룹4는 노드2가 최적 질의 처리 수행 노드이므로 노드2에서 연산 그룹2의 질의 처리를 수행한 스레드가 담당할 수 있도록 스레드를 할당한다. 묶음2(520)에 있던 3개의 연산 그룹이 동시에 질의 처리를 수행하기 위해서는 연산 그룹 5와 연산 그룹 6의 최적 수행 노드가 1이므로 노드 0에 있던 스레드가 질의 처리를 수행하도록 할당하고 노드 1로 스레드를 이전하여 질의 처리를 수행한다. In the case of parallel processing of the query processing execution plan, since there is no dependency relationship between the operation groups in the group in the four bundles (510 520, 530, 540) that group the operation groups, the next operation immediately after the query processing of the preceding operation group is completed. Group query processing can be performed. For example, when three threads are allocated, a thread located at nodes 0, 2, and 1, respectively, may be in charge of operation group 1, operation group 2, and operation group 3 to perform query processing at the same time. In other words, operation group 4 can perform query processing when operation group 1 and operation group 2 query processing is completed. In operation group 4, since node 2 is the optimal query processing node, node 2 performs query processing of operation group 2 Allocates threads so that the executing thread can take care of it. In order for the three operation groups in bundle 2 520 to perform query processing at the same time, the optimal execution node of operation group 5 and operation group 6 is 1, so the thread in node 0 is assigned to perform query processing, and the thread is assigned to node 1. Is transferred to perform query processing.

도 6은 본 발명의 일 실시예에 따른 NUMA-aware 질의 스케줄러의 질의 스케줄링 과정을 도시한다. 6 shows a query scheduling process of the NUMA-aware query scheduler according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 NUMA-aware 질의 스케줄러는 질의 연산 그룹간 의존 관계, 질의 연산 그룹의 질의 처리 수행 후보 NUMA 노드 및 스레드가 위치한 NUMA 노드 기반으로 스레드가 스케줄링할 질의 연산 그룹을 선정하고(S601), 연산 그룹의 후보 NUMA 노드와 스레드가 위치한 NUMA 노드가 일치하는지 확인한다(S602).The NUMA-aware query scheduler according to an embodiment of the present invention selects a query operation group to be scheduled by a thread based on the dependency relationship between the query operation groups, the query processing candidate NUMA node of the query operation group, and the NUMA node where the thread is located ( S601), it is checked whether the candidate NUMA node of the computation group and the NUMA node in which the thread is located match (S602).

그 다음, 연산 그룹의 후보 NUMA 노드와 스레드가 위치한 NUMA 노드가 일치하지 않는 경우 후보 NUMA 노드의 과부하를 확인하여(S603) 과부하가 아니면 현재 질의 처리를 수행하고 있는 스레드의 운영 환경을 선정된 후보NUMA 노드로 설정한다(S604). 스레드 운영 환경 설정을 스레드가 실행될 CPU를 선정된 후보 NUMA 노드로 한정하고, 메모리는 선정된 후보 NUMA 노드에 우선적으로 할당하고 선정된 후보 NUMA 노드에 메모리가 부족할 경우에는 다른 NUMA 노드에 메모리 할당이 가능하도록 설정한다. 후보 NUMA 노드가 과부하면 현재 질의 처리를 수행하고 있는 스레드의 운영 환경을 모든 NUMA 노드로 재설정하여(S605) 운영 체제의 질의 스케줄링 정책에 질의 처리 수행을 일임한다. 다만, 운영 체제 질의 스케줄링에 의해 연산 그룹의 질의 처리가 수행됨으로써 생성된 결과 데이터와 선정된 후보 NUMA 노드에서 연산 그룹의 질의 처리가 수행됨으로써 예상한 결과 데이터의 위치가 다를 수 있다. 그러므로, 다음 연산 그룹에 대하여 기선정된 NUMA 노드는 질의 처리를 수행하기 위한 최적의 노드가 아닐 수 있으므로 동적 NUMA 노드 선정 정책을 적용할 수도 있다.Then, if the candidate NUMA node of the computation group and the NUMA node where the thread is located do not match, the candidate NUMA node is checked for overload (S603), and if it is not overload, the operating environment of the thread currently processing the query is selected. It is set as a node (S604). The thread operating environment setting is limited to the CPU on which the thread will be executed to the selected candidate NUMA node, and memory is preferentially allocated to the selected candidate NUMA node, and if memory is insufficient in the selected candidate NUMA node, memory can be allocated to other NUMA nodes. Set to If the candidate NUMA node is overloaded, the operating environment of the thread currently executing the query processing is reset to all NUMA nodes (S605), and the query processing is assigned to the query scheduling policy of the operating system. However, the location of the expected result data may be different from the result data generated by the query processing of the operation group by the operating system query scheduling and the query processing of the operation group in the selected candidate NUMA node. Therefore, since the NUMA node previously selected for the next operation group may not be the optimal node for performing query processing, a dynamic NUMA node selection policy may be applied.

스레드 운영 환경 설정 후 질의 수행기(1150)에 의해 질의 연산 그룹의 질의 처리를 수행한다(S606). 질의 처리 수행 계획을 구성하는 모든 질의 연산 그룹의 질의 처리 수행이 완료(S607)될 때까지 질의 스케줄링을 수행하고 모든 질의 연산 그룹의 질의 처리 수행이 완료되면 다음 질의 처리를 위해 스레드 운영 환경을 모든 NUMA 노드로 재설정한다(S608).After setting the thread operating environment, the query processor 1150 performs query processing of the query operation group (S606). Query scheduling is performed until query processing of all query operation groups constituting the query processing execution plan is completed (S607), and when query processing of all query operation groups is completed, the thread operating environment is set to all NUMAs for the next query processing. The node is reset (S608).

질의 연산간의 의존 관계 기반으로 구성된 연산 그룹의 개수가 너무 많고 할당된 스레드 수가 적은 경우에는 연산 그룹에 기반한 질의 스케줄링은 과도한 스레드 이전 비용을 초래할 수 있다. 이 경우에는 연산 그룹들을 통합하여 통합 연산 그룹 구성을 통해 질의 스케줄링 대상 연산 그룹의 수를 감소시킬 수 있다.If the number of operation groups configured based on the dependency relationship between query operations is too large and the number of allocated threads is small, query scheduling based on the operation group may incur excessive thread transfer costs. In this case, it is possible to reduce the number of query scheduling target operation groups through the composition of the integrated operation group by integrating the operation groups.

통합 연산 그룹은 말단 연산 그룹 2개를 통합한 것을 기반으로 다시 연산 그룹간 관계를 고려하여 연산 그룹을 재구성하며 적절한 수의 연산 그룹이 구성될 때까지 반복적으로 수행할 수 있다. The integrated operation group reconstructs the operation group in consideration of the relationship between the operation groups again based on the integration of the two terminal operation groups, and may be repeatedly performed until an appropriate number of operation groups is formed.

즉, 연산 그룹의 재구성은 통합된 말단 연산 그룹을 이용하는 후행 연산 그룹이 하나의 연산 그룹의 결과만을 이용하는 경우에는 통합된 말단 연산 그룹과 후행 연산 그룹을 통합할 수 있다. That is, the reconstruction of the operation group may combine the unified terminal operation group and the subsequent operation group when the subsequent operation group using the unified terminal operation group uses only the result of one operation group.

또한, 말단 연산 그룹 중 통합 대상 선정은 다음과 같은 우선 순위로 수행할 수 있다. 먼저, 동일한 질의 처리 수행 NUMA 노드를 갖는 말단 연산 그룹들을 먼저 통합한다. 그 다음, 동일한 질의 처리 수행 NUMA 노드를 갖는 말단 연산 그룹이 존재하지 않으면 말단 연산 그룹을 이용하는 후행 연산 그룹의 중복도가 높은 연산 그룹들을 먼저 통합한다. In addition, the selection of an integration target among the terminal operation groups may be performed in the following priority order. First, the end operation groups having the same query processing NUMA node are first integrated. Then, if there is no end-operation group having the same query processing NUMA node, operation groups with high redundancy of the subsequent operation group using the end-operation group are first integrated.

도 7은 본 발명의 일 실시예에 따른 질의 처리 방법의 동작 순서도이다.7 is a flowchart illustrating a query processing method according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 질의 처리 방법은, 먼저, 질의 연산간의 의존 관계 및 질의 처리 수행에 할당된 스레드 수를 고려하여 질의 연산 그룹을 구성한다(S710). 그 다음, 질의 연산 그룹 입력 데이터의 NUMA 노드별 비율에 기반하여 후보 NUMA 노드를 선정하고(S720), 후보 NUMA 노드와 스레드가 위치한 NUMA 노드를 비교하여 질의 연산 그룹의 질의 처리를 수행할 NUMA 노드를 결정한다(S730).In a query processing method according to an embodiment of the present invention, first, a query operation group is configured in consideration of a dependency relationship between query operations and the number of threads allocated to perform query processing (S710). Then, a candidate NUMA node is selected based on the ratio of the query operation group input data by NUMA node (S720), and the NUMA node to perform query processing of the query operation group is selected by comparing the candidate NUMA node and the NUMA node in which the thread is located. It is determined (S730).

도 8은 본 발명의 일 실시예에 따른 질의 처리 장치의 하드웨어 블록 구성도이다.8 is a hardware block diagram of a query processing apparatus according to an embodiment of the present invention.

본 발명의 일 실시예에 따른 질의 처리 장치(1100)는 프로세서(1102) 및 프로세서를 통해 실행되는 적어도 하나의 명령 및 명령 수행의 결과를 저장하는 메모리(1101), 그리고 통신 모듈(1103)을 포함할 수 있다. The query processing apparatus 1100 according to an embodiment of the present invention includes a processor 1102 and a memory 1101 for storing at least one instruction executed through the processor and a result of the instruction execution, and a communication module 1103 can do.

여기서, 적어도 하나의 명령은 상기 프로세서로 하여금 질의 연산 간의 의존 관계 및 질의 처리 수행에 할당된 스레드 수에 기반하여 질의 연산 그룹을 구성하도록 하는 명령; 질의 연산 그룹 입력 데이터의 NUMA 노드별 분포율에 기반하여 상기 질의 연산 그룹의 질의 처리를 수행할 스레드가 실행될 후보 NUMA 노드를 결정하도록 하는 명령; 상기 후보 NUMA 노드 및 상기 스레드가 위치한 NUMA 노드를 고려하여 질의 연산 그룹의 질의 처리를 수행할 스레드가 실행될 NUMA 노드를 결정하도록 하는 명령; 을 포함할 수 있다.Here, the at least one instruction includes: an instruction for causing the processor to configure a query operation group based on a dependency relationship between query operations and the number of threads allocated to perform query processing; An instruction for determining a candidate NUMA node to be executed by a thread that will process a query of the query operation group based on a distribution ratio of the query operation group input data for each NUMA node; An instruction for determining a NUMA node in which a thread to perform query processing of a query operation group is to be executed in consideration of the candidate NUMA node and the NUMA node in which the thread is located; It may include.

또한, 통신 모듈(1103)은 프로세서의 제어에 따라 연결망을 통해 데이터를 수집하여 프로세서로 전달할 수 있다. 상기 통신 모듈은 다른 네트워크 장치와 유무선 연결을 통해 제어 신호 또는 데이터 신호와 같은 신호를 송수신 하기 위해 필요한 하드웨어 및 소프트웨어를 포함하는 장치일 수 있다.In addition, the communication module 1103 may collect data through a connection network and transmit the data to the processor under the control of the processor. The communication module may be a device including hardware and software necessary for transmitting and receiving signals such as control signals or data signals through wired or wireless connection with other network devices.

본 발명의 실시예에 따른 방법의 동작은 컴퓨터로 읽을 수 있는 기록매체에 컴퓨터가 읽을 수 있는 프로그램 또는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 기록매체는 컴퓨터 시스템에 의해 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 또한 컴퓨터가 읽을 수 있는 기록매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어 분산 방식으로 컴퓨터로 읽을 수 있는 프로그램 또는 코드가 저장되고 실행될 수 있다.The operation of the method according to an embodiment of the present invention can be implemented as a computer-readable program or code on a computer-readable recording medium. The computer-readable recording medium includes all types of recording devices that store data that can be read by a computer system. In addition, the computer-readable recording medium may be distributed over a computer system connected through a network to store and execute a computer-readable program or code in a distributed manner.

또한, 컴퓨터가 읽을 수 있는 기록매체는 롬(rom), 램(ram), 플래시 메모리(flash memory) 등과 같이 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치를 포함할 수 있다. 프로그램 명령은 컴파일러(compiler)에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터(interpreter) 등을 사용해서 컴퓨터에 의해 실행될 수 있는 고급 언어 코드를 포함할 수 있다.In addition, the computer-readable recording medium may include a hardware device specially configured to store and execute program commands, such as ROM, RAM, and flash memory. The program instructions may include not only machine language codes such as those produced by a compiler, but also high-level language codes that can be executed by a computer using an interpreter or the like.

본 발명의 일부 측면들은 장치의 문맥에서 설명되었으나, 그것은 상응하는 방법에 따른 설명 또한 나타낼 수 있고, 여기서 블록 또는 장치는 방법 단계 또는 방법 단계의 특징에 상응한다. 유사하게, 방법의 문맥에서 설명된 측면들은 또한 상응하는 블록 또는 아이템 또는 상응하는 장치의 특징으로 나타낼 수 있다. 방법 단계들의 몇몇 또는 전부는 예를 들어, 마이크로프로세서, 프로그램 가능한 컴퓨터 또는 전자 회로와 같은 하드웨어 장치에 의해(또는 이용하여) 수행될 수 있다. 몇몇의 실시예에서, 가장 중요한 방법 단계들의 하나 이상은 이와 같은 장치에 의해 수행될 수 있다. While some aspects of the invention have been described in the context of an apparatus, it may also represent a description according to a corresponding method, where a block or apparatus corresponds to a method step or characteristic of a method step. Similarly, aspects described in the context of a method can also be represented by a corresponding block or item or a feature of a corresponding device. Some or all of the method steps may be performed by (or using) a hardware device such as, for example, a microprocessor, a programmable computer or electronic circuit. In some embodiments, one or more of the most important method steps may be performed by such an apparatus.

이상 본 발명의 바람직한 실시예를 참조하여 설명하였지만, 해당 기술 분야의 숙련된 당업자는 하기의 특허 청구의 범위에 기재된 본 발명의 사상 및 영역으로부터 벗어나지 않는 범위 내에서 본 발명을 다양하게 수정 및 변경시킬 수 있음을 이해할 수 있을 것이다. Although the above has been described with reference to the preferred embodiments of the present invention, those skilled in the art will be able to variously modify and change the present invention within the scope not departing from the spirit and scope of the present invention described in the following claims. You will understand that you can.

Claims (1)

불균일 메모리 접근(Non-Uniform Memory Access; NUMA) 구조의 다중 프로세서 시스템 환경에서 인-메모리 데이터에 대한 질의 처리 방법으로서,
질의 연산 간의 의존 관계 및 질의 처리 수행에 할당된 스레드 수를 기반으로 질의 연산 그룹 구성하는 단계;
질의 연산 그룹 입력 데이터의 NUMA 노드별 분포율에 기반하여 질의 연산 그룹의 질의 처리를 수행할 스레드가 실행될 적어도 하나의 후보 NUMA 노드를 결정하는 단계; 및
상기 후보 NUMA 노드 및 상기 스레드가 위치한 NUMA 노드를 고려하여 질의 연산 그룹의 질의 처리를 수행할 스레드가 실행될 NUMA 노드를 결정하는 단계를 포함하는, 질의 처리 방법.
As a query processing method for in-memory data in a non-uniform memory access (NUMA) multiprocessor system environment,
Configuring a query operation group based on a dependency relationship between query operations and the number of threads allocated for performing query processing;
Determining at least one candidate NUMA node in which a thread to perform query processing of the query operation group is to be executed based on a distribution ratio of the query operation group input data for each NUMA node; And
And determining a NUMA node in which a thread to perform query processing of a query operation group is to be executed in consideration of the candidate NUMA node and the NUMA node in which the thread is located.
KR1020190084497A 2019-07-12 2019-07-12 Apparatus and method for a query processing for in-memomry data in numa-based hardware KR20210007665A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020190084497A KR20210007665A (en) 2019-07-12 2019-07-12 Apparatus and method for a query processing for in-memomry data in numa-based hardware

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190084497A KR20210007665A (en) 2019-07-12 2019-07-12 Apparatus and method for a query processing for in-memomry data in numa-based hardware

Publications (1)

Publication Number Publication Date
KR20210007665A true KR20210007665A (en) 2021-01-20

Family

ID=74304668

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190084497A KR20210007665A (en) 2019-07-12 2019-07-12 Apparatus and method for a query processing for in-memomry data in numa-based hardware

Country Status (1)

Country Link
KR (1) KR20210007665A (en)

Similar Documents

Publication Publication Date Title
JP7083901B2 (en) Dark Roch Realization Method, Equipment, Computation Node and System
US10545789B2 (en) Task scheduling for highly concurrent analytical and transaction workloads
Viswanathan et al. {CLARINET}:{WAN-Aware} Optimization for Analytics Queries
US9152669B2 (en) System and method for distributed SQL join processing in shared-nothing relational database clusters using stationary tables
US8631000B2 (en) Scan sharing for query predicate evaluations in column-based in-memory database systems
US20200219028A1 (en) Systems, methods, and media for distributing database queries across a metered virtual network
US20230124520A1 (en) Task execution method and storage device
US10268741B2 (en) Multi-nodal compression techniques for an in-memory database
US10193973B2 (en) Optimal allocation of dynamically instantiated services among computation resources
CN109388486B (en) Data placement and migration method for heterogeneous memory and multi-type application mixed deployment scene
Jiang et al. Symbiosis: Network-aware task scheduling in data-parallel frameworks
US9110947B1 (en) Column-oriented task execution in a row-partitioned database system
CN113037800B (en) Job scheduling method and job scheduling device
US20210390405A1 (en) Microservice-based training systems in heterogeneous graphic processor unit (gpu) cluster and operating method thereof
CN110990154A (en) Big data application optimization method and device and storage medium
US6549931B1 (en) Distributing workload between resources used to access data
US20220300323A1 (en) Job Scheduling Method and Job Scheduling Apparatus
US8510529B2 (en) Method for generating program and method for operating system
CN116069393A (en) Data processing method and related device
JP2009037369A (en) Resource assignment method to database server
CN113792079B (en) Data query method and device, computer equipment and storage medium
KR20210007665A (en) Apparatus and method for a query processing for in-memomry data in numa-based hardware
CN114996299A (en) Plan execution method, device and system for distributed database
KR20230059536A (en) Method and apparatus for process scheduling
CN117234745B (en) Heterogeneous computing platform-oriented database load balancing method and device