KR101705444B1 - Method for Hash-Join Using Sorting calculation, and computer program, and storage medium operating thereof - Google Patents

Method for Hash-Join Using Sorting calculation, and computer program, and storage medium operating thereof Download PDF

Info

Publication number
KR101705444B1
KR101705444B1 KR1020150054744A KR20150054744A KR101705444B1 KR 101705444 B1 KR101705444 B1 KR 101705444B1 KR 1020150054744 A KR1020150054744 A KR 1020150054744A KR 20150054744 A KR20150054744 A KR 20150054744A KR 101705444 B1 KR101705444 B1 KR 101705444B1
Authority
KR
South Korea
Prior art keywords
data
hash
entry
join
map
Prior art date
Application number
KR1020150054744A
Other languages
Korean (ko)
Other versions
KR20160123913A (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 KR1020150054744A priority Critical patent/KR101705444B1/en
Publication of KR20160123913A publication Critical patent/KR20160123913A/en
Application granted granted Critical
Publication of KR101705444B1 publication Critical patent/KR101705444B1/en

Links

Images

Classifications

    • G06F17/30498
    • G06F17/3033
    • G06F17/30339
    • G06F17/30466
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S707/00Data processing: database and file management or data structures
    • Y10S707/99931Database or file accessing
    • Y10S707/99932Access augmentation or optimizing

Abstract

발명은 해쉬 조인(Hash Join) 기법에 관한 것이다. 구체적으로, 본 발명에서는 해쉬 조인 기법을 적용할 때, 해쉬(hash) 기법을 이용해 레코드(record)들을 분류하고, 조인 연산을 수행하기 전에 같은 디렉토리 엔트리에 있는 레코드들을 소팅한 후 조인 연산을 수행함으로써 종래 대비 연산 성능을 향상시킨 해쉬 조인 방법, 이를 실행시키는 컴퓨터 프로그램 및 기록매체에 관하여 제시하고 있다. The invention relates to a hash join technique. Specifically, in the present invention, when a hash join technique is applied, records are sorted using a hash technique, records are searched in the same directory entry before a join operation is performed, and then a join operation is performed A hash join method that improves computation performance compared to the prior art, a computer program that executes the hash join method, and a recording medium.

Description

소팅 연산을 적용한 해쉬 조인 방법, 이를 실행시키는 컴퓨터 프로그램 및 기록매체{Method for Hash-Join Using Sorting calculation, and computer program, and storage medium operating thereof}[0001] The present invention relates to a hash join method using a sorting operation, a computer program for executing the same, and a storage medium,

본 발명은 해쉬 조인(Hash Join) 기법에 관한 것이다. 구체적으로, 본 발명에서는 해쉬 조인 기법을 적용할 때, 해쉬(hash) 기법을 이용해 레코드(record)들을 분류하고, 조인 연산을 수행하기 전에 같은 디렉토리 엔트리에 있는 레코드들을 소팅한 후 조인 연산을 수행함으로써 종래 대비 연산 성능을 향상시킨 해쉬 조인 방법, 이를 실행시키는 컴퓨터 프로그램 및 기록매체에 관하여 제시한다.
The present invention relates to a hash join technique. Specifically, in the present invention, when a hash join technique is applied, records are sorted using a hash technique, records are searched in the same directory entry before a join operation is performed, and then a join operation is performed A hash join method, a computer program for executing the hash join method, and a recording medium.

조인(Join)이란 두 개 이상의 테이블을 하나의 집합으로 만드는 연산을 의미한다. 일 예로, SQL문에서 FROM 절에 두 개 이상의 테이블이 나열될 경우 조인이 수행될 수 있다. 이와 같은 조인 연산은 두 개 이상의 테이블 중 선별된 두 개 테이블 사이에서 수행되게 된다.A join is an operation that makes two or more tables into a set. For example, if two or more tables are listed in the FROM clause in an SQL statement, the join can be performed. Such a join operation is performed between two selected tables of two or more tables.

이중, 해쉬 조인(Hash Join) 알고리즘은 대용량의 두 테이블을 조인(join)하기 위해 사용된다. 특히, 해쉬 조인 알고리즘은 테이블의 크기가 방대해서 메모리에 모두 넣을 수 없기 때문에, 데이터의 일부를 메모리로 가져와서 처리하고, 다시 저장장치에 저장함으로써 조인 연산을 수행할 수 있다는 장점이 있다.Of these, a hash join algorithm is used to join two large tables. In particular, the hash join algorithm is advantageous in that a join operation can be performed by storing a part of data in a memory, storing the data in a storage device, and storing the data in a memory because the table size is large.

종래의 해쉬조인 기법에 대하여 간단히 설명하면 다음과 같다.A conventional hash join technique will be briefly described as follows.

메인 메모리 사이즈를 32KB로 가정할 때 메모리 공간은 크게 R 테이블 영역(8KB), S 테이블 영역 (8KB), Input Buffer (4KB), Output Buffer (4KB), 기타 영역 (8KB)으로 나뉜다. 편의상, R 테이블 영역, S 테이블 영역, Input Buffer, Output Buffer, 기타 메모리 영역을 MR, MS, MI, MO, MH라고 표시한다. MH는 다양한 용도로 활용될 수 있으며, 일 예로 Grace Hash Join과 Hybrid Hash Join에서는 해쉬 테이블을 저장하기 위한 공간으로 사용된다.Assuming the main memory size is 32KB, the memory space is divided into R table area (8KB), S table area (8KB), Input buffer (4KB), Output buffer (4KB) and other areas (8KB). For convenience, R table area, S table area, input buffer, output buffer, and other memory areas are denoted by M R , M S , M I , M O , and M H. M H can be used for various purposes. For example, Grace Hash Join and Hybrid Hash Join are used as a space for storing a hash table.

R 테이블은 <Employee_ID, Department_ID>와 S 테이블은 <Department_ID, Department_Name>의 스키마를 가진다. R 테이블에서 Employee_ID는 프라이머리키(primary key)이고, Department_ID는 포린키(foreign key)이다. 또한 S 테이블에서 Department_ID는 S 테이블의 프라이머리 키이고 Department_Name은 value라고 할 수 있다.The R table has a schema of <Employee_ID, Department_ID> and the S table has a schema of <Department_ID, Department_Name>. In the R table, Employee_ID is the primary key and Department_ID is the foreign key. In the S table, Department_ID is the primary key of the S table, and Department_Name is value.

따라서 조인 연산은 Select R.Employee_ID, S.Department_ID, S.Department_Name from R, S where R.Department_ID = S.Department_ ID의 쿼리로 수행된다. Therefore, the join operation is performed by a query of Select R.Employee_ID, S.Department_ID, S.Department_Name from R, and S where R.Department_ID = S.Department_ID.

조인 연산이 수행되고 나면, 조인 결과는 메인 메모리의 output buffer 영역에 임시 저장되고, 버퍼가 풀(full)이 되면, 하드디스크로 플러시(flush)된다. 조인 결과의 각 레코드는 <Employee_ID, Department_ID, Department_Name>으로 구성되게 된다.After the join operation is performed, the result of the join is temporarily stored in the output buffer area of the main memory, and when the buffer becomes full, it is flushed to the hard disk. Each record in the join result will consist of <Employee_ID, Department_ID, Department_Name>.

다만, 종래의 해쉬 조인 기법들에서는 조인 연산을 위해 각각의 디렉토리 엔트리 내 레코드들을 모두 비교해보아야 하는 문제점이 있어, 많은 연산 시간을 필요로 하는 문제점이 있었다.
However, in the conventional hash join techniques, there is a problem that all the records in each directory entry must be compared in order to perform a join operation, which requires a long computation time.

미국등록특허 제 7,319,995호U.S. Patent No. 7,319,995

본 발명은 상기와 같은 문제점을 해결하기 위해 안출된 것으로, 해쉬 맵 생성 후 해쉬 맵 스캔(탐색)시 보다 효율적인 해쉬 조인 연산을 수행할 수 있도록 하는 해쉬 조인 방법, 이를 실행시키는 컴퓨터 프로그램 및 기록매체를 제공하고자 한다.
It is an object of the present invention to provide a hash join method capable of performing a more efficient hash join operation in a hash map scan (search) after generating a hash map, a computer program for executing the hash join, .

본 발명의 일 측면에 따른 소팅 연산을 이용한 해쉬 조인 방법은, (A) 제1 데이터 테이블 및 제2 데이터 테이블을 준비하는 단계; (B) 상기 제1 데이터 테이블의 제1 데이터들에 대해 제1 해쉬 함수를 적용하여 상기 제1 데이터 테이블의 제1 데이터들을 엔트리별로 분류하며, 각 엔트리별 분류된 제1 데이터들의 조인 키(Join Key) 값에 따라 상기 제1 데이터들이 오름차순 또는 내림차순으로 소팅된 해쉬 맵을 생성하는 단계; (C) 상기 제2 데이터 테이블의 제2 데이터들에 제1 해쉬 함수를 적용하여 대응되는 엔트리를 결정하는 단계; 및 (D) 각 제2 데이터별로 결정된 엔트리 내에 각 제2 데이터와 동일한 조인 키(Join Key)를 갖는 제1 데이터를 탐색하여 조인 연산을 수행하는 단계; 를 포함한다.A hash join method using a sorting operation according to an aspect of the present invention includes: (A) preparing a first data table and a second data table; (B) classifying the first data of the first data table into entries by applying a first hash function to the first data of the first data table, and generating a join key of the first data classified by each entry Generating a hash map in which the first data is sorted in ascending or descending order according to a value of a key; (C) applying a first hash function to second data of the second data table to determine a corresponding entry; And (D) searching for first data having the same join key as each second data in an entry determined for each second data to perform a join operation; .

일 실시예에서, 상기 (B) 단계는, (B-1) 상기 제1 데이터 테이블의 어느 하나의 제1 데이터를 스캔하고 상기 제1 데이터에 대해 제1 해쉬 함수를 적용하여 상기 제1 데이터를 상기 해쉬 맵의 엔트리별로 분류하는 단계; 및 (B-2) 상기 어느 하나의 제1 데이터가 엔트리별로 분류될 때마다, 상기 제1 데이터의 조인 키 값과 미리 대응되는 엔트리로 분류된 제1 데이터들의 조인 키 값을 비교하여 오름차순 또는 내림차순으로 소팅하여 해쉬 맵을 생성하는 단계; 를 포함하고, 상기 (B-1) 및 (B-2) 단계는, 상기 제1 데이터 테이블의 모든 제1 데이터들에 대한 제1 해쉬 함수 적용 및 엔트리별 분류가 완료될 때까지 수행할 수 있다.In one embodiment, the step (B) includes the steps of: (B-1) scanning one of the first data of the first data table and applying a first hash function to the first data, Classifying the hash map by entry of the hash map; And (B-2) comparing the join key values of the first data with the join key values of the first data classified into entries corresponding to the first data, in ascending or descending order, To generate a hash map; (B-1) and (B-2) may be performed until the application of the first hash function to all the first data of the first data table and the classification of each entry are completed .

다른 실시예에서, 상기 (B) 단계는, (B-1) 상기 제1 데이터 테이블의 제1 데이터들을 순서대로 스캔하며 각 제1 데이터에 대해 제1 해쉬 함수를 적용하여 상기 제1 데이터를 상기 해쉬 맵의 엔트리별로 분류하는 단계; 및 (B-2) 상기 제1 데이터 테이블의 모든 제1 데이터들에 대한 제1 해쉬 함수 적용 및 엔트리별 분류가 완료되면, 각 엔트리별로 제1 데이터들의 조인 키 값을 서로 비교하며 오름차순 또는 내림차순으로 소팅된 해쉬 맵을 생성하는 단계;를 포함할 수 있다.In another embodiment, the step (B) comprises: (B-1) sequentially scanning the first data of the first data table and applying the first hash function to each first data, Classifying the hash map by entry of the hash map; And (B-2) when application of the first hash function and classification of each first data of the first data table are completed, the join key values of the first data for each entry are compared with each other, And generating a sorted hash map.

바람 직한 실시예에서, 상기 (B) 단계는, 상기 해쉬 맵의 엔트리 중 분류된 제1 데이터의 수가 문턱값 이상인 엔트리에 대해서만 제1 데이터의 조인 키 값에 따라 오름차순 또는 내림차순으로 소팅된 해쉬 맵을 생성할 수 있다.
In a preferred embodiment, the step (B) may further comprise the step of calculating a hash map sorted in ascending or descending order according to the join key value of the first data only for the entry having the number of first data sorted out of the hash map entries equal to or greater than the threshold value Can be generated.

본 발명의 다른 측면에 따른 소팅 연산을 이용한 해쉬 조인 방법은, (A) 제1 데이터 테이블에 포함된 하나 이상의 제1 데이터에 대해 제1 해쉬 함수를 적용하여 하나 이상의 버킷들로 분류하는 단계; (B) 제2 데이터 테이블에 포함된 하나 이상의 제2 데이터에 대해 제1 해쉬 함수를 적용하여 하나 이상의 버킷들로 분류하는 단계; (C) 어느 일 버킷에 포함된 하나 이상의 제1 데이터에 대해 제2 해쉬 함수를 적용하여 엔트리별로 분류하며, 각 엔트리별 제1 데이터들의 레코드 값들이 오름차순 또는 내림차순으로 소팅된 해쉬 맵을 생성하는 단계; (D) 상기 일 버킷에 포함된 하나 이상의 제2 데이터에 대해 제2 해쉬 함수를 적용하여 대응되는 엔트리를 결정하는 단계; 및 (E) 각 제2 데이터별로 결정된 엔트리 내에 각 제2 데이터와 동일한 조인 키(Join Key)를 갖는 제1 데이터를 탐색하여 조인 연산을 수행하는 단계;를 포함한다.According to another aspect of the present invention, there is provided a hash join method using a sorting operation, comprising: (A) classifying at least one first data included in a first data table into one or more buckets by applying a first hash function; (B) applying a first hash function to one or more second data included in a second data table and classifying the one or more second data into one or more buckets; (C) applying a second hash function to one or more first data included in a certain bucket to classify the data according to each entry, and generating a hash map in which record values of first data for each entry are sorted in ascending or descending order ; (D) applying a second hash function to one or more second data included in the one bucket to determine a corresponding entry; And (E) searching for first data having the same join key as each second data in an entry determined for each second data, and performing a joining operation.

일 실시예에서, 상기 (C) 단계는, (C-1) 상기 일 버킷에 포함된 어느 하나의 제1 데이터를 스캔하고 상기 제1 데이터에 대해 제2 해쉬 함수를 적용하여 상기 제1 데이터를 상기 해쉬 맵의 엔트리별로 분류하는 단계; 및 (C-2) 상기 어느 하나의 제1 데이터가 엔트리별로 분류될 때마다, 상기 제1 데이터의 조인 키 값과 미리 대응되는 엔트리로 분류된 제1 데이터들의 조인 키 값을 비교하여 오름차순 또는 내림차순으로 소팅하여 해쉬 맵을 생성하는 단계; 를 포함하고, 상기 (C-1) 및 (C-2) 단계는, 상기 제1 데이터 테이블의 모든 제1 데이터들에 대한 제2 해쉬 함수 적용 및 엔트리별 분류가 완료될 때까지 수행할 수 있다.In one embodiment, the step (C) includes: (C-1) scanning one of the first data included in the one bucket and applying a second hash function to the first data, Classifying the hash map by entry of the hash map; And (C-2) comparing the join key values of the first data with the join key values of the first data classified into entries corresponding to the first data in ascending or descending order To generate a hash map; (C-1) and (C-2) may be performed until the application of the second hash function to all the first data of the first data table and the classification of each entry are completed .

다른 실시예에서, 상기 (C) 단계는, (C-1) 상기 일 버킷에 포함된 제1 데이터들을 순서대로 스캔하며 각 제1 데이터에 대해 제2 해쉬 함수를 적용하여 상기 제1 데이터를 상기 해쉬 맵의 엔트리별로 분류하는 단계; 및 (C-2) 상기 일 버킷에 포함된 모든 제1 데이터들에 대한 제2 해쉬 함수 적용 및 엔트리별 분류가 완료되면, 각 엔트리별로 제1 데이터들의 조인 키 값을 서로 비교하며 오름차순 또는 내림차순으로 소팅된 해쉬 맵을 생성하는 단계;를 포함할 수 있다.In another embodiment, the step (C) includes: (C-1) sequentially scanning the first data included in the one bucket, applying a second hash function to each first data, Classifying the hash map by entry of the hash map; And (C-2) when application of the second hash function to all the first data included in the one bucket and classification according to the entry are completed, the join key values of the first data are compared with each other for each entry, and in ascending or descending order And generating a sorted hash map.

바람직한 실시예에서, 상기 (C) 단계는, 상기 해쉬 맵의 엔트리 중 분류된 제1 데이터의 수가 문턱값 이상인 엔트리에 대해서만 제1 데이터의 조인 키 값에 따라 오름차순 또는 내림차순으로 소팅된 해쉬 맵을 생성할 수 있다.
In a preferred embodiment, the step (C) comprises: generating a hash map sorted in ascending or descending order according to the join key value of the first data only for the entry having the number of first data sorted out of the hash map entries equal to or greater than the threshold value can do.

본 발명의 또 다른 측면에 따른 컴퓨터 프로그램 및 컴퓨터로 읽을 수 있는 기록매체는, 상기 전술한 소팅 연산을 이용한 해쉬 조인 방법을 구현한 컴퓨터 프로그램 및 이를 실행가능하도록 기록된 기록매체로 구성될 수 있다.
According to another aspect of the present invention, a computer program and a computer-readable recording medium may be constituted by a computer program implementing the hash join method using the above-described sorting operation, and a recording medium recorded so as to execute the hash join method.

본 발명의 바람직한 실시예에 따른 소팅 연산을 이용한 해쉬 조인 방법, 이를 실행시키는 컴퓨터 프로그램 및 기록 매체는, 해쉬 맵 생성시 엔트리별로 분류되는 레코드(데이터)들을 일정 규칙에 따라 정렬(소팅)시킴으로써, 조인 연산을 위한 해쉬 맵 스캔(탐색)이 효율적으로 수행될 수 있도록 하는 효과가 있다.A hash join method using a sorting operation according to a preferred embodiment of the present invention, a computer program for executing the same, and a recording medium are configured to sort (sort) records (data) There is an effect that a hash map scan (search) for an operation can be efficiently performed.

결과적으로, 종래 대비 해쉬 조인의 연산량을 감소시켜 해쉬 조인에 소요되는 시간을 단축시킬 수 있다는 효과가 있다.
As a result, there is an effect that the amount of computation of hash joins compared with the conventional technique can be reduced and the time required for hash joining can be shortened.

도 1은 본 발명의 일 예에 따른 소팅 연산을 이용한 해쉬 조인 방법을 나타낸 순서도,
도 2는 본 발명의 일 예에 따른 해쉬 조인(Hash Join)의 동작을 설명하기 위한 도면,
도 3은 도 2의 해쉬 맵 생성 동작을 상세히 설명하기 위한 도면,
도 4는 본 발명의 다른 일 예에 따른 소팅 연산을 이용한 해쉬 조인 방법을 나타낸 순서도, 및
도 5는 도 4에 따른 해쉬 조인 방법의 동작을 설명하기 위한 도면이다.
1 is a flowchart illustrating a hash join method using a sorting operation according to an exemplary embodiment of the present invention;
FIG. 2 is a diagram for explaining an operation of a hash join according to an exemplary embodiment of the present invention; FIG.
3 is a diagram for explaining the hash map generating operation of FIG. 2 in detail;
FIG. 4 is a flowchart illustrating a hash join method using a sorting operation according to another example of the present invention, and FIG.
FIG. 5 is a diagram for explaining the operation of the hash join method according to FIG.

본 발명은 다양한 변환을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명의 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변환, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 본 발명을 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 발명의 요지를 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다.BRIEF DESCRIPTION OF THE DRAWINGS The present invention is capable of various modifications and various embodiments, and specific embodiments are illustrated in the drawings and described in detail in the detailed description. It should be understood, however, that it is not intended to be limited to the specific embodiments of the invention but includes all modifications, equivalents, and alternatives falling within the spirit and scope of the invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, the present invention will be described in detail with reference to the accompanying drawings.

제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다.The terms first, second, etc. may be used to describe various components, but the components should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from another.

본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used in this application is used only to describe a specific embodiment and is not intended to limit the invention. The singular expressions include plural expressions unless the context clearly dictates otherwise. In the present application, the terms "comprises" or "having" and the like are used to specify that there is a feature, a number, a step, an operation, an element, a component or a combination thereof described in the specification, But do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or combinations thereof.

이하, 본 발명의 실시예를 첨부한 도면들을 참조하여 상세히 설명하기로 한다.
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명의 일 예에 따른 소팅 연산을 이용한 해쉬 조인 방법을 나타낸 순서도이고, 도 2는 본 발명의 일 예에 따른 해쉬 조인(Hash Join)의 동작을 설명하기 위한 도면이며, 도 3은 도 2의 해쉬 맵 생성 동작을 상세히 설명하기 위한 도면이다.
FIG. 1 is a flowchart illustrating a hash join method using a sorting operation according to an exemplary embodiment of the present invention. FIG. 2 is a view for explaining an operation of a hash join according to an exemplary embodiment of the present invention. 2 is a diagram for explaining the hash map generating operation of FIG. 2 in detail.

도 2에 도시된 바와 같이, 본 발명에 따른 소팅 연산을 이용한 해쉬 조인 방법을 수행하기 위해서는 제1 데이터들이 포함된 제1 데이터 테이블 및 제2 데이터들이 포함된 제2 데이터 테이블이 준비되어야 한다(S110). 이때, 도 2에서는 제1 데이터 테이블에 포함된 제1 데이터(레코드로 명명할 수 있음, 이하 데이터로 통칭함)는 <DATA_ID, Join Key_ID>의 스키마를 가지며, 제2 데이터 테이블에 포함된 제2 데이터는 <Join Key_ID, Record_ID>의 스키마를 갖는다고 가정한다.2, in order to perform the hash join method using the sorting operation according to the present invention, a first data table including first data and a second data table including second data are prepared (S110 ). In this case, in FIG. 2, the first data included in the first data table (which can be called a record, hereinafter collectively referred to as data) has a schema of <DATA_ID, Join Key_ID> It is assumed that the data has a schema of < Join Key_ID, Record_ID >.

상기와 같은 스키마는 설명의 편의를 위해 선택한 기술 구성에 해당되며, 이는 각각 앞서 '발명의 배경이 되는 기술'에서 설명한 <Employee_ID, Department_ID> 및 <Department_ID, Department_Name>의 스키마에 대응되는 기술 구성임을 당업자라면 용이하게 이해할 수 있다.
The above schema corresponds to a selected technology structure for the sake of convenience of description, and it is assumed that each of the schemes corresponds to the schema of the <Employee_ID, Department_ID>, <Department_ID, Department_Name> described in the 'Description of the Background of the Invention' It can be easily understood.

이와 같이 준비된 제1 데이터 테이블 및 제2 데이터 테이블 간 적용되는 해쉬 조인(hash join) 연산의 동작은 크게 3단계로 구분되며, 상기 3단계는 구체적으로 해쉬 맵 생성, 해쉬 맵 스캔, 조인 연산으로 구분된다.
The operation of the hash join operation applied between the first data table and the second data table thus prepared is roughly classified into three stages, and the third stage is specifically divided into a hash map generation, a hash map scan, and a join operation do.

이와 같은 제1 데이터 테이블에 대해 화살표 방향으로 순서대로 제1 해쉬 함수(h1(x))를 적용하여 해쉬 맵(Hash map)을 형성하며, 이때 각 엔트리에 링크드 리스트 형태로 연결되어 저장되는 제1 데이터들은 조인 키 값에 따라 오름차순 또는 내림차순으로 소팅된 해쉬 맵(Hash map)을 생성한다(S120). 이때, 상기 제1 데이터 테이블에 포함된 제1 데이터들은 조인 키(Join Key) 또는 부서 키(Department_ID)에 대해 제1 해쉬 함수(h1(x))를 적용한 결과에 따라 결정되는 엔트리로 구분되며, 도 2에 도시된 바와 같이 상기 제1 데이터들은 각 엔트리에 링크드 리스트 형태로 연결되어 저장된다.A hash map is formed by sequentially applying the first hash function h 1 (x) to the first data table in the arrow direction. At this time, 1 data generates a hash map sorted in ascending or descending order according to the join key value (S120). At this time, the first data included in the first data table is divided into entries determined according to a result of applying a first hash function h 1 (x) to a join key or a department key (Department_ID) As shown in FIG. 2, the first data is stored in a linked list form in each entry.

이때, 각 제1 데이터들이 저장될 버킷(bucket) 및 상기 버킷이 연결되는 디렉토리 엔트리(entry)는 아래의 수학식 1과 같은 제1 해쉬 함수에 의해 결정될 수 있다.At this time, a bucket where each first data is stored and a directory entry to which the bucket is connected can be determined by a first hash function as shown in Equation (1) below.

Figure 112015037831260-pat00001
Figure 112015037831260-pat00001

(이때, 알파벳의 I번째 문자는 정수 I를 나타내는 것으로 가정, s는 길이가 n인 문자열을 나타내고, s[i]는 문자열의 I번째 byte를 표시한다고 가정)
(Assuming that the I-th character of the alphabet represents the integer I, s represents the string of length n, and s [i] represents the I-th byte of the string)

도 2에서는 상기와 같은 제1 해쉬 함수에 의해 제1 데이터 테이블에 포함된 제1 데이터들이 A, B, Z 디렉토리 엔트리 중 어느 하나에 연결된 버킷 내 링크드 리스트(linked list)로 연결된 것을 도시하고 있다.In FIG. 2, the first data included in the first data table is connected to a linked list in a bucket connected to one of the A, B and Z directory entries by the first hash function.

이때, 도 2에 도시된 바와 같이, 상기 해쉬 맵은 엔트리별로 구분된 제1 데이터들을 포함하고, 각 엔트리별로 상기 제1 데이터들은 조인 키 값에 따라 오름차순 또는 내림차순으로 소팅되어 해쉬 맵을 형성한다.As shown in FIG. 2, the hash map includes first data classified by entries, and the first data is sorted in ascending or descending order according to a join key value for each entry to form a hash map.

다시 말해, 본 발명에 따른 해쉬 조인 방법은, 종래 기술에 추가적으로 엔트리별 데이터들을 소팅하여 해쉬 맵을 생성하는 것을 특징으로 한다. 이에 따라 제1 해쉬 함수에 따라 분류되는 순서대로 각 엔트리에 연결되어 형성되는(바람직하게는, 링크드 리스트 형태로 연결되는) 해쉬 맵이 아니라, 각 엔트리별로 분류된 데이터들이 다시 일정 규칙에 따라 소팅되어 엔트리에 연결되어 형성되는 해쉬 맵이 생성되게 된다.
In other words, the hash join method according to the present invention is characterized in that a hash map is generated by sorting the entry-specific data in addition to the prior art. Accordingly, not the hash map formed in connection with each entry in the order classified according to the first hash function (preferably linked in the linked list form), but the data classified by each entry are sorted again according to a certain rule A hash map formed by connecting to the entry is generated.

예를 들어, 종래 기술의 경우에는 제1 데이터 테이블 내 포함된 데이터에 대해 화살표 방향으로 순서대로 제1 해쉬 함수를 적용하여 대응되는 엔트리에 해당 데이터를 연결하여(바람직하게는, 링크드 리스트 형태로 연결하여) 해쉬 맵을 생성한다.For example, in the case of the related art, a first hash function is sequentially applied to the data included in the first data table in the direction of the arrow, and the corresponding data is connected to the corresponding entry (preferably, To generate a hash map.

본 발명에서는, 상기와 같은 기술 구성에 대해, 추가적으로 각 엔트리별로 연결된 데이터들을 일정 규칙에 따라 정렬하여 해쉬맵을 생성하는 것을 기술적 특징으로 한다. According to the present invention, a hash map is generated by arranging data linked to each entry in accordance with a predetermined rule, in addition to the above-described technical arrangement.

이에 따라, 본 발명에서는 <Data 1, Join Key 1> 가 먼저 디렉토리 엔트리 A로 분류되고 뒤이어 <Data 4, Join Key 4> 가 디렉토리 엔트리 A로 분류된다 하여도, Join Key 4 값이 Join Key 1 값보다 작다면 <Data 4, Join Key 4> 가 <Data 1, Join Key 1> 보다 앞서 위치하도록 정렬(소팅)될 수 있다. Accordingly, even though <Data 1, Join Key 1> is first classified as a directory entry A and then <Data 4, Join Key 4> is classified as a directory entry A, , <Data 4, Join Key 4> may be sorted (sorted) so as to be positioned before <Data 1, Join Key 1>.

상기 소팅(정렬) 방법에 대해서는 도 3을 통해 상세히 설명한다.
The sorting method will be described in detail with reference to FIG.

도 3의 (a)에 도시된 바와 같이, 디렉토리 엔트리 A에 <Data 11, 10>, <Data 12, 12>, <Data 13, 14>가 순서대로 연결되어 있다고 가정한다. 이때, <Data 11, 10> 등은 <Data_ID, Join Key_ID> 를 숫자를 활용하여 간단하게 표시한 것으로, <*,#>의 '#' 값은 각 데이터들의 조인 키 값을 비교하기 용이하게 숫자로 표시한 것임을 당업자라면 용이하게 이해할 수 있을 것이다.It is assumed that <Data 11, 10>, <Data 12, 12>, and <Data 13, 14> are sequentially connected to the directory entry A, as shown in FIG. In this case, < Data 11, 10 >, etc. are simply displayed by using numeric values of < Data_ID and Join Key_ID & It will be easily understood by those skilled in the art.

이어 도 3의 (b)에 도시된 바와 같이, 추가적으로 디렉토리 엔트리 A로 <Data 14, 13> 가 분류되면, 상기 <Data 14, 13>은 상기 디렉토리 엔트리 A에 마지막으로 연결되어 있는 <Data 13, 14>에 연결되게 된다.As shown in FIG. 3 (b), if <Data 14, 13> is further classified into the directory entry A, the <Data 14, 13> 14>.

이때, <Data 14, 13> 의 조인 키 값과 상기 디렉토리 엔트리 A에 연결된 데이터들의 조인 키 값들을 비교하면, <Data 14, 13> 는 <Data 13, 14> 보다 앞에, <Data 12, 12> 보다는 뒤에 정렬(소팅)되는 것이 필요하다고 판단할 수 있다.If the join key values of the data 14 and 13 are compared with the join key values of the data connected to the directory entry A, then <Data 14, 13> is placed before <Data 13, 14> It can be judged that it is necessary to rearrange (rearrange) rather than rearrange (sort).

이에, 도 3의 (c)에 도시된 바와 같이, 정렬(소팅) 연산을 적용하여 상기 <Data 14, 13> 가 <Data 13, 14> 의 앞에, <Data 12, 12> 의 뒤에 연결되도록 디렉토리 엔트리 A에 연결된 데이터들을 정렬(소팅) 할 수 있다.3 (c), a sort (sort) operation is applied so that the < Data 14, 13 >, and the < Data 12,12 > You can sort (sort) the data associated with entry A.

이때, 상기 정렬(소팅) 연산 방법으로는 다양한 연산이 적용될 수 있으며, 퀵 소트(quick sort) 등의 소팅 연산을 적용하여 링크드 리스트들이 연결되어 있는 순서를 재정렬할 수 있다. 이외 본 발명에 따른 정렬(소팅) 방법에는 다른 공지의 소팅 방법이 적용될 수도 있다.
At this time, various operations may be applied to the sorting operation method, and the order in which the linked lists are connected may be rearranged by applying a sorting operation such as a quick sort. Other known sorting methods may be applied to the sorting method according to the present invention.

이와 같은 소팅 방법은 도 3에 도시된 바와 같이 제1 데이터 테이블의 어느 일 데이터가 제1 해쉬 함수에 따라 특정 엔트리별로 분류될 때마다 상기 엔트리 내 데이터들을 정렬(소팅)하는 방법이 적용될 수 있으며, 상기와 같은 소팅(정렬) 방법은 상기 제1 데이터 테이블의 모든 제1 데이터들에 대한 제1 해쉬 함수 적용 및 엔트리별 분류가 완료될 때까지 수행될 수 있다.
As shown in FIG. 3, the sorting method may be a method of sorting (sorting) the data in the entry whenever data of the first data table is classified according to a specific entry according to the first hash function. The sorting method may be performed until the application of the first hash function to all the first data of the first data table and the classification of each entry are completed.

다른 실시예에서, 상기 정렬(소팅) 연산은 제1 데이터 테이블의 모든 데이터들이 각각 제1 해쉬 함수에 따라 엔트리별로 분류된 후, 각 엔트리별로 수행될 수 있다. 즉, 해쉬 맵을 생성함에 있어 엔트리별 분류 및 분류된 엔트리별 데이터의 정렬(소팅) 연산을 서로 구분하여 엔트리별 분류가 완료된 후 각각 분류된 엔트리별 데이터의 정렬(소팅) 연산을 수행할 수 있다.
In another embodiment, the sorting operation may be performed for each entry after all the data in the first data table are sorted by entry according to a first hash function. That is, in generating a hash map, sorting (sorting) operations of classified and entry-classified data for each entry may be distinguished from each other, and sorting (sorting) of data classified for each entry may be performed after classification for each entry is completed .

본 발명에 적용가능한 바람직한 실시예에서, 상기 정렬(소팅) 연산은 각 엔트별 분류된 데이터의 수가 문턱값(기준 값)이상인 엔트리에 대해서만 수행될 수 있다. In a preferred embodiment applicable to the present invention, the sorting (sorting) operation can be performed only on entries whose number of classified data per entry is equal to or greater than a threshold (reference value).

일 예로, 문턱값이 5로 설정되었다 가정하면, 특정 엔트리 내 분류된 데이터가 5개 이상인 엔트리에 대해서만 상기 정렬(소팅) 연산을 수행할 수 있다. 이때, 각 데이터 별로 제1 해쉬 함수를 적용하여 엔트리 별로 분류함과 동시에 상기 엔트리 내 데이터들을 일정 규칙에 따라 정렬(소팅)하는 경우에는, 엔트리 별 분류에 따라 특정 엔트리 내 포함된 데이터의 수가 5개 이상이 되면 상기 엔트리 내 데이터들을 정렬(소팅)하며 상기 엔트리에 데이터가 추가될 때마다 정렬(소팅) 연산을 수행할 수 있다.For example, assuming that the threshold value is set to 5, the sorting operation can be performed only on entries having five or more classified data items in a specific entry. In this case, if the first hash function is applied to each data and classified according to the entry and the data in the entry is sorted (sorted) according to a predetermined rule, the number of data included in the specific entry is 5 (Sorting) the data in the entry and performing sorting (sorting) operation whenever data is added to the entry.

또는, 제1 해쉬 함수에 따라 데이터의 엔트리 별 분류가 완료된 후 각 엔트리별로 정렬(소팅) 연산을 수행하는 경우에는, 엔트리 별 분류가 완료되면 각 엔트리별 데이터의 수가 5 이상인지를 판단하고, 데이터의 수가 5 이상인 엔트리에 대해서만 데이터들의 정렬(소팅) 연산을 수행할 수 있다.
Alternatively, when the sorting operation is performed for each entry after the classification of the data according to the first hash function is completed, it is determined whether the number of data for each entry is 5 or more when the sorting for each entry is completed, (Sorting) operation of data only for entries whose number is 5 or more.

상기와 같은 방법에 의해 생성된 해쉬 맵을 이용하여 제2 데이터 테이블의 제2 데이터들과 조인 연산을 수행할 제1 데이터를 선별하기 위해 해쉬 맵을 스캔(탐색)한다(S130). 이를 위해, 상기 제2 데이터 테이블의 제2 데이터들에 대해 화살표 방향으로 순서대로 제1 해쉬 함수를 적용하여 대응되는 엔트리를 결정하고, 해당 엔트리 내 동일한 조인 키를 갖는 데이터가 있는지를 탐색한다.In operation S130, the hash map is scanned to select the first data to perform the join operation with the second data of the second data table using the hash map generated by the above method. To this end, a first hash function is sequentially applied to the second data of the second data table in the direction of the arrow to determine a corresponding entry, and whether or not there is data having the same join key in the entry is searched.

본 발명에 따른 소팅 연산을 인용한 해쉬 조인 방법은, 디렉토리 엔트리 별로 정렬(소팅)된 해쉬 맵에 대한 해쉬 맵 스캔(탐색)을 수행함으로써 종래와 같이 디렉토리 엔트리에 있는 첫 데이터부터 마지막 데이터까지 모두 비교할 필요 없이, 해당 엔트리에 연결된 제1 데이터들의 조인 키 값을 순서대로 스캔(탐색)하다 해당 제2 데이터의 조인 키 값보다 큰 조인 키 값이 스캔(탐색)되면(오름차순으로 해쉬 맵의 데이터들을 정렬(소팅)하는 경우) 더 이상의 스캔(탐색) 동작을 정지할 수 있다.
The hash join method citing the sorting operation according to the present invention performs a hash map scan (search) on a hash map sorted (sorted) for each directory entry to compare all data from the first data in the directory entry to the last data If the join key value larger than the join key value of the second data is scanned (the data of the hash map is sorted in ascending order) (Sorting)), the further scanning (searching) operation can be stopped.

이와 같은 해쉬 맵 스캔(탐색) 동작을 통해 조인 키 값이 동일한 제1 데이터를 발견하면, 해당되는 제1 데이터와 제2 데이터의 조인 연산을 수행한다(S140). 도 2에 도시된 바와 같이, 제2 데이터 테이블에 포함된 <Join Key 4, Record 1>에 대해 제1 해쉬 함수를 적용하여 대응되는 엔트리(도 2의 경우, 디렉토리 엔트리 A) 내 데이터들을 탐색하고, 발견된 <Data 4, Join Key 4>와 상기 <Join Key 4, Record 1> 간 조인 연산을 수행한다.If the first data having the same join key value is found through the hash map scan operation, the join operation of the first data and the second data is performed at step S140. As shown in FIG. 2, the first hash function is applied to < Join Key 4, Record 1 > included in the second data table to search for data in the corresponding entry (directory entry A in the case of FIG. 2) , And performs a join operation between the found <Data 4, Join Key 4> and the above <Join Key 4, Record 1>.

이에 따라, 도 2에 도시된 <Data 4, Join Key 4, Record 1> 을 조인 연산의 결과 값으로 출력하게 되고, 상기 값은 실시예에 따라 별도의 저장 장치에 저장될 수 있다.
Accordingly, < Data 4, Join Key 4, Record 1 > shown in FIG. 2 is output as a result of the join operation, and the value can be stored in a separate storage device according to the embodiment.

이와 같이, 본 발명에 따른 소팅 연산을 이용한 해쉬 조인 방법은, 조인 연산을 수행하기 위해 해쉬 맵을 스캔(탐색)하는 경우, 특정 엔트리 내 모든 데이터들을 스캔(탐색)할 필요 없이 일부 데이터에 대해서만 스캔(탐색)을 수행하게 되어 종래 대비 조인 연산의 성능을 향상시킬 수 있다.As described above, in the hash join method using the sorting operation according to the present invention, when a hash map is scanned (scanned) to perform a join operation, all data in a specific entry need not be scanned (Search), thereby improving the performance of the join operation compared to the conventional method.

게다가, 바람직한 실시예에 있어, 디렉토리 엔트리 내 데이터의 수가 일정 이상인 엔트리에 대해서만 데이터의 정렬(소팅)을 수행함으로써 불필요한 정렬(소팅) 연산을 방지하고, 데이터가 일정 이상인 엔트리에 대해서는 데이터를 정렬(소팅)하여 효율적인 해쉬 맵 스캔(탐색) 및 조인 연산을 수행할 수 있도록 한다.
In addition, in the preferred embodiment, unnecessary sorting operations are prevented by performing data sorting only on entries whose number of data in the directory entry is equal to or greater than a predetermined value, and data is sorted ) So that efficient hash map scan (search) and join operations can be performed.

