KR102013839B1 - Method and System for Managing Database, and Tree Structure for Database - Google Patents

Method and System for Managing Database, and Tree Structure for Database Download PDF

Info

Publication number
KR102013839B1
KR102013839B1 KR1020150034544A KR20150034544A KR102013839B1 KR 102013839 B1 KR102013839 B1 KR 102013839B1 KR 1020150034544 A KR1020150034544 A KR 1020150034544A KR 20150034544 A KR20150034544 A KR 20150034544A KR 102013839 B1 KR102013839 B1 KR 102013839B1
Authority
KR
South Korea
Prior art keywords
record
page
key
ufk
lfk
Prior art date
Application number
KR1020150034544A
Other languages
Korean (ko)
Other versions
KR20150044013A (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 KR1020150034544A priority Critical patent/KR102013839B1/en
Publication of KR20150044013A publication Critical patent/KR20150044013A/en
Application granted granted Critical
Publication of KR102013839B1 publication Critical patent/KR102013839B1/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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/221Column-oriented storage; Management thereof
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Abstract

본 발명은 데이터베이스의 인덱스를 구성함에 있어, 한 페이지에 포함되는 다수 개의 레코드의 키값의 하한값 및 상한값을 구분자로서 저장하고, 이를 이용하여 다수 개의 레코드에서 중복되는 키값을 삭제함으로써, 인덱스 페이지가 저장되는 저장 공간을 절약하고 이로 인해 데이터베이스의 성능이 향상되는 데이터베이스 관리 방법 및 시스템에 관한 것이다. According to the present invention, in configuring an index of a database, an index page is stored by storing a lower limit value and an upper limit value of a key value of a plurality of records included in one page as a delimiter, and deleting duplicate key values from the plurality of records using the same. A database management method and system that saves storage space and thereby improves database performance.

Description

데이터베이스 관리 방법, 시스템 및 데이터베이스 트리 구조{Method and System for Managing Database, and Tree Structure for Database}Method and System for Managing Database, and Tree Structure for Database

본 발명은 데이터베이스 관리 방법, 시스템 및 데이터베이스 트리 구조에 관한 것으로, 상세하게는 인덱스 압축 기법(Index Compression Method)을 이용한 데이터베이스 관리 방법, 시스템 및 데이터베이스 트리 구조에 관한 것이다. The present invention relates to a database management method, a system and a database tree structure, and more particularly, to a database management method, a system and a database tree structure using an index compression method.

데이터베이스 관리 시스템(Database Management System: DBMS, '이하 DBMS'라 함)은 방대한 양의 데이터가 저장되어 있는 데이터베이스를 관리하기 위한 시스템으로서, 대량의 정보들이 쉴새없이 생성되고 있는 현시대에 있어서 없어서는 안 될 중요한 요소로 인식되고 있다.Database Management System (DBMS) is a system for managing a database that stores a large amount of data. It is an indispensable part of the current era when a large amount of information is constantly created. It is recognized as an element.

이러한 DBMS에서는 모든 데이터를 테이블(Table) 형태로 데이터베이스에 저장하는데, 여기서 테이블이란 데이터베이스에서 데이터를 저장하는 기본구조를 말하며, 하나의 테이블은 하나 이상의 레코드(Record)들로 구성된다. 여기서, 레코드란 테이블의 한 행(Row)를 의미한다. 또한, 각 레코드는 하나 이상의 칼럼으로 구성되는데, 칼럼이란 테이블을 구성하는 실세계의 테이블 항목을 표현하는 이름을 가진 도메인(Domain)을 의미하는 것으로서, 어트리뷰트(Attribute) 또는 필드(Field)라고도 한다.In such a DBMS, all data is stored in a database in the form of a table, where a table is a basic structure for storing data in a database, and one table is composed of one or more records. Here, the record means one row of the table. In addition, each record is composed of one or more columns. A column means a domain having a name representing a table item of a real world constituting a table, and is also called an attribute or a field.

이러한 DBMS는 외부로부터 특정 질의(Query)가 입력되는 경우, 입력된 질의에 따라 데이터베이스에 데이터를 선택, 삽입, 갱신, 삭제 등의 기능을 수행한다. 여기서 질의란 데이터베이스의 테이블에 저장되어 있는 데이터에 대한 어떠한 요구, 즉 데이터에 대한 어떠한 조작을 하기 원하는지를 기술한 것을 의미하는 것으로서, SQL(Structured Query Language)과 같은 언어를 이용하여 표현한다.When a specific query is input from the outside, the DBMS performs a function of selecting, inserting, updating, and deleting data in the database according to the input query. In this case, the query describes what kind of request for data stored in a table of a database, that is, what kind of manipulation of the data is desired, and is expressed using a language such as SQL (Structured Query Language).

한편, 데이터의 양이 갈수록 방대해짐에 따라 DBMS는 일반적으로 인덱스(index)를 구비한다. 여기서, 인덱스(index)란 데이터베이스 분야에 있어서 테이블에 대한 탐색 속도를 높여주는 자료구조를 의미하며, 이와 같은 인덱스는 데이터 레코드(튜플)에 빠르게 접근하기 위해 {키값, 포인터} 쌍으로 구성되는 데이터 구조를 갖는다. On the other hand, as the amount of data increases, the DBMS generally has an index. Here, an index means a data structure that speeds up a search for a table in a database field. Such an index is a data structure composed of {key value, pointer} pairs to quickly access a data record (tuple). Has

전술한 배경기술은 발명자가 본 발명의 도출을 위해 보유하고 있었거나, 본 발명의 도출 과정에서 습득한 기술 정보로서, 반드시 본 발명의 출원 전에 일반 공중에게 공개된 공지기술이라 할 수는 없다.The background art described above is technical information possessed by the inventors for the derivation of the present invention or acquired during the derivation process of the present invention, and is not necessarily a publicly known technique disclosed to the general public before the application of the present invention.

본 발명의 일 실시예는 데이터베이스의 인덱스를 구성함에 있어, 한 페이지에 포함되는 다수 개의 레코드의 키값의 하한값 및 상한값을 구분자로서 저장하고, 이를 이용하여 다수 개의 레코드에서 키의 중복되는 부분을 삭제함으로써, 인덱스 페이지가 저장되는 저장 공간을 절약하고 이로 인해 데이터베이스의 성능이 향상되는 데이터베이스 관리 방법, 시스템 및 데이터베이스 트리 구조를 제공하는 것을 목적으로 한다.In an embodiment of the present invention, in configuring an index of a database, a lower limit value and an upper limit value of a key value of a plurality of records included in a page are stored as a delimiter, and the duplicated portion of the key is deleted from the plurality of records by using the identifier. Its purpose is to provide a database management method, system, and database tree structure that saves storage space where index pages are stored and thereby improves database performance.

또한, 본 발명의 일 실시예는 실시간(run-time)으로 압축 여부를 설정하는 것이 가능하도록 하여, 특정 영역에 삽입/삭제(insert/delete) 부하가 높아지면 압축을 수행하지 않도록 조정함으로써 데이터베이스 운영의 효율성이 향상된 데이터베이스 관리 방법, 시스템 및 데이터베이스 트리 구조를 제공하는 것을 목적으로 한다.In addition, an embodiment of the present invention enables to set whether or not to compress in run-time, so that the database operation by adjusting not to perform compression when the load of insert / delete in a specific region becomes high Its purpose is to provide an improved database management method, system and database tree structure.

또한, 본 발명의 일 실시예는 부차적인 압축방식 및 범위에 대한 메타데이터를 추가로 기록할 필요가 없도록 하여, 페이지에 저장되는 레코드의 개수가 많아질수록 압축되는 레코드에 메타 정보를 포함하는 기존의 방법에 비해서 압축 효율이 극대화되는 데이터베이스 관리 방법, 시스템 및 데이터베이스 트리 구조를 제공하는 것을 목적으로 한다.In addition, an embodiment of the present invention eliminates the need to additionally record metadata about secondary compression schemes and ranges, and includes meta information in records that are compressed as the number of records stored on a page increases. Its purpose is to provide a database management method, system, and database tree structure that can maximize compression efficiency compared to

또한, 본 발명의 일 실시예는 인덱스의 트리 구조를 순회(Traverse)할 때마다 각 페이지의 LFK 및 UFK를 이용하여 리프 노드의 유효성 검사(validity check)를 수행함으로써, 인덱스 구조의 오류를 손쉽게 체크할 수 있는 데이터베이스 관리 방법, 시스템 및 데이터베이스 트리 구조를 제공하는 것을 목적으로 한다. In addition, an embodiment of the present invention easily checks an error of an index structure by performing validation of leaf nodes using LFK and UFK of each page whenever traversing a tree structure of an index. It aims to provide a database management method, system and database tree structure that can be done.

본 발명의 일 실시예는 각 페이지에 포함되는 다수 개의 레코드의 키값의 하한값이 LFK(lower fence key)로 저장되거나 또는, 레코드의 키값의 상한값이 UFK(upper fence key)로 저장되는 단계; 상기 페이지를 이루는 다수 개의 레코드의 키값 중 공통 영역이 프리픽스(prefix)로 추출되는 단계; 및 상기 다수 개의 레코드의 키값에서 상기 프리픽스(prefix)에 해당하는 부분을 제외한 나머지 부분이 저장되는 단계;를 포함하는 데이터베이스 관리 방법을 개시한다. According to an embodiment of the present invention, a lower limit value of key values of a plurality of records included in each page is stored as a lower fence key (LFK), or an upper limit value of a key value of a record is stored as an upper fence key (UFK); Extracting a common area among key values of a plurality of records constituting the page as a prefix; And storing a part of the plurality of records except for a portion corresponding to the prefix in key values of the plurality of records.

본 실시예에 있어서, 상기 프리픽스는 LFK(lower fence key) 또는 UFK(upper fence key)에 저장될 수 있다. In the present embodiment, the prefix may be stored in a lower fence key (LFK) or an upper fence key (UFK).

본 실시예에 있어서, 상기 각 레코드 중 LFK(lower fence key) 또는 UFK(upper fence key)가 저장되는 레코드 이외의 레코드에는, 각 레코드의 원본키값 중 상기 프리픽스를 제외한 키값들이 저장될 수 있다. In the present embodiment, in the records other than the record in which the lower fence key (LFK) or the upper fence key (UFK) is stored, key values excluding the prefix among the original key values of the respective records may be stored.

본 실시예에 있어서, 상기 레코드는 다수 개의 키값을 포함하는 멀티 칼럼(multi column) 형태의 레코드일 수 있다. In the present embodiment, the record may be a multi-column type record including a plurality of key values.

본 실시예에 있어서, 상기 다수 개의 키값 중, 하나의 페이지를 이루는 레코드가 동일한 값을 가지는 키값이 상기 프리픽스로 추출될 수 있다. In the present embodiment, among the plurality of key values, a key value having a same value as a record forming one page may be extracted as the prefix.

본 실시예에 있어서, 상기 각 페이지는 B 트리 또는 B+ 트리 구조의 리프 노드일 수 있다. In the present embodiment, each page may be a leaf node of a B tree or a B + tree structure.

본 실시예에 있어서, 상기 데이터베이스 관리 방법은, 상기 페이지에 포함된 레코드의 원본키값이 복원되는 단계를 더 포함하고, 상기 원본키값이 복원되는 단계는, 해당 페이지에 상기 LFK와 UFK가 존재하는지 여부가 확인되는 단계; 해당 페이지에 상기 LFK와 UFK가 존재할 경우, 상기 LFK와 UFK를 비교 연산하여 이에 공통되는 프리픽스가 추출되는 단계; 및 상기 추출된 프리픽스와 해당 레코드의 키값이 결합하여 원본키값이 복원되는 단계;를 포함할 수 있다.In the present embodiment, the database management method further includes the step of restoring an original key value of a record included in the page, and the step of restoring the original key value includes whether the LFK and the UFK exist on the page. Is confirmed; If the LFK and the UFK exist on the page, comparing the LFK and the UFK and extracting a common prefix thereof; And restoring an original key value by combining the extracted prefix with a key value of a corresponding record.

본 실시예에 있어서, 해당 페이지에 상기 LFK와 UFK가 존재하지 않을 경우, 각 레코드에 저장된 키값이 원본키값인 일 수 있다. In the present embodiment, when the LFK and the UFK do not exist in the corresponding page, the key value stored in each record may be an original key value.

본 실시예에 있어서, 상기 데이터베이스 관리 방법은, 상기 페이지에 새로운 레코드가 추가되거나 기 존재하는 레코드가 변경되는 단계를 더 포함하고, 상기 레코드가 추가되거나 변경되는 단계는, 해당 페이지에 상기 LFK와 UFK가 존재하는지 여부가 확인되는 단계; 해당 페이지에 상기 LFK와 UFK가 존재할 경우, 상기 LFK와 UFK를 비교 연산하여 이에 공통되는 프리픽스가 추출되는 단계; 및 추가 또는 변경될 레코드에서 상기 프리픽스가 제외된 나머지 키값이 레코드로 추가 또는 변경되는 단계;를 포함할 수 있다. In the present embodiment, the database management method further includes the step of adding a new record to the page or changing an existing record, wherein the step of adding or changing the record comprises: the LFK and UFK on the page. Checking whether there is a; If the LFK and the UFK exist on the page, comparing the LFK and the UFK and extracting a common prefix thereof; And adding or changing the remaining key values from which the prefix is excluded from the record to be added or changed to the record.

본 실시예에 있어서, 해당 페이지에 상기 LFK와 UFK가 존재하지 않을 경우, 상기 프리픽스가 추출되지 아니하고, 해당 페이지에 레코드가 추가 또는 변경될 수 있다. In the present embodiment, when the LFK and the UFK do not exist in the page, the prefix is not extracted, and a record may be added or changed in the page.

본 발명의 다른 실시예는 B 트리 또는 B+ 트리 구조의 데이터베이스 관리 방법에 있어서, B 트리 또는 B+ 트리 구조의 인덱스가 생성되는 단계; 상기 인덱스에서 소정의 레코드가 복원되는 단계; 상기 인덱스에 소정의 레코드가 추가 또는 변경되는 단계;를 포함하고, 상기 인덱스가 생성되는 단계는, 하나 이상의 리프 노드의 적어도 일 단부에, 해당 리프 노드에 속하는 키값의 하한값이 LFK(lower fence key)로 저장되거나 또는 해당 리프 노드에 속하는 키값의 상한값이 UFK(upper fence key)가 저장되는 단계를 포함하는 데이터베이스 관리 방법을 개시한다.Another embodiment of the present invention provides a method for managing a database of a B tree or a B + tree structure, comprising: generating an index of a B tree or a B + tree structure; Restoring a predetermined record from the index; And adding or changing a predetermined record to the index, wherein the creating of the index includes: at least one end of one or more leaf nodes, wherein a lower limit of a key value belonging to the leaf node is LFK (lower fence key) A method of managing a database includes a step of storing an upper fence key (UFK) in which an upper limit value of a key value belonging to or corresponding to a leaf node is stored.

본 발명의 다른 실시예는 특정 테이블에 포함된 레코드의 인출요청 및 상기 레코드에 포함된 적어도 하나의 칼럼에 대한 갱신요청이 함께 정의된 질의문을 수신하여 분석하는 질의문 분석부; 상기 분석된 질의문을 수행하기 위한 실행계획을 생성하는 실행계획 생성부; 상기 실행계획에 따라 상기 레코드의 인출 및 상기 적어도 하나의 칼럼에 대한 갱신을 수행함으로써 상기 실행계획을 실행하는 실행계획 실행부; 및 특정 테이블에 대한 인덱스를 생성하며, 상기 인덱스의 각 페이지에 속하는 다수 개의 레코드의 키값의 하한값을 LFK(lower fence key)로 저장하거나 또는, 레코드의 키값의 상한값을 UFK(upper fence key)로 저장하는 인덱스 생성부를 포함하는 인덱스 관리부;를 포함하는 데이터베이스 관리 시스템을 개시한다. Another embodiment of the present invention includes a query analysis unit for receiving and analyzing a query that is defined together with the retrieval request of the record included in the specific table and the update request for at least one column included in the record; An execution plan generation unit generating an execution plan for executing the analyzed query statement; An execution plan execution unit that executes the execution plan by performing the withdrawal of the record and updating the at least one column according to the execution plan; And create an index for a specific table, and store the lower limit of key values of a plurality of records belonging to each page of the index as a lower fence key (LFK), or store the upper limit value of a key value of a record as an UFK (upper fence key). Disclosed is a database management system including an index management unit including an index generation unit.

본 실시예에 있어서, 상기 인덱스 생성부는, 상기 각 페이지를 이루는 다수 개의 레코드의 키값 중 공통 영역을 프리픽스(prefix)로써 추출할 수 있다. In the present embodiment, the index generator may extract a common area among key values of a plurality of records constituting each page as a prefix.

본 실시예에 있어서, 상기 인덱스 생성부는, 상기 각 페이지를 이루는 다수 개의 레코드의 키값에서 공통 영역인 상기 프리픽스(prefix)에 해당하는 부분을 제외한 나머지 부분을 인덱스에 저장할 수 있다. In the present exemplary embodiment, the index generator may store, in the index, remaining portions of the key values of the plurality of records constituting the pages except for the portion corresponding to the prefix, which is a common area.

본 실시예에 있어서, 상기 프리픽스는 LFK(lower fence key) 또는 UFK(upper fence key)에만 저장될 수 있다. In the present embodiment, the prefix may be stored only in a lower fence key (LFK) or an upper fence key (UFK).

본 실시예에 있어서, 상기 각 레코드 중 LFK(lower fence key) 또는 UFK(upper fence key)가 저장되는 레코드 이외의 레코드에는, 각 레코드의 원본키값 중 상기 프리픽스를 제외한 키값들만이 저장될 수 있다. In the present embodiment, only the key values excluding the prefix among the original key values of each record may be stored in a record other than the record in which the lower fence key (LFK) or the upper fence key (UFK) is stored among the records.

본 실시예에 있어서, 상기 인덱스 관리부는, 상기 인덱스의 각 페이지에 포함된 레코드로부터 원본키값을 복원하는 레코드 복원부를 더 포함할 수 있다. In the present embodiment, the index management unit may further include a record restoration unit for restoring an original key value from a record included in each page of the index.

본 실시예에 있어서, 상기 레코드 복원부는, 해당 페이지에 상기 LFK와 UFK가 존재하는지 여부를 확인하고, 해당 페이지에 상기 LFK와 UFK가 존재할 경우 LFK와 UFK를 비교 연산하여 상기 프리픽스를 추출하며, 추출된 상기 프리픽스와 해당 레코드의 값을 결합하여 원본키값을 복원할 수 있다. In the present embodiment, the record restoration unit checks whether the LFK and UFK exist in the page, and extracts the prefix by comparing and calculating the LFK and UFK when the LFK and UFK exist in the page. The original key value may be restored by combining the prefix and the value of the corresponding record.

본 실시예에 있어서, 상기 인덱스 관리부는, 상기 인덱스의 각 페이지에 새로운 레코드를 추가하거나 기 존재하는 레코드를 변경하는 레코드 업데이트부를 더 포함할 수 있다. In an embodiment, the index manager may further include a record updater that adds a new record to each page of the index or changes an existing record.

본 실시예에 있어서, 상기 레코드 업데이트부는, 해당 페이지에 상기 LFK와 UFK가 존재하는지 여부를 확인하고, 해당 페이지에 상기 LFK와 UFK가 존재할 경우 LFK와 UFK를 비교 연산하여 상기 프리픽스를 추출하며, 추가 또는 변경될 레코드에서 상기 프리픽스가 제외된 나머지 데이터를 해당 페이지에 레코드로 추가 또는 변경할 수 있다. In the present embodiment, the record update unit checks whether the LFK and the UFK exist in the page, and if the LFK and the UFK exist in the page, compares the LFK and the UFK to extract the prefix, and adds the result. Alternatively, the remaining data excluding the prefix from the record to be changed may be added or changed as a record on the corresponding page.

본 발명의 다른 실시예는 B 트리 또는 B+ 트리 구조의 데이터베이스 트리 구조에 있어서, 트리 구조의 최상부에 위치하며 하나 이상의 구분키값을 저장하는 루트 노드; 및 적어도 일 단부에 해당 리프 노드에 속하는 키값의 하한값이 LFK(lower fence key)로 저장되거나 또는 해당 리프 노드에 속하는 키값의 상한값이 UFK(upper fence key)가 저장되는 하나 이상의 리프 노드;를 포함하는 데이터베이스 트리 구조를 개시한다. Another embodiment of the present invention provides a database tree structure of a B tree or B + tree structure, comprising: a root node located at the top of the tree structure and storing one or more distinct key values; And at least one leaf node having a lower limit value of a key value belonging to the leaf node at least at one end as a lower fence key (LFK), or an upper limit value of a key value belonging to the leaf node having an upper fence key (UFK) stored therein. Initiate the database tree structure.

본 실시예에 있어서, 상기 리프 노드에서 LFK(lower fence key)와 UFK(upper fence key) 사이에 존재하는 레코드는, 상기 레코드의 키값에서 공통 영역을 제외한 나머지 키값만을 저장할 수 있다. In the present embodiment, a record existing between a lower fence key (LFK) and an upper fence key (UFK) in the leaf node may store only the remaining key values except for the common area in the key value of the record.

본 실시예에 있어서, 상기 루트 노드에 저장된 구분키값은 서로 이웃한 리프 노드의 어느 일 측의 LFK 및 다른 일 측의 UFK가 될 수 있다. In the present embodiment, the distinguishing key value stored in the root node may be an LFK of one side and an UFK of the other side of leaf nodes adjacent to each other.

본 실시예에 있어서, 다수 개의 상기 리프 노드 중 가장 왼쪽에 위치한 리프 노드에는 상기 LFK가 저장되지 아니하고, 다수 개의 상기 리프 노드 중 가장 오른쪽에 위치한 리프 노드에는 상기 UFK가 저장되지 아니할 수 있다. In the present embodiment, the LFK may not be stored at the leftmost leaf node of the plurality of leaf nodes, and the UFK may not be stored at the rightmost leaf node of the plurality of leaf nodes.

전술한 것 외의 다른 측면, 특징, 이점이 이하의 도면, 특허청구범위 및 발명의 상세한 설명으로부터 명확해질 것이다. Other aspects, features, and advantages other than those described above will become apparent from the following drawings, claims, and detailed description of the invention.

이와 같은 본 발명에 의해서, 인덱스 페이지가 저장되는 저장 공간을 절약할 수 있으며, 이에 따라 데이터베이스의 성능이 향상되는 효과를 얻을 수 있다. According to the present invention, it is possible to save a storage space for storing the index page, thereby improving the performance of the database.

또한, 본 발명의 일 실시예는 실시간(run-time)으로 압축 여부를 설정하는 것이 가능하도록 하여, 특정 영역에 삽입/삭제(insert/delete) 부하가 높아지면 압축을 수행하지 않도록 조정함으로써 데이터베이스 운영의 효율성이 향상되는 효과를 얻을 수 있다. In addition, an embodiment of the present invention enables to set whether or not to compress in run-time, so that the database operation by adjusting not to perform compression when the load of insert / delete in a specific region becomes high The efficiency can be improved.

또한, 본 발명의 일 실시예는 부차적인 압축방식 및 범위에 대한 메타데이터를 추가로 기록할 필요가 없도록 하여, 페이지에 저장되는 레코드의 개수가 많아질수록 압축 효율이 극대화되는 효과를 얻을 수 있다. In addition, an embodiment of the present invention eliminates the need to additionally record metadata about a secondary compression scheme and range, and thus, the compression efficiency may be maximized as the number of records stored in a page increases. .

또한, 본 발명의 일 실시예는 인덱스의 트리 구조를 순회(Traverse)할 때마다 각 페이지의 LFK 및 UFK를 이용하여 리프 노드의 유효성 검사(validity check)를 수행함으로써, 인덱스 구조의 오류를 손쉽게 체크하는 효과를 얻을 수 있다. In addition, an embodiment of the present invention easily checks an error of an index structure by performing validation of leaf nodes using LFK and UFK of each page whenever traversing a tree structure of an index. You can get the effect.

도 1은 본 발명의 일 실시예에 따른 데이터베이스 관리 시스템의 개략적인 블록도이다.
도 2a는 본 발명의 일 실시예에 따른 데이터베이스 관리 방법의 인덱스 생성 단계를 나타내는 흐름도이다.
도 2b는 본 발명의 일 실시예에 따른 데이터베이스 관리 방법의 레코드 복원 단계를 나타내는 흐름도이다.
도 2c는 본 발명의 일 실시예에 따른 데이터베이스 관리 방법의 레코드 추가/변경 단계를 나타내는 흐름도이다.
도 3은 본 발명의 데이터베이스 관리 방법 및 시스템이 적용되는 B 트리 인덱스의 구조를 예시적으로 도시한 도면이다.
도 4는 일반적인 B 트리 페이지의 키값의 배열을 나타내는 도면이다.
도 5는 본 발명의 데이터베이스 관리 방법 및 시스템에 따른 B 트리 페이지의 키값의 배열을 나타내는 도면이다.
도 6a 및 도 6b는 본 발명의 데이터베이스 관리 방법 및 시스템이 적용되는 B 트리 인덱스에서 페이지가 분할되는 과정을 나타내는 도면이다.
1 is a schematic block diagram of a database management system according to an embodiment of the present invention.
2A is a flowchart illustrating an index generation step of a database management method according to an embodiment of the present invention.
2B is a flowchart illustrating a record restoration step of a database management method according to an embodiment of the present invention.
2C is a flowchart illustrating a record addition / change step of the database management method according to an embodiment of the present invention.
3 is a diagram exemplarily illustrating a structure of a B-tree index to which a database management method and system of the present invention are applied.
4 is a diagram showing an arrangement of key values of a general B tree page.
5 is a diagram illustrating an arrangement of key values of a B-tree page according to the database management method and system of the present invention.
6A and 6B illustrate a process of dividing a page in a B-tree index to which the method and system for managing a database of the present invention are applied.

후술하는 본 발명에 대한 상세한 설명은, 본 발명이 실시될 수 있는 특정 실시예의 예시로서 도시하는 첨부 도면을 참조한다. 이러한 실시예는 당업자가 본 발명을 실시할 수 있기에 충분하도록 상세히 설명된다. 본 발명의 다양한 실시예는 서로 다르지만 상호 배타적일 필요는 없음이 이해되어야 한다. 예를 들어, 본 명세서에 기재되어 있는 특정 형상, 구조 및 특성은 본 발명의 정신과 범위를 벗어나지 않으면서 일 실시예로부터 다른 실시예로 변경되어 구현될 수 있다. 또한, 각각의 실시예 내의 개별 구성요소의 위치 또는 배치도 본 발명의 정신과 범위를 벗어나지 않으면서 변경될 수 있음이 이해되어야 한다. 따라서, 후술하는 상세한 설명은 한정적인 의미로서 행하여지는 것이 아니며, 본 발명의 범위는 특허청구범위의 청구항들이 청구하는 범위 및 그와 균등한 모든 범위를 포괄하는 것으로 받아들여져야 한다. 도면에서 유사한 참조부호는 여러 측면에 걸쳐서 동일하거나 유사한 구성요소를 나타낸다.DETAILED DESCRIPTION OF THE INVENTION The following detailed description of the invention refers to the accompanying drawings that show, by way of illustration, specific embodiments in which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the invention. It should be understood that the various embodiments of the present invention are different but need not be mutually exclusive. For example, certain shapes, structures, and characteristics described herein may be implemented with changes from one embodiment to another without departing from the spirit and scope of the invention. In addition, it is to be understood that the location or arrangement of individual components within each embodiment may be changed without departing from the spirit and scope of the invention. Accordingly, the following detailed description is not to be taken in a limiting sense, and the scope of the present invention should be taken as encompassing the scope of the claims of the claims and all equivalents thereto. Like reference numerals in the drawings indicate the same or similar elements throughout the several aspects.

이하에서는, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 본 발명을 용이하게 실시할 수 있도록 하기 위하여, 본 발명의 여러 실시예에 관하여 첨부된 도면을 참조하여 상세히 설명하기로 한다.
Hereinafter, various embodiments of the present invention will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement the present invention.

도 1은 본 발명의 일 실시예에 따른 데이터베이스 관리 시스템의 개략적인 블록도이다. 도 1을 참조하면, 본 발명의 일 실시예에 따른 데이터베이스 관리 시스템(100)은 다음과 같이 구성된다. 1 is a schematic block diagram of a database management system according to an embodiment of the present invention. 1, the database management system 100 according to an embodiment of the present invention is configured as follows.

먼저, 데이터베이스(110)에는 다양한 데이터들이 테이블 형식으로 저장되며, 상술한 바와 같이, 각 테이블은 하나 이상의 레코드로 구성되고, 각 레코드는 하나 이상의 칼럼으로 구성된다. 예컨대, 소정 게시판에 대한 게시물들이 저장된 데이터베이스인 경우, 테이블은 게시물들의 집합을 의미하고, 레코드는 각 게시물을 의미하며, 칼럼이란 게시물 식별자, 게시물의 작성자, 게시물의 조회수 등이 저장되는 영역을 의미한다. 도면에는 데이터베이스(110)가 복수 개 구비되는 것으로 도시되어 있으나, 본 발명의 사상은 이에 제한되지 아니하며, 데이터베이스 관리 시스템(100)의 구성, 저장되는 데이터 분량, 용도 등에 따라 데이터베이스(110)의 개수 및 구성은 다양하게 변경가능하다 할 것이다. First, the database 110 stores various data in a table format. As described above, each table is composed of one or more records, and each record is composed of one or more columns. For example, in the case of a database in which posts for a predetermined bulletin board are stored, a table means a set of posts, a record means each post, and a column means an area in which a post identifier, a creator of a post, and a number of views of a post are stored. . Although a plurality of databases 110 are illustrated in the drawings, the spirit of the present invention is not limited thereto, and the number of databases 110 and the number of databases 110 may vary depending on the configuration of the database management system 100, the amount of data to be stored, and the purpose thereof. The configuration may vary.

데이터베이스 관리 시스템(100)은 데이터베이스(110)에 연결되어 데이터베이스(110)에 기록된 데이터를 갱신 또는 삭제하거나 데이터베이스(110)에 데이터를 추가하는 등 데이터베이스(110)를 통합적으로 관리하는 기능을 수행하는 것으로서, 크게 질의문 분석부(120), 실행계획 생성부(130), 실행계획 실행부(140)를 포함한다. 또한, 데이터베이스 관리 시스템(100)은 엔트리 관리부(150) 및 인덱스 관리부(160)를 더 포함할 수 있다. The database management system 100 is connected to the database 110 to perform a function of integrally managing the database 110 such as updating or deleting data recorded in the database 110 or adding data to the database 110. As a large, it includes a query statement analysis unit 120, execution plan generation unit 130, execution plan execution unit 140. In addition, the database management system 100 may further include an entry manager 150 and an index manager 160.

질의문 분석부(120)는 데이터베이스 관리 시스템(100)과 연동되는 다양한 외부서버(미도시) 또는 관리자 단말기(미도시)로부터 데이터베이스(110)에 저장되어 있는 데이터들의 처리를 위한 질의문을 수신하고, 수신된 질의문을 분석한다. 이러한 질의문 분석부(120)는 질의문 수신부, 파서를 포함하며, 유효성 검증부를 더 포함할 수 있다.The query analysis unit 120 receives a query for processing data stored in the database 110 from various external servers (not shown) or administrator terminals (not shown) interworking with the database management system 100. Analyze the received query. The query analysis unit 120 may include a query reception unit and a parser, and may further include a validation unit.

실행계획 생성부(130)는 질의문 분석부(120)의 유효성 검증부에 의해 유효한 것으로 판단된 파스트리를 기반으로 요청된 레코드의 인출 및 레코드에 포함된 칼럼의 갱신을 위한 실행계획을 생성하여 후술할 메모리(170)에 저장한다. 여기서, 실행계획이란 특정 테이블로부터 레코드를 인출하는 방법, 결과 레코드 리스트, 갱신 요청된 칼럼에 대한 증가 연산 여부 등을 포함하는 자료구조를 의미한다.The execution plan generation unit 130 generates an execution plan for retrieving the requested record and updating the columns included in the record based on the pastry determined to be valid by the validity validation unit of the query statement analysis unit 120. Stored in the memory 170 to be described later. Here, the execution plan means a data structure including a method of retrieving a record from a specific table, a result record list, and whether to perform an increment operation on a column requested for updating.

일 실시예에 있어서 실행계획 생성부(130)는 요청된 레코드를 특정 테이블로부터 인출하는 방법으로서, 순차 스캔 방법 및 인덱스 스캔 방법 중 어느 하나를 선택할 수 있다. 여기서, 순차 스캔 방법이란 특정 테이블에 포함된 레코드들을 순차적으로 스캔해 가면서 해당 레코드의 식별자를 가진 레코드를 인출하는 방법을 의미하고, 인덱스 스캔 방법이란 각 레코드의 식별자 별로 인덱스가 생성되어 있어, 이러한 인덱스만을 스캔함으로써 해당 레코드를 인출하는 방법을 의미한다. 이와 같은 DBMS의 인덱스에 대해서는 뒤에서 상세히 설명하도록 한다. In one embodiment, the execution plan generator 130 may select one of a sequential scan method and an index scan method as a method of fetching a requested record from a specific table. Here, the sequential scan method means a method of fetching a record having an identifier of the corresponding record while sequentially scanning the records included in a specific table, and the index scan method is an index for each record identifier, such an index By scanning only means how to fetch that record. The index of such a DBMS will be described in detail later.

실행계획 실행부(140)는 실행계획 생성부(130)에 의해 생성된 실행계획에 따라 특정 테이블로부터 해당 레코드를 인출하고, 갱신 요청된 칼럼의 물리적 위치에 상응하는 레코드 상의 칼럼에 기록된 칼럼값에 증가 연산을 수행함으로써 해당 칼럼값을 갱신한다. 구체적으로, 실행계획 실행부(140)는 실행계획 생성부(130)에 의해 생성된 실행계획을 실행하기 위한 트랜잭션을 생성함으로써 생성된 실행계획을 해당 트랜잭션 동안 처리한다. 여기서, 트랜잭션이란 하나의 논리적 작업 단위를 구성하는 것으로서, 하나 이상의 SQL문을 이용해서 정의된다. 이러한 트랜잭션의 사용으로 인해 데이터의 일치성과 데이터의 동시발생을 보장할 수 있게 된다.The execution plan execution unit 140 fetches the corresponding record from a specific table according to the execution plan generated by the execution plan generation unit 130, and records the column value recorded in the column on the record corresponding to the physical position of the requested column for update. Update the column value by performing an increment operation. Specifically, the execution plan execution unit 140 processes the execution plan generated by generating a transaction for executing the execution plan generated by the execution plan generation unit 130 during the transaction. Here, a transaction constitutes one logical unit of work and is defined using one or more SQL statements. The use of these transactions ensures data consistency and data concurrency.

데이터베이스 관리 시스템(100)은 레코드의 식별자 및 갱신 요청되는 칼럼의 식별자로 구성되는 엔트리를 생성 또는 삭제하고, 생성된 엔트리를 엔트리에 포함된 칼럼 식별자에 상응하는 칼럼값과 매칭시켜 메모리(170)에 저장하는 엔트리 관리부(150)를 더 포함할 수 있고, 메모리(170)에는 갱신 요청된 칼럼의 칼럼값이 엔트리 관리부(150)에 생성된 엔트리와 매칭되어 저장될 수 있다.The database management system 100 generates or deletes an entry consisting of an identifier of a record and an identifier of a column to be updated, and matches the generated entry with a column value corresponding to a column identifier included in the entry to the memory 170. The apparatus may further include an entry manager 150 to store the data, and the column 170 of the column requested to be updated may be matched with an entry generated in the entry manager 150 in the memory 170.

한편, 데이터베이스 관리 시스템(100)은 인덱스를 생성 또는 삭제하고, 생성된 인덱스를 메모리(170)에 저장하는 인덱스 관리부(160)를 더 포함할 수 있다. 이와 같은 인덱스 관리부(160)는 인덱스 생성부(161), 레코드 복원부(163), 레코드 업데이트부(165)를 포함할 수 있다. The database management system 100 may further include an index manager 160 that generates or deletes an index and stores the generated index in the memory 170. The index manager 160 may include an index generator 161, a record restorer 163, and a record updater 165.

인덱스 생성부(161)는 특정 데이터베이스(110)에 대한 인덱스를 생성하며, 이때 인덱스의 각 페이지에 속하는 키값의 하한값을 LFK(lower fence key)로 저장하고, 키값의 상한값이 UFK(upper fence key)로 저장하는 역할을 수행한다. 또한, 인덱스 생성부(161)는 각 페이지를 이루는 다수 개의 레코드의 키값 중 공통 영역을 프리픽스(prefix)로써 추출하는 역할을 수행한다. 또한, 인덱스 생성부(161)는 각 페이지를 이루는 다수 개의 레코드의 키값에서 프리픽스(prefix)에 해당하는 부분을 삭제한 후 인덱스에 저장하는 역할을 수행한다. The index generator 161 generates an index for the specific database 110. At this time, the lower limit of the key value belonging to each page of the index is stored as a lower fence key (LFK), and the upper limit of the key value is an upper fence key (UFK). Serves as a store. In addition, the index generator 161 extracts a common area among key values of a plurality of records constituting each page as a prefix. In addition, the index generator 161 deletes a portion corresponding to a prefix from key values of a plurality of records constituting each page and stores the index.

레코드 복원부(163)는 인덱스의 각 페이지에 포함된 레코드로부터 원본키값을 복원하는 역할을 수행한다. 상세히, 레코드 복원부(163)는 해당 페이지에 LFK와 UFK가 존재하는지 여부를 확인하고, 해당 페이지에 LFK와 UFK가 존재할 경우 LFK와 UFK를 비교 연산하여 프리픽스를 추출하며, 추출된 프리픽스와 해당 레코드의 값을 결합하여 원본키값을 복원하는 역할을 수행한다. The record restoration unit 163 restores the original key value from the record included in each page of the index. In detail, the record restoring unit 163 checks whether LFK and UFK exist on the page, and extracts the prefix by comparing and calculating the LFK and UFK when the LFK and UFK exist on the page. Restores the original key value by combining the values of.

레코드 업데이트부(165)는 인덱스의 각 페이지에 새로운 레코드를 추가하거나 기 존재하는 레코드를 변경하는 역할을 수행한다. 상세히, 레코드 업데이트부(165)는 해당 페이지에 LFK와 UFK가 존재하는지 여부를 확인하고, 해당 페이지에 LFK와 UFK가 존재할 경우 LFK와 UFK를 비교 연산하여 프리픽스를 추출하며, 추가 또는 변경될 레코드에서 프리픽스가 제외된 나머지 데이터를 해당 페이지에 레코드로 추가 또는 변경하는 역할을 수행한다. The record updating unit 165 adds a new record to each page of the index or changes an existing record. In detail, the record update unit 165 checks whether the LFK and UFK exist in the page, extracts the prefix by comparing the LFK and UFK when the LFK and UFK exist in the page, and in the record to be added or changed. It adds or changes the rest of the data without the prefix as a record on the page.

이와 같은 인덱스 생성부(161)의 인덱스 생성 과정, 레코드 복원부(163)의 레코드 복원 과정, 레코드 업데이트부(165)의 레코드 업데이트 과정에 대해 도 2 이하에서 상세히 설명하도록 한다.
Such an index generation process of the index generator 161, a record restoration process of the record restorer 163, and a record update process of the record updater 165 will be described in detail with reference to FIG. 2.

이하에서는 이와 같이 구분자 기반의 인덱스 압축 기법(Serperator-Based Index Compression Method)을 이용한 데이터베이스 관리 방법에 대해 보다 상세히 설명하도록 한다. Hereinafter, a method of managing a database using a separator-based index compression method will be described in detail.

도 2a, 도 2b 및 도 2c는 본 발명의 일 실시예에 따른 데이터베이스 관리 방법을 나타내는 흐름도이다. 한편, 도 3은 본 발명의 데이터베이스 관리 방법 및 시스템이 적용되는 B 트리 인덱스의 구조를 예시적으로 도시한 도면이고, 도 4는 일반적인 B 트리 페이지의 키값의 배열을 나타내는 도면이며, 도 5는 본 발명의 데이터베이스 관리 방법 및 시스템에 따른 B 트리 페이지의 키값의 배열을 나타내는 도면이다. 2A, 2B and 2C are flowcharts illustrating a database management method according to an embodiment of the present invention. 3 is a diagram illustrating a structure of a B-tree index to which the database management method and system of the present invention are applied. FIG. 4 is a diagram illustrating an arrangement of key values of a general B-tree page. It is a figure which shows the arrangement of the key value of B-tree page according to the database management method and system of this invention.

도 2 내지 도 5를 참조하면, 본 발명의 일 실시예에 따른 데이터베이스 관리 방법은 인덱스를 생성하는 단계(S100 단계), 인덱스에서 레코드를 복원하는 단계(S200 단계) 및 인덱스에서 레코드를 추가/변경하는 단계(S300 단계)를 포함한다. 2 to 5, the method for managing a database according to an embodiment of the present invention includes creating an index (S100), restoring a record from the index (S200), and adding / changing a record from the index. It includes a step (step S300).

이를 더욱 상세히 설명하면 다음과 같다. This will be described in more detail as follows.

인덱스(index)는 데이터베이스 분야에 있어서 테이블에 대한 동작의 속도를 높여주는 자료구조를 일컫는다. 인덱스는 테이블 내의 1개의 컬럼(single coulmn index), 혹은 여러 개의 컬럼(multi coulmn index)을 이용하여 생성될 수 있으며, 고속의 검색 동작뿐만 아니라 레코드 접근과 관련하여 효율적인 순서 매김 동작에 대한 기초를 제공한다. 인덱스를 저장하는 데 필요한 디스크 공간은 보통 테이블을 저장하는 데 필요한 디스크 공간보다 작다. 왜냐하면 보통 인덱스는 키-필드만 갖고 있고, 테이블의 다른 세부 항목들은 갖고 있지 않기 때문이다.An index is a data structure that speeds up operations on a table in the database field. Indexes can be created using a single column or multiple coulmn indexes in a table, providing the basis for efficient ordering operations in relation to record access as well as fast search operations. do. The disk space required to store the index is usually less than the disk space required to store the table. This is because an index usually has only key-fields and no other details of the table.

B 트리(혹은 B+ 트리)는 이와 같은 인덱스를 구성하기 위해 데이터베이스와 파일 시스템에서 널리 사용되는 트리 자료구조의 일종으로, 특정 값을(key) 가지고 있는 레코드를 빠르게 조회하기 위한 연관사상 자료구조이다. B 트리(혹은 B+ 트리)는 억세스(access)가 느린 대용량 디스크에 데이터가 기록되어 있는 특성 때문에, I/O 횟수를 줄이기 위해 페이지 단위의 트리 구조로 되어 있다. 한 페이지 내에는 키(key)와, 이 키를 어트리뷰트(attribute)로서 포함하고 있는 실제 레코드(record)의 위치(Object ID 혹은 Record ID)가 키의 순서대로 기록되어 있다. 즉, {Key - OID}가 결합하여 각각의 인덱스 레코드(이하에서는 이를 레코드라고 칭하도록 한다)를 구성하는 것이다. The B tree (or B + tree) is a tree data structure widely used in databases and file systems to construct such indexes. It is an associative data structure for quickly retrieving records with specific keys. The B tree (or B + tree) has a page structure in order to reduce the number of I / Os because data is recorded on a large disk with slow access. In one page, a key and the position (Object ID or Record ID) of the actual record containing the key as an attribute are recorded in the order of the keys. That is, {Key-OID} combine to form each index record (hereinafter, referred to as a record).

위와 같은 특성으로 인하여, 한 페이지 내의 레코드의 키값들은 인접해 있는 값들끼리 상당한 유사성을 가질 수 있다. 예를 들어 한 회사의 메일 시스템에서 각 메일을 구분하기 위한 인덱스 키로서 사번, 메일폴더번호, 메일일련번호를 지정한 경우(즉, 멀티 컬럼 인덱스), 어느 사원이 전체 메일은 10만 건이고 하나의 메일폴더에 1만 건의 메일을 보관하고 있다면, 인덱스 중에서 1만 건은 사번과 메일폴더번호가 동일한 값이고, 10만 건은 사번이 동일한 값이다. 만일 일반적인 B 트리의 한 페이지에 기존의 방식대로 1천 건씩이 들어간다면, 약 10건의 페이지에서는 사번과 메일폴더번호가 중복해서 매번 저장될 것이다. 따라서, 동일한 값이 여러 번 중복되어 저장됨으로써 불필요한 메모리의 낭비가 발생한다는 문제점이 존재하였다. Due to the above characteristics, the key values of a record in a page can have considerable similarity between adjacent values. For example, if a company's mail system specifies a group number, a mail folder number, and a mail serial number as an index key for distinguishing each mail (that is, a multi-column index), an employee has 100,000 total mails and one If you have 10,000 mails in a mail folder, 10,000 indexes have the same number and the same folder number, and 100,000 records have the same number. If a page of a typical B tree contains 1,000 entries in the conventional way, about 10 pages will store duplicate number and mail folder number each time. Therefore, there is a problem in that unnecessary memory waste occurs because the same value is repeatedly stored several times.

이와 같은 문제점을 해결하기 위하여, 본 발명의 구분자 기반의 인덱스 압축 기법(Serperator-Based Index Compression Method)을 이용한 데이터베이스 관리 방법 및 시스템은, 한 페이지의 키값들 중 중복 저장되는 프리픽스(Prefix)를 페이지 구분자인 LFK(Lower Fence Key)와 UFK(Upper Fence Key)에 저장하여, 메모리 공간을 절약하는 것을 일 특징으로 한다. In order to solve such a problem, the database management method and system using the Separator-Based Index Compression Method according to the present invention, a page delimiter to the prefix (prefix) stored among the key values of one page In other words, it is stored in a lower fence key (LFK) and an upper fence key (UFK), thereby saving memory space.

다시 도 2를 참조하면, 본 발명의 일 실시예에 따른 데이터베이스 관리 방법에서 인덱스를 생성하는 단계(S100 단계)는, 하나의 페이지에 속하는 키값의 하한값이 LFK(lower fence key)로 저장되거나 또는, 하나의 페이지에 속하는 키값의 상한값이 UFK(upper fence key)로 저장되는 단계(S110 단계), 하나의 페이지를 이루는 다수 개의 레코드의 키값 중 공통 영역이 프리픽스(prefix)로 추출되는 단계(S120 단계) 및 하나의 페이지를 이루는 다수 개의 레코드의 키값에서 공통 영역인 프리픽스(prefix)가 삭제된 후 저장되는 단계(S130 단계)를 포함한다. Referring back to FIG. 2, in the step of generating an index in the database management method according to an embodiment of the present invention (step S100), a lower limit value of a key value belonging to one page is stored as a lower fence key (LFK), or The upper limit value of a key value belonging to one page is stored as an upper fence key (UFK) (step S110), and the common area among key values of a plurality of records constituting one page is extracted as a prefix (step S120). And a step in which a prefix, which is a common area, is deleted from key values of a plurality of records constituting one page, and then stored (step S130).

이를 이해하기 쉽게 설명하면 다음과 같다. If this is explained easily, it is as follows.

본 발명이 적용된 B 트리 인덱스의 구조를 도시한 도 3을 참조하면, 데이터베이스에서 레코드 데이터를 빠르게 검색하기 위해서 사용되는 인덱스에 있어서, 본 발명에서 사용하는 B 트리 인덱스의 구성은 실제 레코드 데이터를 가리키는 리프 노드(leaf node)들과 그 상위의 중간 노드들로 이루어진다. 루트 노드는 중간 노드들 중에서 최상위에 존재하는 하나의 노드이다. 도 3에는 네 개의 리프 노드와 한 개의 중간 노드가 존재하고, 그 하나의 중간 노드가 곧 루트 노드가 된다. 이때, 각각의 리프 노드는 곧 각각의 페이지를 구성한다. 즉 도 3에 도시된 네 개의 리프 노드는 네 개의 페이지를 구성하는 것이다. Referring to FIG. 3 showing the structure of the B-tree index to which the present invention is applied, in the index used for quickly retrieving record data from a database, the structure of the B-tree index used in the present invention is a leaf indicating actual record data. It consists of nodes and leaf nodes. The root node is one node at the top of the intermediate nodes. In FIG. 3, there are four leaf nodes and one intermediate node, and one intermediate node becomes the root node. At this time, each leaf node constitutes each page. That is, the four leaf nodes shown in FIG. 3 constitute four pages.

여기서, 도 3에 도시된 B 트리 인덱스의 루트 노드는 세 개의 구분키값(P1, P2, P3)을 갖는다. 제1 구분키값(P1)은 페이지 1과 페이지 2를 구분하는 구분자가 되며, 제2 구분키값(P2)은 페이지 2와 페이지 3을 구분하는 구분자가 되며, 제3 구분키값(P3)은 페이지 3과 페이지 4를 구분하는 구분자가 된다. Here, the root node of the B-tree index shown in FIG. 3 has three partition key values P1, P2, and P3. The first separator key value P1 becomes a separator for separating page 1 and page 2, the second separator key value P2 becomes a separator for separating pages 2 and page 3, and the third separator key value P3 is page 3 It is a delimiter between page 4 and.

이와 같이, 본 발명의 일 실시예에 따른 데이터베이스 관리 방법은 각각의 페이지에 속하는 키값의 하한값을 LFK(lower fence key)로 저장하고, 또한 각각의 페이지에 속하는 키값의 상한값을 UFK(upper fence key)로 저장하는 것을 특징으로 한다. 이때, LFK(lower fence key)는 도면에서 보았을 때 각 페이지의 좌단부에 저장되어 해당 페이지의 하한값을 정의하고, UFK(upper fence key)는 도면에서 보았을 때 각 페이지의 우단부에 저장되어 해당 페이지의 상한값을 정의하는 것이다. As described above, the database management method according to an exemplary embodiment of the present invention stores the lower limit of the key value belonging to each page as a lower fence key (LFK), and also stores the upper limit of the key value belonging to each page as an UFK (upper fence key). It is characterized by storing as. In this case, the lower fence key (LFK) is stored at the left end of each page when viewed in the drawing to define the lower limit of the page. The upper fence key (UFK) is stored at the right end of each page when viewed in the drawing. Is to define the upper limit of.

그리고, 본 발명의 일 실시예에 따른 데이터베이스 관리 방법은 각 페이지에서 LFK(lower fence key)와 UFK(upper fence key) 사이에 존재하는 다수개의 레코드의 키값 중 공통 영역을 프리픽스(prefix)로 추출하고, LFK(lower fence key)와 UFK(upper fence key)를 제외한 나머지 레코드에서는 키값에서 프리픽스를 삭제한 후, 나머지 키값만을 저장함으로써, 데이터의 중복 저장을 방지하여 메모리 공간을 절약한다. The database management method according to an embodiment of the present invention extracts a common area as a prefix among key values of a plurality of records existing between a lower fence key (LFK) and an upper fence key (UFK) on each page. In other records except the lower fence key (LFK) and the upper fence key (UFK), the prefix is deleted from the key value, and only the remaining key value is saved, thereby saving memory space by preventing duplicate data storage.

즉, 제1 구분키값(P1)은 페이지 1의 UFK(UFK1)이 되는 동시에 페이지 2의 LFK(LFK2)가 된다. 마찬가지로, 제2 구분키값(P2)은 페이지 2의 UFK(UFK2)이 되는 동시에 페이지 3의 LFK(LFK3)가 된다. 마찬가지로, 제3 구분키값(P3)은 페이지 3의 UFK(UFK3)이 되는 동시에 페이지 4의 LFK(LFK4)가 된다. 이때 다수 개의 리프 노드 중 가장 왼쪽에 위치한 극좌측 리프 노드(페이지 1)에는 LFK(lower fence key)를 설정할 수 없으며, 따라서 해당 페이지에서는 프리픽스 추출도 할 수 없다. 마찬가지로 가장 오른쪽에 위치한 극우측 리프 노드(페이지 4)에는 UFK(upper fence key)를 설정할 수 없으며, 따라서 해당 페이지에서는 프리픽스 추출도 할 수 없다. In other words, the first division key value P1 becomes UFK (UFK1) on page 1 and LFK (LFK2) on page 2. Similarly, the second division key value P2 becomes UFK (UFK2) on page 2 and LFK (LFK3) on page 3. Similarly, the third division key value P3 becomes UFK (UFK3) on page 3 and LFK (LFK4) on page 4. At this time, the leftmost leaf node (page 1) located on the far left of the leaf nodes cannot set the lower fence key (LFK), and therefore, the prefix extraction cannot be performed on the page. Likewise, you can't set the upper fence key (UFK) on the far right leaf node (page 4), so you can't extract the prefix from that page.

이를 더욱 상세히 설명하기 위해, 일반적인 B 트리 페이지의 키값의 배열을 나타내는 도 4와, 본 발명의 데이터베이스 관리 방법 및 시스템에 따른 B 트리 페이지의 키값의 배열을 나타내는 도 5를 비교한다. 도 4 및 도 5에서는 설명을 위해 10개의 레코드만 있는 경우를 상정했다. To illustrate this in more detail, FIG. 4 shows an arrangement of key values of a general B tree page and FIG. 5 shows an arrangement of key values of a B tree page according to a database management method and system of the present invention. In FIG. 4 and FIG. 5, it is assumed that there are only 10 records for explanation.

도 4를 참조하면, 하나의 페이지를 구성하는 열 개의 레코드에서 사번(KR10000)과 메일폴더번호(FD0001)로 동일한 값이 중복되어 10번 저장된다. 이에 반해 도 5를 참조하면, 본 발명의 데이터베이스 관리 방법에 따를 경우, 하나의 페이지의 키값들 중 중복 저장되는 사번(KR10000)과 메일폴더번호(FD0001)는 해당 페이지의 하한값을 설정하는 LFK(Lower Fence Key)와 해당 페이지의 상한값을 설정하는 UFK(Upper Fence Key)에만 저장되며, LFK와 UFK 사이의 일반 레코드에는 프리픽스(Prefix)가 삭제된 상태의 키값만이 저장된다. 즉, 도 5와 같이 열 개의 레코드에 공통되는 키값인 사번(KR10000)과 메일폴더번호(FD0001)는 모두 삭제되고, 유니크한 키값인 메일일련번호만이 각 레코드에 저장되는 것이다.
Referring to FIG. 4, the same value is duplicated and stored ten times in the ten records constituting one page with the number KR10000 and the mail folder number FD0001. On the contrary, referring to FIG. 5, according to the database management method of the present invention, the number (KR10000) and the mail folder number (FD0001), which are duplicated and stored among the key values of one page, set the lower limit value of the corresponding page. It is stored only in UFK (Upper Fence Key) which sets the Fence Key) and the upper limit of the page. Only the key value with the prefix deleted is stored in the general record between LFK and UFK. That is, as shown in FIG. 5, all of the key number KR10000 and the mail folder number FD0001 which are common to ten records are deleted, and only the mail serial number which is a unique key value is stored in each record.