상기와 같은 해쉬 조인 방법은 하기와 같이 여러 차례 해쉬 함수를 적용하는 Grace Hash Join 또는 Hybrid Hash Join 에도 적용될 수 있다. 이하, 도 4 및 도 5를 참조하여 상세히 설명한다.
The hash join method may be applied to Grace Hash Join or Hybrid Hash Join which applies a hash function several times as follows. Hereinafter, this will be described in detail with reference to Figs. 4 and 5. Fig.

도 4는 본 발명의 다른 일 예에 따른 소팅 연산을 이용한 해쉬 조인 방법을 나타낸 순서도이고, 도 5는 도 4에 따른 해쉬 조인 방법의 동작을 설명하기 위한 도면이다.
FIG. 4 is a flowchart illustrating a hash join method using a sorting operation according to another example of the present invention, and FIG. 5 is a view for explaining the operation of the hash join method according to FIG.

도 4 및 도 5 에서는 두 번 해쉬 함수를 적용하여 해쉬 조인을 수행하는 모든 실시예의 일반적인 경우를 도시하였으며, 당업자라면 도 4 및 도 5에 도시된 기술 구성은 두 번 이상 해쉬 함수를 적용하여 해쉬 맵을 생성하고, 이에 기반하여 해쉬 조인을 수행하는 모든 실시예를 포함함을 용이하게 확인할 수 있을 것이다.
4 and FIG. 5 illustrate a general case of all embodiments that perform a hash join by applying a hash function twice, and those skilled in the art will appreciate that the techniques shown in FIGS. 4 and 5 apply the hash function more than once, And includes all the embodiments for performing a hash join based thereon.

상기와 같은 실시예에 있어, 제1 데이터 테이블 및 제2 데이터 테이블 각각에 대해 제1 해쉬 함수(h1(x))를 적용하여 각각 버킷별로 분류된 버킷별 데이터 테이블을 생성한다(S210). 이때, 설명의 편의를 위해 데이터 테이블의 각 행을 버킷(bucket)이라 명명하였으며, 상기 버킷은 엔트리 및 상기 엔트리에 연결된 하나 또는 두 개 이상의 링크드 리스트 형태로 구성될 수 있다. In the above embodiment, a first hash function h 1 (x) is applied to each of the first data table and the second data table to generate a bucket-specific data table classified by bucket (S210). For convenience of explanation, each row of the data table is referred to as a bucket, and the bucket may be configured in the form of one or two or more linked lists connected to the entry and the entry.

상기 S210 단계를 통해, 제1 데이터 및 제2 데이터가 서로 구분된 버킷별 데이터 테이블을 생성할 수 있다. 이때, 동일한 행에 위치한 제1 데이터 및 제2 데이터는 제1 해쉬 함수(h1(x))에 따른 결과 값이 동일하여 동일한 버킷에 포함됨을 의미한다.Through step S210, a bucket-specific data table in which the first data and the second data are distinguished from each other can be generated. In this case, the first data and the second data located in the same row are included in the same bucket because the result of the first hash function h 1 (x) is the same.