이하에서는 본 발명의 일 실시예에 따른 데이터베이스 관리 방법에서 레코드를 복원하는 단계에 대해 설명하도록 한다. 다시 도 2 및 도 5를 참조하면, 본 발명의 일 실시예에 따른 데이터베이스 관리 방법에서 레코드를 복원하는 단계(S200 단계)는, 해당 페이지에 LFK와 UFK가 존재하는지 여부를 확인하는 단계(S210 단계), 해당 페이지에 LFK와 UFK가 존재할 경우, LFK와 UFK를 비교 연산하여 프리픽스를 추출하는 단계(S220 단계) 및 프리픽스와 해당 레코드의 값이 결합하여 원본키값이 복원되는 단계(S230 단계)를 포함한다. 이를 더욱 상세히 설명하면 다음과 같다. Hereinafter, a description will be given of the step of restoring a record in the database management method according to an embodiment of the present invention. 2 and 5 again, the step of restoring a record in the method of managing a database according to an embodiment of the present invention (step S200) may include checking whether LFK and UFK exist on a corresponding page (step S210). ), If LFK and UFK exist on the page, extracting the prefix by comparing LFK and UFK (step S220) and restoring the original key value by combining the prefix and the value of the corresponding record (step S230). do. This will be described in more detail as follows.

먼저, 복원하고자 하는 키값이 속한 페이지가 어느 페이지인지를 바이너리 탐색에 의해 찾은 후, 해당 페이지에 LFK와 UFK가 존재하는지 여부를 확인한다. 해당 페이지에 LFK와 UFK 둘 중 하나라도 존재하지 않을 경우, 해당 페이지는 압축(즉, 프리픽스를 이용한 중복 데이터 삭제)이 수행되지 아니하였으므로, 각각의 레코드에 저장되어 있는 키값이 바로 원본키값이다(S240 단계). 한편, 해당 페이지에 LFK와 UFK가 모두 존재할 경우, 해당 페이지는 프리픽스를 이용한 데이터 압축이 수행된 페이지이므로, 소정의 복원 루틴을 실행한다. 즉, 페이지의 하한값인 LFK와 페이지의 상한값인 UFK를 비교하여, LFK와 UFK의 공통 영역, 즉 프리픽스를 추출한다. 도 5의 예에서는 LFK와 UFK의 공통 영역인 KR10000:FD0001이 프리픽스로써 추출될 것이다. 이와 같이 추출된 프리픽스와, 각 레코드에 저장되어 있는 키값을 결합하여 원본키값이 복원된다. 즉, SN10001을 복원한 원본키값은 KR10000:FD0001:SN10001 이 되는 것이다.
First, find out which page the page to which the key value to restore belongs belongs by binary search, and then check whether the LFK and UFK exist in the page. If either LFK or UFK does not exist on the page, the page is not compressed (i.e., duplicate data deletion using a prefix), so the key value stored in each record is the original key value (S240). step). On the other hand, if both LFK and UFK exist on the page, the page is a page on which data compression is performed using a prefix, and thus a predetermined restoration routine is executed. That is, LFK, which is the lower limit of the page, and UFK, which is the upper limit of the page, are compared to extract a common area, that is, a prefix, between the LFK and the UFK. In the example of FIG. 5, KR10000: FD0001, which is a common region of LFK and UFK, will be extracted as a prefix. The original key value is restored by combining the extracted prefix and the key value stored in each record. That is, the original key value which restored SN10001 is KR10000: FD0001: SN10001.