이어, 상기 버킷별 데이터 테이블 중 어느 일 버킷에 포함된 제1 데이터들에 대해 제2 해쉬 함수(h2(x))를 적용하여 상기 버킷 내 제1 데이터들이 엔트리별로 소팅된 해쉬 맵을 생성한다(S220). 이때, 상기 해쉬 맵은 상기 일 버킷에 포함된 제1 데이터들만 활용하여 생성하며, 구체적인 해쉬 맵 생성 방법 및 생성된 해쉬 맵은 상기 S120 단계를 통해 생성된 해쉬 맵과 동일하다. 따라서 이에 대해서는 이하 생략한다.
Next, a second hash function (h 2 (x)) is applied to the first data included in one bucket among the bucket-specific data tables to generate a hash map sorted by the first data in the bucket (S220). At this time, the hash map is generated by utilizing only the first data included in the bucket, and the concrete hash map generating method and generated hash map are the same as the hash map generated through step S120. Therefore, this will not be described below.

상기 S220 단계에 의해 엔트리별 데이터가 소팅된 해쉬 맵이 생성되면, 상기 해쉬 맵의 데이터들과 동일 버킷에 포함된 제2 데이터들에 대해 제2 해쉬 함수(h2(x))를 적용하여 제2 데이터들에 대응되는 엔트리를 결정하고, 해당 엔트리를 스캔(탐색)한다(S230). 이어, 해당 엔트리 내에서 대응되는 제1 데이터를 발견하면 상기 제1 데이터와 제2 데이터의 조인 연산을 수행한다(S240).When a hash map in which data for each entry is sorted is generated in step S220, a second hash function h 2 (x) is applied to the second data included in the same bucket as the data of the hash map, 2 data, and scans (searches) the corresponding entry (S230). If the corresponding first data is found in the corresponding entry, a join operation of the first data and the second data is performed (S240).