이하에서는 본 발명의 일 실시예에 따른 데이터베이스 관리 방법에서 레코드를 추가 또는 변경하는 단계에 대해 설명하도록 한다. 다시 도 2 및 도 5를 참조하면, 본 발명의 일 실시예에 따른 데이터베이스 관리 방법에서 레코드를 추가 또는 변경하는 단계(S300 단계)는, 해당 페이지에 LFK와 UFK가 존재하는지 여부를 확인하는 단계(S310 단계), 해당 페이지에 LFK와 UFK가 존재할 경우, LFK와 UFK를 비교 연산하여 프리픽스를 추출하는 단계(S320 단계) 및 추가 또는 변경될 레코드에서 프리픽스가 제외된 나머지 데이터가 해당 페이지에 레코드로 추가 또는 변경되는 단계(S330 단계)를 포함한다. 이를 더욱 상세히 설명하면 다음과 같다. Hereinafter, a step of adding or changing a record in a database management method according to an embodiment of the present invention will be described. 2 and 5 again, in the step of adding or changing a record in the method of managing a database according to an embodiment of the present invention (step S300), a step of checking whether LFK and UFK exist in a corresponding page ( Step S310), if LFK and UFK exist on the page, extracting the prefix by comparing LFK and UFK (step S320), and the remaining data excluding the prefix from the record to be added or changed are added to the page as a record. Or change (step S330). This will be described in more detail as follows.

먼저, 추가 또는 변경하고자 하는 키값이 속한 페이지가 어느 페이지인지를 바이너리 탐색에 의해 찾은 후, 해당 페이지에 LFK와 UFK가 존재하는지 여부를 확인한다. 해당 페이지에 LFK와 UFK 둘 중 하나라도 존재하지 않을 경우, 해당 페이지는 압축(즉, 프리픽스를 이용한 중복 데이터 삭제)이 수행되지 아니하였으므로, 해당 레코드의 값을 별도의 처리 없이 바로 추가 또는 변경하면 된다(S340 단계). 한편, 해당 페이지에 LFK와 UFK가 모두 존재할 경우, 해당 페이지는 프리픽스를 이용한 데이터 압축이 수행된 페이지이므로, 소정의 분해 루틴을 실행한다. 즉, 페이지의 하한값인 LFK와 페이지의 상한값인 UFK를 비교하여, LFK와 UFK의 공통 영역, 즉 프리픽스를 추출한다. 도 5의 예에서는 LFK와 UFK의 공통 영역인 KR10000:FD0001이 프리픽스로써 추출될 것이다. 다음으로, 추가 또는 변경할 레코드의 키값에서 프리픽스를 제외한 나머지 키값만이 페이지의 해당 위치에 추가 또는 변경되는 것이다. 예를 들어, 추가되는 키값이 KR10000:FD0001:SN13000 이라면 프리픽스는 KR10000:FD0001 이 되며, 따라서 해당 페이지에는 키값으로 프리픽스를 제외한 SN13000 만이 추가되는 것이다.
First, find out which page the key value to which you want to add or change belongs by binary search, and then check whether LFK and UFK exist in the page. If either LFK or UFK does not exist on the page, the page has not been compressed (i.e. duplicate data deletion using a prefix), so the value of the record can be added or changed immediately without further processing. (Step S340). On the other hand, if both LFK and UFK exist on the page, since the page is a page on which data compression is performed using a prefix, a predetermined decomposition routine is executed. That is, LFK, which is the lower limit of the page, and UFK, which is the upper limit of the page, are compared to extract a common area, that is, a prefix, between the LFK and the UFK. In the example of FIG. 5, KR10000: FD0001, which is a common region of LFK and UFK, will be extracted as a prefix. Next, only key values other than the prefix in the key value of the record to be added or changed are added or changed at the corresponding position on the page. For example, if the added key value is KR10000: FD0001: SN13000, the prefix is KR10000: FD0001, so that only SN13000 is added to the page without the prefix.