상기 S230 및 S240 단계의 구체적인 동작 방법은 상기 S130 및 S140 단계를 통해 상세히 설명한 바 이하 생략한다.
The detailed operation method of steps S230 and S240 will be described later in detail through steps S130 and S140.

이제까지 본 발명에 대하여 그 바람직한 실시예들을 중심으로 살펴보았다. 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 본 발명이 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 발명의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다.The present invention has been described with reference to the preferred embodiments. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the disclosed embodiments should be considered in an illustrative rather than a restrictive sense. The scope of the present invention is defined by the appended claims rather than by the foregoing description, and all differences within the scope of equivalents thereof should be construed as being included in the present invention.

Claims (10)

컴퓨터 메모리 내부에 저장된 데이터를 처리하는 저장매체의 메모리에서,
(A) 상기 메모리 내부에 제1 데이터 테이블 및 제2 데이터 테이블을 준비하는 단계;
(B) 상기 제1 데이터 테이블의 제1 데이터들에 대해 제1 해쉬 함수를 적용하여 상기 제1 데이터 테이블의 제1 데이터들을 엔트리별로 분류하며, 각 엔트리별 분류된 제1 데이터들의 조인 키(Join Key) 값에 따라 상기 제1 데이터들이 오름차순 또는 내림차순으로 소팅된 해쉬 맵을 메모리 영역에 생성하는 단계;
(C) 상기 제2 데이터 테이블의 제2 데이터들에 제1 해쉬 함수를 적용하여 대응되는 엔트리를 결정하는 단계; 및
(D) 각 제2 데이터별로 결정된 엔트리 내에 각 제2 데이터와 동일한 조인 키(Join Key)를 갖는 제1 데이터를 탐색하여 조인 연산을 수행하는 단계;
를 포함하는 소팅 연산을 이용한 해쉬 조인 방법.
In a memory of a storage medium for processing data stored in a computer memory,
(A) preparing a first data table and a second data table in the memory;
(B) classifying the first data of the first data table into entries by applying a first hash function to the first data of the first data table, and generating a join key of the first data classified by each entry Generating a hash map in the memory area in which the first data is sorted in ascending or descending order according to a value of a key;
(C) applying a first hash function to second data of the second data table to determine a corresponding entry; And
(D) searching for first data having the same join key as each second data in an entry determined for each second data, and performing a join operation;
A hash join method using a sorting operation that includes a hash join.
제 1항에 있어서,
상기 (B) 단계는,
(B-1) 상기 제1 데이터 테이블의 어느 하나의 제1 데이터를 스캔하고 상기 제1 데이터에 대해 제1 해쉬 함수를 적용하여 상기 제1 데이터를 상기 해쉬 맵의 엔트리별로 분류하는 단계; 및
(B-2) 상기 어느 하나의 제1 데이터가 엔트리별로 분류될 때마다, 상기 제1 데이터의 조인 키 값과 미리 대응되는 엔트리로 분류된 제1 데이터들의 조인 키 값을 비교하여 오름차순 또는 내림차순으로 소팅하여 해쉬 맵을 생성하는 단계; 를 포함하고,
상기 (B-1) 및 (B-2) 단계는,
상기 제1 데이터 테이블의 모든 제1 데이터들에 대한 제1 해쉬 함수 적용 및 엔트리별 분류가 완료될 때까지 수행하는 것을 특징으로 하는 소팅 연산을 이용한 해쉬 조인 방법.
The method according to claim 1,
The step (B)
(B-1) scanning one of the first data of the first data table and applying a first hash function to the first data to classify the first data by entries of the hash map; And
(B-2) Each time one of the first data is classified by entry, the join key value of the first data is compared with the join key value of the first data classified into the entry corresponding to the first data in ascending or descending order Generating a hash map by sorting; Lt; / RTI &gt;
The steps (B-1) and (B-2)
Wherein the hash join is performed until the application of the first hash function to all the first data of the first data table and the classification of each entry are completed.
제 1항에 있어서,
상기 (B) 단계는,
(B-1) 상기 제1 데이터 테이블의 제1 데이터들을 순서대로 스캔하며 각 제1 데이터에 대해 제1 해쉬 함수를 적용하여 상기 제1 데이터를 상기 해쉬 맵의 엔트리별로 분류하는 단계; 및
(B-2) 상기 제1 데이터 테이블의 모든 제1 데이터들에 대한 제1 해쉬 함수 적용 및 엔트리별 분류가 완료되면, 각 엔트리별로 제1 데이터들의 조인 키 값을 서로 비교하며 오름차순 또는 내림차순으로 소팅된 해쉬 맵을 생성하는 단계;를 포함하는 것을 특징으로 하는 소팅 연산을 이용한 해쉬 조인 방법.
The method according to claim 1,
The step (B)
(B-1) scanning first data of the first data table in order and classifying the first data by entries of the hash map by applying a first hash function to each first data; And
(B-2) When the application of the first hash function and the classification of each entry are completed for all the first data in the first data table, the join key values of the first data for each entry are compared with each other, and the sorting is performed in ascending or descending order And generating a hash map based on the generated hash map.
제 1항에 있어서,
상기 (B) 단계는,
상기 해쉬 맵의 엔트리 중 분류된 제1 데이터의 수가 문턱값 이상인 엔트리에 대해서만 제1 데이터의 조인 키 값에 따라 오름차순 또는 내림차순으로 소팅된 해쉬 맵을 생성하는 것을 특징으로 하는 소팅 연산을 이용한 해쉬 조인 방법.
The method according to claim 1,
The step (B)
Wherein the hash map is generated in ascending or descending order according to the join key value of the first data only for the entry having the number of sorted first data items equal to or greater than the threshold value among the entries of the hash map. .
컴퓨터 메모리 내부에 저장된 데이터를 처리하는 저장매체의 메모리에서,
(A) 상기 메모리 내부에 제1 데이터 테이블에 포함된 하나 이상의 제1 데이터에 대해 제1 해쉬 함수를 적용하여 하나 이상의 버킷들로 분류하는 단계;
(B) 상기 메모리 내부에 제2 데이터 테이블에 포함된 하나 이상의 제2 데이터에 대해 제1 해쉬 함수를 적용하여 하나 이상의 버킷들로 분류하는 단계;
(C) 어느 일 버킷에 포함된 하나 이상의 제1 데이터에 대해 제2 해쉬 함수를 적용하여 엔트리별로 분류하며, 각 엔트리별 제1 데이터들의 레코드 값들이 오름차순 또는 내림차순으로 소팅된 해쉬 맵을 메모리 영역에 생성하는 단계;
(D) 상기 일 버킷에 포함된 하나 이상의 제2 데이터에 대해 제2 해쉬 함수를 적용하여 대응되는 엔트리를 결정하는 단계; 및
(E) 각 제2 데이터별로 결정된 엔트리 내에 각 제2 데이터와 동일한 조인 키(Join Key)를 갖는 제1 데이터를 탐색하여 조인 연산을 수행하는 단계;
를 포함하는 소팅 연산을 이용한 해쉬 조인 방법.
In a memory of a storage medium for processing data stored in a computer memory,
(A) applying a first hash function to one or more first data included in a first data table in the memory and classifying the one or more first data into one or more buckets;
(B) applying a first hash function to one or more second data included in the second data table in the memory, and classifying the one or more second data into one or more buckets;
(C) Applying a second hash function to one or more first data included in a certain bucket and classifying the data according to each entry. A hash map, in which record values of first data for each entry are sorted in ascending or descending order, ;
(D) applying a second hash function to one or more second data included in the one bucket to determine a corresponding entry; And
(E) searching for first data having the same join key as each second data in an entry determined for each second data, and performing a joining operation;
A hash join method using a sorting operation that includes a hash join.
제 5항에 있어서,
상기 (C) 단계는,
(C-1) 상기 일 버킷에 포함된 어느 하나의 제1 데이터를 스캔하고 상기 제1 데이터에 대해 제2 해쉬 함수를 적용하여 상기 제1 데이터를 상기 해쉬 맵의 엔트리별로 분류하는 단계; 및
(C-2) 상기 어느 하나의 제1 데이터가 엔트리별로 분류될 때마다, 상기 제1 데이터의 조인 키 값과 미리 대응되는 엔트리로 분류된 제1 데이터들의 조인 키 값을 비교하여 오름차순 또는 내림차순으로 소팅하여 해쉬 맵을 생성하는 단계; 를 포함하고,
상기 (C-1) 및 (C-2) 단계는,
상기 제1 데이터 테이블의 모든 제1 데이터들에 대한 제2 해쉬 함수 적용 및 엔트리별 분류가 완료될 때까지 수행하는 것을 특징으로 하는 소팅 연산을 이용한 해쉬 조인 방법.
6. The method of claim 5,
The step (C)
(C-1) scanning one of the first data included in the one bucket and applying a second hash function to the first data to classify the first data for each entry of the hash map; And
(C-2) comparing the join key value of the first data with the join key value of the first data classified into the entry corresponding to the first data, in ascending or descending order, Generating a hash map by sorting; Lt; / RTI &gt;
The steps (C-1) and (C-2)
Wherein the hash join is performed until a second hash function is applied to all the first data in the first data table and classification is performed for each entry.
제 5항에 있어서,
상기 (C) 단계는,
(C-1) 상기 일 버킷에 포함된 제1 데이터들을 순서대로 스캔하며 각 제1 데이터에 대해 제2 해쉬 함수를 적용하여 상기 제1 데이터를 상기 해쉬 맵의 엔트리별로 분류하는 단계; 및
(C-2) 상기 일 버킷에 포함된 모든 제1 데이터들에 대한 제2 해쉬 함수 적용 및 엔트리별 분류가 완료되면, 각 엔트리별로 제1 데이터들의 조인 키 값을 서로 비교하며 오름차순 또는 내림차순으로 소팅된 해쉬 맵을 생성하는 단계;를 포함하는 것을 특징으로 하는 소팅 연산을 이용한 해쉬 조인 방법.
6. The method of claim 5,
The step (C)
(C-1) sequentially scanning the first data included in the one bucket and classifying the first data by the entry of the hash map by applying a second hash function to each first data; And
(C-2) When the application of the second hash function and the classification for each entry are completed for all the first data included in the one bucket, the join key values of the first data for each entry are compared with each other and the sorting is performed in ascending or descending order And generating a hash map based on the generated hash map.
제 5항에 있어서,
상기 (C) 단계는,
상기 해쉬 맵의 엔트리 중 분류된 제1 데이터의 수가 문턱값 이상인 엔트리에 대해서만 제1 데이터의 조인 키 값에 따라 오름차순 또는 내림차순으로 소팅된 해쉬 맵을 생성하는 것을 특징으로 하는 소팅 연산을 이용한 해쉬 조인 방법.
6. The method of claim 5,
The step (C)
Wherein the hash map is generated in ascending or descending order according to the join key value of the first data only for the entry having the number of sorted first data items equal to or greater than the threshold value among the entries of the hash map. .
삭제delete 컴퓨터로 읽을 수 있는 기록매체에 있어서,
제 1항 내지 제 8항 중 어느 한 항에 따른 해쉬 조인 방법을 구현한, 컴퓨터로 실행 가능한 프로그램이 기록된 기록매체.
A computer-readable recording medium,
9. A computer-readable recording medium having embodied thereon a hash join method according to any one of claims 1 to 8.
KR1020150054744A 2015-04-17 2015-04-17 Method for Hash-Join Using Sorting calculation, and computer program, and storage medium operating thereof KR101705444B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020150054744A KR101705444B1 (en) 2015-04-17 2015-04-17 Method for Hash-Join Using Sorting calculation, and computer program, and storage medium operating thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020150054744A KR101705444B1 (en) 2015-04-17 2015-04-17 Method for Hash-Join Using Sorting calculation, and computer program, and storage medium operating thereof

Publications (2)

Publication Number Publication Date
KR20160123913A KR20160123913A (en) 2016-10-26
KR101705444B1 true KR101705444B1 (en) 2017-02-09

Family

ID=57251923

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020150054744A KR101705444B1 (en) 2015-04-17 2015-04-17 Method for Hash-Join Using Sorting calculation, and computer program, and storage medium operating thereof

Country Status (1)

Country Link
KR (1) KR101705444B1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101986129B1 (en) * 2019-04-17 2019-06-05 영남대학교 산학협력단 Method and apparatus for data arrangement and computind device for executing the thereof
CN110706051B (en) * 2019-07-03 2022-03-29 威富通科技有限公司 Order data aggregation method and device and server
CN111291990B (en) * 2020-02-04 2023-11-07 浙江大华技术股份有限公司 Quality monitoring processing method and device
CN116401258B (en) * 2023-06-06 2023-09-22 支付宝(杭州)信息技术有限公司 Data indexing method, data query method and corresponding devices

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6834279B1 (en) 2001-05-24 2004-12-21 Ncr Corporation Method and system for inclusion hash joins and exclusion hash joins in relational databases

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
PRAM 기반의 조인 알고리즘 성능 비교 연구(정보과학회논문지 제42권 제3호, 2015.03, 379-389(11 pages))

Also Published As

Publication number Publication date
KR20160123913A (en) 2016-10-26

Similar Documents

Publication Publication Date Title
KR101705444B1 (en) Method for Hash-Join Using Sorting calculation, and computer program, and storage medium operating thereof
US7827179B2 (en) Data clustering system, data clustering method, and data clustering program
US20110264997A1 (en) Scalable Incremental Semantic Entity and Relatedness Extraction from Unstructured Text
CN108681603B (en) Method for rapidly searching tree structure data in database and storage medium
JP5959592B2 (en) Database management method, program, management system, and database tree structure
US10877973B2 (en) Method for efficient one-to-one join
KR101105736B1 (en) A effective method for frequent itemsets mining on very large transaction database environment
JP5844824B2 (en) SPARQL query optimization method
Czumaj et al. Planar graphs: Random walks and bipartiteness testing
JP5287071B2 (en) Database management system and program
US8549023B2 (en) Method and apparatus for resorting a sequence of sorted strings
Pang et al. Incremental maintenance of shortest distance and transitive closure in first-order logic and SQL
KR20200098971A (en) Method and apparatus for storing data based on single-level
KR101961562B1 (en) Method for Hash-Join and computer program, and storage medium operating thereof
CN111382158A (en) Method and system for realizing parallel connection by adopting two-stage hash table structure
WO2013172309A1 (en) Rule discovery system, method, device, and program
KR101793005B1 (en) Incremental high utility pattern mining method with static and dynamic databases
Li et al. Generating closed frequent itemsets with the frequent pattern list
Tran et al. An approach for mining concurrently closed itemsets and generators
Bhardwaj et al. Improved Apriori algorithm for association rules
Bhatt et al. Mining interesting rare items with maximum constraint model based on tree structure
KR102496551B1 (en) String matching method, apparatus and program implementing the method by using synonym rules
JPWO2014061305A1 (en) Entry insertion apparatus, method, and program
Subramaniam Generating Selective Filters for Access Method and Physical Design Evaluation
US10223405B2 (en) Retrieval control method and retrieval server

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20200113

Year of fee payment: 4