이하에서는 본 발명의 일 실시예에 따른 데이터베이스 관리 방법에서 페이지가 분할 또는 병합되는 과정에 대해 설명하도록 한다. Hereinafter, a process of splitting or merging pages in a database management method according to an embodiment of the present invention will be described.

도 6a 및 도 6b는 본 발명의 데이터베이스 관리 방법 및 시스템이 적용되는 B 트리 인덱스에서 페이지가 분할되는 과정을 나타내는 도면이다. 6A and 6B illustrate a process of dividing a page in a B-tree index to which the method and system for managing a database of the present invention are applied.

도 6a에 도시된 B 트리 인덱스의 루트 노드는 처음에는 두 개의 구분키값(P1, P2)을 갖는다. 제1 구분키값(P1)은 페이지 1과 페이지 2를 구분하는 구분자가 되며, 제2 구분키값(P2)은 페이지 2와 페이지 3을 구분하는 구분자가 된다. 그리고, 제1 구분키값(P1)은 페이지 1의 UFK(UFK1)이 되는 동시에 페이지 2의 LFK(LFK2)가 된다. 마찬가지로, 제2 구분키값(P2)은 페이지 2의 UFK(UFK2)이 되는 동시에 페이지 3의 LFK(LFK3)가 된다. The root node of the B-tree index shown in FIG. 6A initially has two distinct key values P1 and P2. The first division key value P1 is a delimiter for dividing page 1 and page 2, and the second division key value P2 is a delimiter for dividing page 2 and page 3. Then, the first division key value P1 becomes UFK (UFK1) on page 1 and LFK (LFK2) on page 2. Similarly, the second division key value P2 becomes UFK (UFK2) on page 2 and LFK (LFK3) on page 3.

이 상태에서, 페이지 2에 더 이상 저장 공간이 없게 되어 제1 구분키값(P1)과 제2 구분키값(P2) 사이의 임의의 값인 S를 기준으로 페이지 2를 분할하여야 한다고 가정한다. In this state, it is assumed that there is no more storage space on page 2, so that page 2 should be divided based on S, which is an arbitrary value between the first division key value P1 and the second division key value P2.

이 경우, 페이지 2에서는 도 6b에 도시된 바와 같이 복원된 S를 새로운 UFK(UFK2)로 저장한다. 그리고, 기존에 존재하던 LFK(LFK2)와 새롭게 생성된 UFK(UFK2)를 이용하여 다시 데이터를 압축한다. 즉, LFK2와 UFK2를 비교 연산하여 프리픽스를 추출한 후, LFK2와 UFK2를 제외한 나머지 레코드에서는 키값에서 프리픽스를 삭제한 후, 나머지 키값만을 저장하는 것이다. In this case, page 2 stores the reconstructed S as a new UFK (UFK2) as shown in FIG. 6B. Then, the data is compressed again using the existing LFK (LFK2) and the newly generated UFK (UFK2). That is, after extracting the prefix by comparing and calculating LFK2 and UFK2, the remaining records except for LFK2 and UFK2 are deleted from the key value and only the remaining key value is stored.

한편, 새롭게 생성된 도 6b의 페이지 3에서는 S를 새로운 LFK(LFK3)로 저장한다. 그리고, 도 6a의 페이지 2의 UFK(UFK2)가 도 6b의 페이지 3의 UFK(UFK3)로 저장된다. 그리고, LFK3와 UFK3를 이용하여 다시 데이터를 압축한다. 즉, LFK3와 UFK3를 비교 연산하여 프리픽스를 추출한 후, LFK3와 UFK3를 제외한 나머지 레코드에서는 키값에서 프리픽스를 삭제한 후, 나머지 키값만을 저장하는 것이다. On the other hand, newly created page 3 of FIG. 6B stores S as a new LFK (LFK3). Then, UFK (UFK2) of page 2 of FIG. 6A is stored as UFK (UFK3) of page 3 of FIG. 6B. Then, data is compressed again using LFK3 and UFK3. In other words, after extracting the prefix by comparing and calculating LFK3 and UFK3, the remaining records except the LFK3 and UFK3 are deleted from the key value and only the remaining key value is stored.

마지막으로, 도 6b의 페이지 3에서는 S를 새로운 구분키값으로 부모 노드(여기서는, 루트 노드)의 제1 구분키값(P1)과 제2 구분키값(P2) 사이에 삽입하게 된다. Finally, in page 3 of FIG. 6B, S is inserted as a new division key value between the first division key value P1 and the second division key value P2 of the parent node (here, the root node).

한편, 도면에는 도시되지 않았지만, 압축되지 않은 페이지(즉, 프리픽스를 이용한 중복 데이터 삭제가 수행되지 않은 페이지)라면, 새로운 구분키값(S)을 기준으로 페이지 분할 시, 기존의 페이지에는 새로운 구분키값(S)이 UFK로 설정되어, 기존에 존재하던 LFK와 새롭게 생성된 UFK를 이용하여 새롭게 데이터를 압축할 수 있다. 한편, 새로 생성된 페이지에는 새로운 구분키값(S)이 LFK로 설정되지만, UFK가 설정되지 않았기 때문에, 데이터 압축이 수행되지 아니할 것이다. On the other hand, although not shown in the drawing, if the page is not compressed (i.e., a page in which duplicate data deletion is not performed using the prefix), when the page is divided based on the new separator key value S, a new separator key value is added to the existing page. S) is set to UFK, and data can be newly compressed using the existing LFK and the newly generated UFK. On the other hand, in the newly created page, the new separator key value S is set to LFK, but since UFK is not set, data compression will not be performed.

또한, 도면에는 도시되지 않았지만, 서로 이웃한 두 개의 페이지가 병합 가능한(mergeable) 크기일 때(즉, 두 개의 페이지에 저장된 레코드 개수의 합이 하나의 페이지에 저장될 수 있는 레코드 개수의 최대값 이하일 경우)에는, 두 개의 페이지를 병합하는 것도 가능할 것이다. 이때 두 개의 페이지가 모두 압축된 페이지(즉, 프리픽스를 이용하여 중복 데이터가 삭제된 페이지)라면, 두 페이지의 병합 이후 새롭게 압축을 수행한다. 반면, 두 개의 페이지 중 하나라도 압축된 페이지가 아닐 경우에는 병합을 수행하지 않게 된다.
Also, although not shown in the drawing, when two neighboring pages are of a mergeable size (that is, the sum of the number of records stored in two pages is less than or equal to the maximum number of records that can be stored in one page). In this case, it may be possible to merge the two pages. In this case, if both pages are compressed pages (that is, pages in which duplicate data is deleted using a prefix), compression is newly performed after merging two pages. On the other hand, if any one of the two pages is not a compressed page, merging is not performed.

표 1은 일반적인 데이터베이스 관리 방법 및 시스템을 적용하였을 경우의 총 인덱스 페이지의 개수(total page count)와, 본 발명의 일 실시예에 따른 데이터베이스 관리 방법 및 시스템을 적용하였을 경우의 총 인덱스 페이지의 개수를 비교한 표이다. 그리고, 표 2는 일반적인 데이터베이스 관리 방법 및 시스템을 적용하였을 경우의 평균 키값의 길이(average key length)와, 본 발명의 일 실시예에 따른 데이터베이스 관리 방법 및 시스템을 적용하였을 경우의 평균 키값의 길이를 비교한 표이다. Table 1 shows the total number of index pages when a general database management method and system are applied, and the total number of index pages when a database management method and system is applied according to an embodiment of the present invention. This is a comparison table. Table 2 shows average key lengths when a general database management method and system are applied and average key values when a database management method and system according to an embodiment of the present invention are applied. This is a comparison table.

인덱스 이름Index name 기존
총 인덱스 페이지 개수
existing
Total number of index pages
본원발명 적용시
인덱스 페이지
개수 감소 비율(%)
When applying the present invention
Index page
% Reduction
PK(primary key)Primary key (PK) 4,120,6354,120,635 2121 Index 1Index 1 5,740,1915,740,191 2323 Index 2Index 2 6,056,6216,056,621 1818 Index 3Index 3 6,849,0436,849,043 1919 Index 4Index 4 5,793,0815,793,081 1515

인덱스 이름Index name 기존
평균 키값 길이(bytes)
existing
Average key value length (bytes)
본원발명 적용시
평균 키값 길이
감소 비율(%)
When applying the present invention
Average key value length
% Reduction
PK(primary key)Primary key (PK) 1818 3939 Index 1Index 1 3030 3333 Index 2Index 2 3232 2828 Index 3Index 3 3838 2929 Index 4Index 4 3030 2727

표 1 및 표 2에 나타난 바와 같이, 종래의 데이터베이스 관리 방법 및 시스템을 적용하였을 경우에 비해 본 발명의 일 실시예에 따른 데이터베이스 관리 방법 및 시스템을 적용하였을 경우, 총 인덱스 페이지 개수는 약 19% 감소하였으며, 평균 키값 길이는 약 31% 감소하였다. 즉, 본 발명에 의해 저장 공간을 절약할 수 있으며, 이에 따라 데이터베이스의 성능이 향상되는 효과를 얻을 수 있음을 알 수 있다. As shown in Table 1 and Table 2, when the database management method and system according to an embodiment of the present invention is applied, the total number of index pages is reduced by about 19% compared with the conventional database management method and system. The average height was reduced by about 31%. That is, the present invention can save the storage space, it can be seen that the performance of the database can be improved accordingly.

이와 같은 본 발명의 일 실시예에 따른 데이터베이스 관리 방법은 B 트리의 한 페이지 내에서 해당 페이지의 구분자로 사용된 키값을 {가상의 키-OID} 레코드로 하여 해당 페이지의 양단에 펜스 키(LFK 및 UFK)로 각각 추가함으로써, LFK 및 UFK로부터 원본키값의 조합 및 원본키값에서 프리픽스를 삭제하는 분해작업을 빠르게 수행할 수 있다. The database management method according to an exemplary embodiment of the present invention has a fence key (LFK and LFK) at both ends of a page using a key value used as a separator of the page within a page of the B tree as a {virtual key-OID} record. UFK), respectively, can quickly perform a decomposition operation of combining the original key value from the LFK and the UFK and deleting the prefix from the original key value.

한편, 해당 페이지에 LFK 또는 UFK가 존재하지 않으면 기존의 방식으로 레코드를 저장할 수 있으며, 따라서 압축된 페이지(즉, 프리픽스가 각 레코드에서 삭제된 페이지)와 압축되지 않은 페이지(즉, 프리픽스가 각 레코드에서 삭제되지 않은 페이지)가 혼재하여 유지될 수 있다. 또한 LFK 및 UFK가 존재하는 페이지 내에서도 압축된 레코드와 압축되지 않은 레코드가 혼재하여 유지될 수 있다. 따라서, B 트리의 현재 상태와 무관하게 실시간(run-time)으로 압축 여부를 동적으로 설정하는 것이 가능해지는 효과를 얻을 수 있다. 그리고, 이와 같은 특징을 이용하여, 특정 영역에 삽입/삭제(insert/delete) 부하가 높아지면 압축을 수행하지 않도록 조정하여 데이터베이스 운영의 효율성을 향상시킬 수 있다. On the other hand, if there is no LFK or UFK on that page, you can store records in the traditional way, so that compressed pages (that is, pages whose prefixes have been deleted from each record) and uncompressed pages (that is, each record has a prefix) Pages not deleted) may be mixed. In addition, compressed and uncompressed records may be mixed in a page in which LFK and UFK exist. Therefore, it is possible to dynamically set whether or not to compress in real time (run-time) regardless of the current state of the B-tree. In addition, by using such a feature, when an insert / delete load is increased in a specific region, compression may be adjusted so as to improve efficiency of database operation.

한편, 프리픽스를 이용한 압축 여부를 LFK 및 UFK를 사용하여 결정하기 때문에, 부차적인 압축방식 및 범위에 대한 메타데이터를 추가로 기록할 필요가 없다. 따라서, 페이지에 저장되는 레코드의 개수가 많아질수록, 압축되는 레코드에 메타 정보를 포함하는 기존의 방법에 비해서 압축 효율이 극대화되는 장점이 있다.On the other hand, since it is determined whether the compression using the prefix using LFK and UFK, it is not necessary to additionally record metadata about the secondary compression scheme and range. Therefore, as the number of records stored in the page increases, the compression efficiency is maximized as compared with the conventional method of including meta information in the compressed record.

이와 같은 본 발명에 의해서, 기존에 비해 프리픽스를 제외한 키값만을 저장하기 때문에 B 트리의 한 페이지에 더 많은 레코드를 저장할 수 있다. 이로 인해 저장 공간을 절약할 수 있으며, 이렇게 작아진 공간만큼 주메모리의 버퍼 캐쉬에 포함될 가능성이 커져 데이터베이스의 성능이 향상되는 효과를 얻을 수 있다. 나아가 본 발명의 일 실시예에 따른 데이터베이스 관리 방법은 기존의 다른 압축 방식에 비해서 분할, 및 복원이 간단하고, 저장구조의 변경이 없어 하위 호환성 측면에서 유리하며, LFK 및 UFK를 나타내는 플래그만 하나만 추가될 뿐 추가로 기록되는 메타데이터도 없어 구조적으로 단순하다는 장점을 가진다. According to the present invention, since only the key value excluding the prefix is stored, more records can be stored in one page of the B tree. This saves storage space and increases the performance of the database by increasing the possibility of being included in the buffer cache of main memory. Furthermore, the database management method according to an embodiment of the present invention is simpler in partitioning and restoring than other compression methods, and is advantageous in terms of backward compatibility because there is no change in storage structure, and only one flag indicating LFK and UFK is added. It has the advantage of being structurally simple because there is no additional recorded metadata.

나아가, 본 발명의 데이터베이스 관리 방법을 이용하면, 인덱스의 트리 구조를 순회(Traverse)할 때마다 각 페이지의 LFK 및 UFK를 이용하여 리프 노드의 유효성 검사(validity check)를 수행할 수 있어, 인덱스 구조의 오류를 손쉽게 체크하는 효과를 얻을 수 있다. 또한, LFK 및 UFK에 의해 리프 노드의 연결 관계를 파악할 수 있게 되므로, 리프 노드에서 링크를 제거할 수 있게 되며, 따라서 SMO(Structure Modification Operation) 시의 성능 및 효율을 향상시키는 효과를 얻을 수 있다. Furthermore, using the database management method of the present invention, each time the traversal of the tree structure of the index can be performed, the validity check of the leaf node can be performed by using the LFK and UFK of each page. You can easily check the error of. In addition, since the connection relationship between the leaf nodes can be determined by the LFK and the UFK, the link can be removed from the leaf nodes, thereby improving the performance and efficiency of the structure modification operation (SMO).

상술한 데이터베이스 관리 방법은 다양한 컴퓨터 수단을 이용하여 수행될 수 있는 프로그램 형태로도 구현될 수 있는데, 이때 데이터베이스 관리 방법을 수행하기 위한 프로그램은 하드 디스크, CD-ROM, DVD, 롬(ROM), 램, 또는 플래시 메모리와 같은 컴퓨터로 판독할 수 있는 기록 매체에 저장된다.The above-described database management method may be implemented in the form of a program that can be executed using various computer means. In this case, the program for performing the database management method may be a hard disk, a CD-ROM, a DVD, a ROM, or a RAM. Or a computer-readable recording medium such as a flash memory.

본 명세서에서는 본 발명을 한정된 실시예를 중심으로 설명하였으나, 본 발명의 범위 내에서 다양한 실시예가 가능하다. 또한 설명되지는 않았으나, 균등한 수단도 또한 본 발명에 그대로 결합되는 것이라 할 것이다. 따라서 본 발명의 진정한 보호범위는 아래의 특허청구범위에 의하여 정해져야 할 것이다.In the present specification, the present invention has been described with reference to limited embodiments, but various embodiments are possible within the scope of the present invention. In addition, although not described, equivalent means will also be referred to as incorporated in the present invention. Therefore, the true scope of the present invention will be defined by the claims below.

100: 데이터베이스 관리 시스템
110: 데이터베이스
120: 질의문 분석부
130: 실행계획 생성부
140: 실행계획 실행부
150: 엔트리 관리부
160: 인덱스 관리부
161: 인덱스 생성부
163: 레코드 복원부
165: 레코드 업데이트부
100: database management system
110: database
120: query analysis unit
130: execution plan generation unit
140: execution plan execution unit
150: entry management unit
160: index management unit
161: index generator
163: record restore unit
165: record update unit

Claims (15)

각 페이지에 포함되는 다수 개의 레코드의 키값의 하한값이 LFK(lower fence key)로 저장되거나 또는, 레코드의 키값의 상한값이 UFK(upper fence key)로 저장되는 단계;
상기 페이지를 이루는 다수 개의 레코드의 키값 중 공통 영역이 프리픽스(prefix)로 추출되는 단계; 및
상기 다수 개의 레코드의 키값에서 상기 프리픽스(prefix)에 해당하는 부분을 제외한 나머지 부분이 저장되는 단계;를 포함하고,
상기 LFK와 상기 UFK는 상기 프리픽스를 포함하는 원본키값이고,

상기 페이지에 새로운 레코드가 추가되거나 기 존재하는 레코드가 변경되는 단계를 더 포함하고,
상기 레코드가 추가되거나 변경되는 단계는,
해당 페이지에 상기 LFK와 UFK가 존재하는지 여부가 확인되는 단계;
해당 페이지에 상기 LFK와 UFK가 존재할 경우, 상기 LFK와 UFK를 비교 연산하여 이에 공통되는 프리픽스가 추출되는 단계; 및
추가 또는 변경될 레코드에서 상기 프리픽스가 제외된 나머지 키값이 레코드로 추가 또는 변경되는 단계;를 포함하는 데이터베이스 관리 방법.
Storing a lower limit of key values of a plurality of records included in each page as a lower fence key (LFK), or storing an upper limit of a key value of a record as an upper fence key (UFK);
Extracting a common area among key values of a plurality of records constituting the page as a prefix; And
And storing portions other than portions corresponding to the prefix in key values of the plurality of records.
The LFK and the UFK are original key values including the prefix,

Adding new records to the page or changing existing records;
The step of adding or changing the record,
Checking whether the LFK and the UFK exist on a corresponding page;
If the LFK and the UFK exist on the page, comparing the LFK and the UFK and extracting a common prefix thereof; And
And adding or changing the remaining key values excluding the prefix from the record to be added or changed to the record.
삭제delete 제 1 항에 있어서,
상기 다수 개의 레코드 중 LFK(lower fence key) 또는 UFK(upper fence key)가 저장되는 레코드 이외의 레코드에는, 각 레코드의 원본키값 중 상기 프리픽스를 제외한 키값들이 저장되는 것을 특징으로 하는 데이터베이스 관리 방법.
The method of claim 1,
And a key value excluding the prefix among the original key values of each record is stored in a record other than a record in which a lower fence key (LFK) or an upper fence key (UFK) is stored among the plurality of records.
제 1 항에 있어서,
상기 레코드는 다수 개의 키값을 포함하는 멀티 칼럼(multi column) 형태의 레코드인 것을 특징으로 하는 데이터베이스 관리 방법.
The method of claim 1,
And the record is a multi-column type record including a plurality of key values.
삭제delete 삭제delete 삭제delete 제 1 항에 있어서,
해당 페이지에 상기 LFK와 UFK가 존재하지 않을 경우,
상기 프리픽스가 추출되지 아니하고, 해당 페이지에 레코드가 추가 또는 변경되는 것을 특징으로 하는 데이터베이스 관리 방법.
The method of claim 1,
If the LFK and UFK do not exist on the page,
And the record is added or changed in the corresponding page without the prefix being extracted.
제 1 항, 제 3 항, 제 4 항 및 제 8 항 중 어느 하나의 항에 기재된 방법을 수행하기 위한 프로그램이 기록된 기록매체.A recording medium having recorded thereon a program for performing the method according to any one of claims 1, 3, 4 and 8. 특정 테이블에 포함된 레코드의 인출요청 및 상기 레코드에 포함된 적어도 하나의 칼럼에 대한 갱신요청이 함께 정의된 질의문을 수신하여 분석하는 질의문 분석부;
상기 분석된 질의문을 수행하기 위한 실행계획을 생성하는 실행계획 생성부;
상기 실행계획에 따라 상기 레코드의 인출 및 상기 적어도 하나의 칼럼에 대한 갱신을 수행함으로써 상기 실행계획을 실행하는 실행계획 실행부; 및
특정 테이블에 대한 인덱스를 생성하며, 상기 인덱스의 각 페이지에 속하는 다수 개의 레코드의 키값의 하한값을 LFK(lower fence key)로 저장하거나 또는, 레코드의 키값의 상한값을 UFK(upper fence key)로 저장하고, 상기 각 페이지를 이루는 다수 개의 레코드의 키값 중 공통 영역을 프리픽스(prefix)로써 추출하는 인덱스 생성부를 포함하는 인덱스 관리부;를 포함하고,
상기 LFK와 상기 UFK는 상기 프리픽스를 포함하는 원본키값이고,
상기 인덱스 관리부는,
상기 인덱스의 각 페이지에 새로운 레코드를 추가하거나 기 존재하는 레코드를 변경하는 레코드 업데이트부를 더 포함하고,
상기 레코드 업데이트부는,
해당 페이지에 상기 LFK와 UFK가 존재하는지 여부를 확인하고, 해당 페이지에 상기 LFK와 UFK가 존재할 경우 LFK와 UFK를 비교 연산하여 상기 프리픽스를 추출하며, 추가 또는 변경될 레코드에서 상기 프리픽스가 제외된 나머지 데이터를 해당 페이지에 레코드로 추가 또는 변경하는 것을 특징으로 하는 데이터베이스 관리 시스템.
A query analysis unit configured to receive and analyze a query statement including a drawing request of a record included in a specific table and an update request for at least one column included in the record;
An execution plan generator for generating an execution plan for executing the analyzed query statement;
An execution plan execution unit that executes the execution plan by performing withdrawal of the record and updating the at least one column according to the execution plan; And
Create an index for a specific table, and store the lower limit of the key value of a plurality of records belonging to each page of the index as a lower fence key (LFK), or store the upper limit of a key value of a record as an UFK (upper fence key). And an index manager including an index generator for extracting a common area as a prefix among key values of a plurality of records constituting each page.
The LFK and the UFK are original key values including the prefix,
The index management unit,
The apparatus may further include a record updating unit for adding a new record to each page of the index or changing an existing record.
The record update unit,
Check whether the LFK and UFK exist in the page, and if the LFK and UFK exist in the page, compare the LFK and UFK to extract the prefix, and remove the prefix from the record to be added or changed. A database management system for adding or changing data as records on a corresponding page.
제 10 항에 있어서,
상기 인덱스 생성부는, 상기 각 페이지를 이루는 다수 개의 레코드의 키값에서 공통 영역인 상기 프리픽스(prefix)에 해당하는 부분을 제외한 나머지 부분을 인덱스에 저장하는 것을 특징으로 하는 데이터베이스 관리 시스템.
The method of claim 10,
The index generating unit stores a remaining portion of the key value of the plurality of records constituting each page in the index except for a portion corresponding to the prefix, which is a common area.
제 10 항에 있어서,
상기 프리픽스는 LFK(lower fence key) 또는 UFK(upper fence key)에만 저장되는 것을 특징으로 하는 데이터베이스 관리 시스템.
The method of claim 10,
The prefix is stored only in the lower fence key (LFK) or upper fence key (UFK).
제 12 항에 있어서,
상기 다수 개의 레코드 중 LFK(lower fence key) 또는 UFK(upper fence key)가 저장되는 레코드 이외의 레코드에는, 각 레코드의 원본키값 중 상기 프리픽스를 제외한 키값들만이 저장되는 것을 특징으로 하는 데이터베이스 관리 시스템.
The method of claim 12,
And in the records other than the record in which the lower fence key (LFK) or the upper fence key (UFK) is stored among the plurality of records, only key values excluding the prefix among the original key values of each record are stored.
삭제delete 삭제delete
KR1020150034544A 2015-03-12 2015-03-12 Method and System for Managing Database, and Tree Structure for Database KR102013839B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020150034544A KR102013839B1 (en) 2015-03-12 2015-03-12 Method and System for Managing Database, and Tree Structure for Database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020150034544A KR102013839B1 (en) 2015-03-12 2015-03-12 Method and System for Managing Database, and Tree Structure for Database

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
KR1020130122951A Division KR101549220B1 (en) 2013-10-15 2013-10-15 Method and System for Managing Database, and Tree Structure for Database

Publications (2)

Publication Number Publication Date
KR20150044013A KR20150044013A (en) 2015-04-23
KR102013839B1 true KR102013839B1 (en) 2019-10-21

Family

ID=53036378

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020150034544A KR102013839B1 (en) 2015-03-12 2015-03-12 Method and System for Managing Database, and Tree Structure for Database

Country Status (1)

Country Link
KR (1) KR102013839B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101806394B1 (en) 2016-07-05 2017-12-07 주식회사 리얼타임테크 A data processing method having a structure of the cache index specified to the transaction in a mobile environment dbms

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100082545A1 (en) * 2008-09-30 2010-04-01 International Business Machines Corporation Compression of sorted value indexes using common prefixes

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100921158B1 (en) * 2007-12-21 2009-10-12 엔에이치엔(주) Method and System for Managing Database
KR101160388B1 (en) * 2008-02-05 2012-06-26 엔에이치엔비즈니스플랫폼 주식회사 Method and System for Managing Database

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100082545A1 (en) * 2008-09-30 2010-04-01 International Business Machines Corporation Compression of sorted value indexes using common prefixes

Also Published As

Publication number Publication date
KR20150044013A (en) 2015-04-23

Similar Documents

Publication Publication Date Title
KR101549220B1 (en) Method and System for Managing Database, and Tree Structure for Database
US9535956B2 (en) Efficient set operation execution using a single group-by operation
US10657116B2 (en) Create table for exchange
WO2015106711A1 (en) Method and device for constructing nosql database index for semi-structured data
US10671586B2 (en) Optimal sort key compression and index rebuilding
US11782924B2 (en) Distributed join index for shared-nothing and log-structured databases
CN114780502B (en) Database method, system, device and medium based on compressed data direct computation
US8140546B2 (en) Computer system for performing aggregation of tree-structured data, and method and computer program product therefor
US10558636B2 (en) Index page with latch-free access
Tzouramanis et al. Overlapping B+-trees: An implementation of a transaction time access method
Ghanem et al. Bulk operations for space-partitioning trees
US11520763B2 (en) Automated optimization for in-memory data structures of column store databases
KR102013839B1 (en) Method and System for Managing Database, and Tree Structure for Database
D’silva et al. Secondary indexing techniques for key-value stores: Two rings to rule them all
CA2418093A1 (en) Data compiling method
Carter et al. Nanosecond indexing of graph data with hash maps and VLists
CN110825747B (en) Information access method, device and medium
Kwon et al. Compressed key sort and fast index reconstruction
Bansal Modeling Sparse and Evolving Data
KR100920745B1 (en) query processing method, inverted list maintaining method, compression method for maintaining inverted list, phrase inverted list managing method
Popov Advanced Storage Structures for Native XML Databases
Hasan An Index Structure for Large Order Database Maintenance Using Variants of B Trees

Legal Events

Date Code Title Description
A107 Divisional application of patent
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant