KR20150044013A - 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
KR20150044013A
KR20150044013A KR20150034544A KR20150034544A KR20150044013A KR 20150044013 A KR20150044013 A KR 20150044013A KR 20150034544 A KR20150034544 A KR 20150034544A KR 20150034544 A KR20150034544 A KR 20150034544A KR 20150044013 A KR20150044013 A KR 20150044013A
Authority
KR
South Korea
Prior art keywords
record
page
key
ufk
lfk
Prior art date
Application number
KR20150034544A
Other languages
Korean (ko)
Other versions
KR102013839B1 (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

    • G06F17/30327
    • 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
    • G06F17/30315
    • G06F17/30339

Landscapes

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

Abstract

The present invention relates to method and system for managing database storing lower bound and upper bound of key value of multiple records included in one page, and deleting the overlapped key values in multiple records by using the same, while forming index of database, to reduce storage space in which the index page is stored, so that the performance of the database is improved.

Description

데이터베이스 관리 방법, 시스템 및 데이터베이스 트리 구조{Method and System for Managing Database, and Tree Structure for Database}Database Management Method, System, and Database Tree Structure {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, system, and database tree structure using an index compression method.

데이터베이스 관리 시스템(Database Management System: DBMS, '이하 DBMS'라 함)은 방대한 양의 데이터가 저장되어 있는 데이터베이스를 관리하기 위한 시스템으로서, 대량의 정보들이 쉴새없이 생성되고 있는 현시대에 있어서 없어서는 안 될 중요한 요소로 인식되고 있다.A database management system (DBMS, hereinafter referred to as DBMS) is a system for managing a database in which a vast amount of data is stored, and is an important system Element.

이러한 DBMS에서는 모든 데이터를 테이블(Table) 형태로 데이터베이스에 저장하는데, 여기서 테이블이란 데이터베이스에서 데이터를 저장하는 기본구조를 말하며, 하나의 테이블은 하나 이상의 레코드(Record)들로 구성된다. 여기서, 레코드란 테이블의 한 행(Row)를 의미한다. 또한, 각 레코드는 하나 이상의 칼럼으로 구성되는데, 칼럼이란 테이블을 구성하는 실세계의 테이블 항목을 표현하는 이름을 가진 도메인(Domain)을 의미하는 것으로서, 어트리뷰트(Attribute) 또는 필드(Field)라고도 한다.In this 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 a table is made up of one or more records. Here, the record means one row of the table. Each record is composed of one or more columns. A column is a domain having a name representing a table item of the real world constituting the table, and may be referred to as an attribute or a field.

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

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

전술한 배경기술은 발명자가 본 발명의 도출을 위해 보유하고 있었거나, 본 발명의 도출 과정에서 습득한 기술 정보로서, 반드시 본 발명의 출원 전에 일반 공중에게 공개된 공지기술이라 할 수는 없다.The above-described background technology is technical information that the inventor holds for the derivation of the present invention or acquired in the process of deriving the present invention, and can not necessarily be a known technology disclosed to the general public prior to the filing of the present invention.

본 발명의 일 실시예는 데이터베이스의 인덱스를 구성함에 있어, 한 페이지에 포함되는 다수 개의 레코드의 키값의 하한값 및 상한값을 구분자로서 저장하고, 이를 이용하여 다수 개의 레코드에서 키의 중복되는 부분을 삭제함으로써, 인덱스 페이지가 저장되는 저장 공간을 절약하고 이로 인해 데이터베이스의 성능이 향상되는 데이터베이스 관리 방법, 시스템 및 데이터베이스 트리 구조를 제공하는 것을 목적으로 한다.In an embodiment of the present invention, 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 delimiters, and redundant portions of the keys are deleted from a plurality of records A database management method, a system, and a database tree structure in which a storage space in which an index page is saved is saved, thereby improving the performance of the database.

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

또한, 본 발명의 일 실시예는 부차적인 압축방식 및 범위에 대한 메타데이터를 추가로 기록할 필요가 없도록 하여, 페이지에 저장되는 레코드의 개수가 많아질수록 압축되는 레코드에 메타 정보를 포함하는 기존의 방법에 비해서 압축 효율이 극대화되는 데이터베이스 관리 방법, 시스템 및 데이터베이스 트리 구조를 제공하는 것을 목적으로 한다.In an embodiment of the present invention, it is unnecessary to further record meta data regarding a secondary compression method and range, and as the number of records stored in a page increases, And a database tree structure in which the compression efficiency is maximized as compared with the method of the first embodiment.

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

본 발명의 일 실시예는 각 페이지에 포함되는 다수 개의 레코드의 키값의 하한값이 LFK(lower fence key)로 저장되거나 또는, 레코드의 키값의 상한값이 UFK(upper fence key)로 저장되는 단계; 상기 페이지를 이루는 다수 개의 레코드의 키값 중 공통 영역이 프리픽스(prefix)로 추출되는 단계; 및 상기 다수 개의 레코드의 키값에서 상기 프리픽스(prefix)에 해당하는 부분을 제외한 나머지 부분이 저장되는 단계;를 포함하는 데이터베이스 관리 방법을 개시한다. According to an embodiment of the present invention, a lower limit value of a key value 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 a step of storing a portion of the key value of the plurality of records except a portion corresponding to the prefix.

본 실시예에 있어서, 상기 프리픽스는 LFK(lower fence key) 또는 UFK(upper fence key)에 저장될 수 있다. In this 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, key values other than the prefix 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.

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

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

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

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

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

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

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

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

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

본 실시예에 있어서, 상기 인덱스 생성부는, 상기 각 페이지를 이루는 다수 개의 레코드의 키값 중 공통 영역을 프리픽스(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 embodiment, the index generator may store, in an index, a remaining portion excluding a portion corresponding to the prefix, which is a common region, from a key value of a plurality of records constituting each page.

본 실시예에 있어서, 상기 프리픽스는 LFK(lower fence key) 또는 UFK(upper fence key)에만 저장될 수 있다. In this 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 this embodiment, only the key values other than the prefix may be stored in the record other than the record in which the lower fence key (LFK) or the upper fence key (UFK) is stored in each record.

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

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

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

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

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

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

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

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

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

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

또한, 본 발명의 일 실시예는 실시간(run-time)으로 압축 여부를 설정하는 것이 가능하도록 하여, 특정 영역에 삽입/삭제(insert/delete) 부하가 높아지면 압축을 수행하지 않도록 조정함으로써 데이터베이스 운영의 효율성이 향상되는 효과를 얻을 수 있다. In addition, one embodiment of the present invention enables compression in a run-time so that compression is not performed when an insert / delete load is increased in a specific area, It is possible to obtain an effect of improving the efficiency of the apparatus.

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

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

도 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.
FIG. 2B is a flowchart illustrating a record restoring step of the 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.
FIG. 3 is a diagram exemplifying a structure of a B-tree index to which a database management method and system of the present invention is applied.
4 is a diagram showing the arrangement of key values of a general B-tree page.
5 is a diagram showing the arrangement of key values of a B-tree page according to the database management method and system of the present invention.
6A and 6B are diagrams illustrating a process of dividing a page in a B-tree index to which the database management method and system of the present invention are applied.

후술하는 본 발명에 대한 상세한 설명은, 본 발명이 실시될 수 있는 특정 실시예의 예시로서 도시하는 첨부 도면을 참조한다. 이러한 실시예는 당업자가 본 발명을 실시할 수 있기에 충분하도록 상세히 설명된다. 본 발명의 다양한 실시예는 서로 다르지만 상호 배타적일 필요는 없음이 이해되어야 한다. 예를 들어, 본 명세서에 기재되어 있는 특정 형상, 구조 및 특성은 본 발명의 정신과 범위를 벗어나지 않으면서 일 실시예로부터 다른 실시예로 변경되어 구현될 수 있다. 또한, 각각의 실시예 내의 개별 구성요소의 위치 또는 배치도 본 발명의 정신과 범위를 벗어나지 않으면서 변경될 수 있음이 이해되어야 한다. 따라서, 후술하는 상세한 설명은 한정적인 의미로서 행하여지는 것이 아니며, 본 발명의 범위는 특허청구범위의 청구항들이 청구하는 범위 및 그와 균등한 모든 범위를 포괄하는 것으로 받아들여져야 한다. 도면에서 유사한 참조부호는 여러 측면에 걸쳐서 동일하거나 유사한 구성요소를 나타낸다.The following detailed description of the invention refers to the accompanying drawings, which are given by way of illustration of 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, the specific shapes, structures, and characteristics described herein may be implemented by changing from one embodiment to another without departing from the spirit and scope of the invention. It should also be understood that the location or arrangement of individual components within each embodiment may be varied without departing from the spirit and scope of the present invention. Therefore, the following detailed description is not to be taken in a limiting sense, and the scope of the present invention should be construed as encompassing the scope of the appended claims and all equivalents thereof. In the drawings, like reference numbers designate the same or similar components throughout the several views.

이하에서는, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 본 발명을 용이하게 실시할 수 있도록 하기 위하여, 본 발명의 여러 실시예에 관하여 첨부된 도면을 참조하여 상세히 설명하기로 한다.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings in order to facilitate a person skilled in the art to which the present invention pertains.

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

먼저, 데이터베이스(110)에는 다양한 데이터들이 테이블 형식으로 저장되며, 상술한 바와 같이, 각 테이블은 하나 이상의 레코드로 구성되고, 각 레코드는 하나 이상의 칼럼으로 구성된다. 예컨대, 소정 게시판에 대한 게시물들이 저장된 데이터베이스인 경우, 테이블은 게시물들의 집합을 의미하고, 레코드는 각 게시물을 의미하며, 칼럼이란 게시물 식별자, 게시물의 작성자, 게시물의 조회수 등이 저장되는 영역을 의미한다. 도면에는 데이터베이스(110)가 복수 개 구비되는 것으로 도시되어 있으나, 본 발명의 사상은 이에 제한되지 아니하며, 데이터베이스 관리 시스템(100)의 구성, 저장되는 데이터 분량, 용도 등에 따라 데이터베이스(110)의 개수 및 구성은 다양하게 변경가능하다 할 것이다. First, various data are stored in the database 110 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 storing posts for a predetermined bulletin board, the table means a set of posts, the record means each post, and the column means an area where a post identifier, a post author, . It is to be understood that the scope of the present invention is not limited to the number of databases 110 and the number of databases 110 may be varied according to the configuration of the database management system 100, The configuration may be varied.

데이터베이스 관리 시스템(100)은 데이터베이스(110)에 연결되어 데이터베이스(110)에 기록된 데이터를 갱신 또는 삭제하거나 데이터베이스(110)에 데이터를 추가하는 등 데이터베이스(110)를 통합적으로 관리하는 기능을 수행하는 것으로서, 크게 질의문 분석부(120), 실행계획 생성부(130), 실행계획 실행부(140)를 포함한다. 또한, 데이터베이스 관리 시스템(100)은 엔트리 관리부(150) 및 인덱스 관리부(160)를 더 포함할 수 있다. The database management system 100 performs 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, And includes a query analysis unit 120, an execution plan generation unit 130, and an execution plan execution unit 140. The database management system 100 may further include an entry management unit 150 and an index management unit 160.

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

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

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

실행계획 실행부(140)는 실행계획 생성부(130)에 의해 생성된 실행계획에 따라 특정 테이블로부터 해당 레코드를 인출하고, 갱신 요청된 칼럼의 물리적 위치에 상응하는 레코드 상의 칼럼에 기록된 칼럼값에 증가 연산을 수행함으로써 해당 칼럼값을 갱신한다. 구체적으로, 실행계획 실행부(140)는 실행계획 생성부(130)에 의해 생성된 실행계획을 실행하기 위한 트랜잭션을 생성함으로써 생성된 실행계획을 해당 트랜잭션 동안 처리한다. 여기서, 트랜잭션이란 하나의 논리적 작업 단위를 구성하는 것으로서, 하나 이상의 SQL문을 이용해서 정의된다. 이러한 트랜잭션의 사용으로 인해 데이터의 일치성과 데이터의 동시발생을 보장할 수 있게 된다.The execution plan execution unit 140 fetches the corresponding record from the specific table according to the execution plan generated by the execution plan generation unit 130 and updates the column value recorded in the column on the record corresponding to the physical position of the column requested to be updated To update the corresponding column value. Specifically, the execution plan execution unit 140 processes an execution plan generated by generating a transaction for executing the execution plan generated by the execution plan generation unit 130 during the corresponding transaction. Here, a transaction constitutes one logical unit of work and is defined using one or more SQL statements. The use of such transactions can ensure 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, matches the generated entry with a column value corresponding to a column identifier included in the entry, And the column value of the column requested to be updated in the memory 170 may be matched with the entry generated in the entry management unit 150 and stored.

한편, 데이터베이스 관리 시스템(100)은 인덱스를 생성 또는 삭제하고, 생성된 인덱스를 메모리(170)에 저장하는 인덱스 관리부(160)를 더 포함할 수 있다. 이와 같은 인덱스 관리부(160)는 인덱스 생성부(161), 레코드 복원부(163), 레코드 업데이트부(165)를 포함할 수 있다. The database management system 100 may further include an index management unit 160 for creating or deleting an index and storing the generated index in the memory 170. The index management unit 160 may include an index generation unit 161, a record restoration unit 163, and a record update unit 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 index generator 161 stores the lower limit value of the key value belonging to each page of the index as LFK (lower fence key), and the upper limit value of the key value is UFK (upper fence key) As shown in FIG. In addition, the index generator 161 extracts a common region 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 a key value of a plurality of records constituting each page, and stores the deleted index in the index.

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

레코드 업데이트부(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 the existing record. In detail, the record update unit 165 checks whether LFK and UFK exist in the corresponding page, and if LFK and UFK exist in the corresponding page, LFK and UFK are compared with each other to extract a prefix, And adds or changes the remaining data excluding the prefix to the corresponding page as a record.

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

이하에서는 이와 같이 구분자 기반의 인덱스 압축 기법(Serperator-Based Index Compression Method)을 이용한 데이터베이스 관리 방법에 대해 보다 상세히 설명하도록 한다. Hereinafter, a database management method using the separator-based index compression method will be described in more 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 a database management method and system of the present invention is applied. FIG. 4 is a diagram showing an arrangement of key values of a general B-tree page, FIG. 5 is a diagram showing an arrangement of key values of a B-tree page according to a database management method and system of the invention.

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

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

인덱스(index)는 데이터베이스 분야에 있어서 테이블에 대한 동작의 속도를 높여주는 자료구조를 일컫는다. 인덱스는 테이블 내의 1개의 컬럼(single coulmn index), 혹은 여러 개의 컬럼(multi coulmn index)을 이용하여 생성될 수 있으며, 고속의 검색 동작뿐만 아니라 레코드 접근과 관련하여 효율적인 순서 매김 동작에 대한 기초를 제공한다. 인덱스를 저장하는 데 필요한 디스크 공간은 보통 테이블을 저장하는 데 필요한 디스크 공간보다 작다. 왜냐하면 보통 인덱스는 키-필드만 갖고 있고, 테이블의 다른 세부 항목들은 갖고 있지 않기 때문이다.Indexes are data structures that speed up operations on tables in the database field. Indexes can be created using a single coulmn index or multiple columns in a table, providing a basis for efficient ordering operations in conjunction with record access as well as high-speed retrieval operations. do. The disk space required to store the index is usually less than the disk space required to store the table. Because the normal index only has a key-field and does not have 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 type of tree data structure widely used in databases and file systems for constructing such an index. It is an associative mapping data structure for quickly querying a record having a specific value (key). The B-tree (or B + tree) has a tree-structured page unit in order to reduce the number of I / Os since data is recorded on a large-capacity disk with slow access. In one page, a key and the position (Object ID or Record ID) of an actual record including this key as an attribute are recorded in the order of the keys. That is, {Key - OID} combines and constitutes 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 records in a page can have considerable similarity between adjacent values. For example, if you specify an employee number, mail folder number, and mail serial number as index keys to distinguish each mail in a company's mail system (that is, a multicolumn index), one employee has 100,000 total messages, If 10,000 messages are stored in the mail folder, the number of the index and the number of the mail folder are the same for 10,000, and 100,000 are the same value. If 1,000 pages are entered in a conventional B-tree page in the conventional way, about ten pages will be stored each time the duplicate number and mail folder number are duplicated. Therefore, there is a problem that unnecessary memory is wasted because the same value is repeatedly stored many times.

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

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

이를 이해하기 쉽게 설명하면 다음과 같다. This can be easily understood as follows.

본 발명이 적용된 B 트리 인덱스의 구조를 도시한 도 3을 참조하면, 데이터베이스에서 레코드 데이터를 빠르게 검색하기 위해서 사용되는 인덱스에 있어서, 본 발명에서 사용하는 B 트리 인덱스의 구성은 실제 레코드 데이터를 가리키는 리프 노드(leaf node)들과 그 상위의 중간 노드들로 이루어진다. 루트 노드는 중간 노드들 중에서 최상위에 존재하는 하나의 노드이다. 도 3에는 네 개의 리프 노드와 한 개의 중간 노드가 존재하고, 그 하나의 중간 노드가 곧 루트 노드가 된다. 이때, 각각의 리프 노드는 곧 각각의 페이지를 구성한다. 즉 도 3에 도시된 네 개의 리프 노드는 네 개의 페이지를 구성하는 것이다. Referring to FIG. 3 illustrating a structure of a B-tree index to which the present invention is applied, in the index used for quickly searching record data in the database, the B-tree index used in the present invention includes a leaf It consists of leaf nodes and their intermediate nodes. The root node is the highest node among the intermediate nodes. In FIG. 3, there are four leaf nodes and one intermediate node, and one intermediate node immediately becomes a root node. At this time, each leaf node immediately 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 different key values P1, P2, and P3. The first sort key value P1 is a delimiter that distinguishes pages 1 and 2, the second sort key value P2 is a delimiter that distinguishes page 2 and page 3, And page 4, respectively.

이와 같이, 본 발명의 일 실시예에 따른 데이터베이스 관리 방법은 각각의 페이지에 속하는 키값의 하한값을 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 the embodiment of the present invention stores the lower limit value of the key value belonging to each page as LFK (lower fence key), and also stores the upper limit value of the key value belonging to each page as UFK (upper fence key) As shown in FIG. In this case, the lower fence key LFK is stored in the left end of each page as shown in the drawing to define the lower limit value of the page, and the upper fence key is stored in the right end of each page when viewed in the drawing, Quot; is defined as the upper limit value.

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

즉, 제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)를 설정할 수 없으며, 따라서 해당 페이지에서는 프리픽스 추출도 할 수 없다. That is, the first key value P1 becomes UFK (UFK1) of page 1 and LFK (LFK2) of page 2. Similarly, the second discrimination key value P2 becomes UFK (UFK2) of page 2 and LFK (LFK3) of page 3. Likewise, the third key value P3 becomes UFK (UFK3) of page 3 and LFK (LFK4) of page 4. In this case, LFK (lower fence key) can not be set for the leftmost leaf node (page 1) located at the leftmost among a plurality of leaf nodes, and thus the prefix extraction can not be performed on the corresponding page. Likewise, it is not possible to set the upper fence key (UFK) on the extreme right leaf node (page 4) located at the far right, and thus it is not possible to extract the prefix in the corresponding page.

이를 더욱 상세히 설명하기 위해, 일반적인 B 트리 페이지의 키값의 배열을 나타내는 도 4와, 본 발명의 데이터베이스 관리 방법 및 시스템에 따른 B 트리 페이지의 키값의 배열을 나타내는 도 5를 비교한다. 도 4 및 도 5에서는 설명을 위해 10개의 레코드만 있는 경우를 상정했다. To explain this in more detail, Fig. 4, which shows the arrangement of the key values of a general B-tree page, and Fig. 5, which shows the arrangement of the key values of the B-tree page according to the database management method and system of the present invention, are compared. In FIGS. 4 and 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 stored ten times in the ten records constituting one page, with the same value being duplicated as the number (KR10000) and the mail folder number (FD0001). Referring to FIG. 5, according to the database management method of the present invention, the KR 10000 and the mail folder number FD0001, which are redundantly stored among the key values of one page, are set to LFK (Lower Fence Key) and the Upper Fence Key (UFK) that sets the upper limit value of the page, and only the key value in which the prefix is deleted is stored in the general record between LFK and UFK. That is, as shown in Fig. 5, the number (KR10000) and the mail folder number (FD0001), which are key values common to the ten records, are all 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, the step of restoring a record in the database management method according to an embodiment of the present invention will be described. 2 and 5, restoring a record in the database management method according to an embodiment of the present invention (step S200) includes checking whether LFK and UFK exist in the corresponding page (step S210 A step of extracting a prefix by comparing LFK and UFK when the LFK and the UFK exist in the page (step S220), and a step of combining the prefix and the value of the record to recover the original key value (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, a binary search is performed to find which page a page to which a key value to be restored belongs, and then it is checked whether LFK and UFK exist in the corresponding page. If there is neither LFK nor UFK in the page, the page is compressed (i.e., duplicate data is deleted using the prefix), so the key value stored in each record is the original key value (S240 step). On the other hand, when both LFK and UFK exist in the page, the page is a page on which data compression using the prefix has been performed, so that a predetermined restoration routine is executed. That is, LFK, which is the lower limit value of the page, is compared with UFK, which is the upper limit value of the page, and the common region, that is, the prefix, of LFK and UFK is extracted. In the example of FIG. 5, KR10000: FD0001, which is a common area between LFK and UFK, will be extracted as a prefix. The original key value is restored by combining the extracted prefix with the key value stored in each record. That is, the original key value obtained by restoring 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 the database management method according to an embodiment of the present invention will be described. 2 and 5, in the database management method according to an embodiment of the present invention, the step of adding or changing a record (step S300) includes a step of checking whether LFK and UFK exist in the corresponding page If the LFK and the UFK exist in the corresponding page, the LFK and the UFK are compared with each other to extract a prefix (step S320), and the remaining data excluding the prefix from the record to be added or changed is added to the corresponding page as a record (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, a binary search is performed to find which page a key value to be added or changed belongs to, and then it is checked whether LFK and UFK exist in the corresponding page. If either the LFK or the UFK is not present on the page, the page is compressed (i.e., the duplicate data is deleted using the prefix), and therefore, the value of the record is directly added or changed without any processing (Step S340). On the other hand, if both the LFK and the UFK exist in the page, the page is a page on which data compression using the prefix is performed, so that a predetermined decomposition routine is executed. That is, LFK, which is the lower limit value of the page, is compared with UFK, which is the upper limit value of the page, and the common region, that is, the prefix, of LFK and UFK is extracted. In the example of FIG. 5, KR10000: FD0001, which is a common area between LFK and UFK, will be extracted as a prefix. Next, only the remaining key values excluding the prefix from the key value of the record to be added or changed are added or changed to the corresponding position on the page. For example, if the key value to be added is KR10000: FD0001: SN13000, the prefix is KR10000: FD0001, and therefore only the SN13000 except for the prefix is added to the page.

이하에서는 본 발명의 일 실시예에 따른 데이터베이스 관리 방법에서 페이지가 분할 또는 병합되는 과정에 대해 설명하도록 한다. Hereinafter, a process of dividing 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 are diagrams illustrating a process of dividing a page in a B-tree index to which the database management method and system 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 different key values P1 and P2. The first sorting key value P1 is a delimiter that distinguishes pages 1 and 2, and the second delimiting key value P2 is a delimiter that distinguishes pages 2 and 3. Then, the first key value P1 becomes UFK (UFK1) of page 1 and LFK (LFK2) of page 2. Similarly, the second discrimination key value P2 becomes UFK (UFK2) of page 2 and LFK (LFK3) of page 3.

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

이 경우, 페이지 2에서는 도 6b에 도시된 바와 같이 복원된 S를 새로운 UFK(UFK2)로 저장한다. 그리고, 기존에 존재하던 LFK(LFK2)와 새롭게 생성된 UFK(UFK2)를 이용하여 다시 데이터를 압축한다. 즉, LFK2와 UFK2를 비교 연산하여 프리픽스를 추출한 후, LFK2와 UFK2를 제외한 나머지 레코드에서는 키값에서 프리픽스를 삭제한 후, 나머지 키값만을 저장하는 것이다. In this case, page 2 stores the restored 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 comparing the LFK2 and UFK2 to extract the prefix, the remaining records excluding LFK2 and UFK2 are deleted from the key value and only the remaining key values are stored.

한편, 새롭게 생성된 도 6b의 페이지 3에서는 S를 새로운 LFK(LFK3)로 저장한다. 그리고, 도 6a의 페이지 2의 UFK(UFK2)가 도 6b의 페이지 3의 UFK(UFK3)로 저장된다. 그리고, LFK3와 UFK3를 이용하여 다시 데이터를 압축한다. 즉, LFK3와 UFK3를 비교 연산하여 프리픽스를 추출한 후, LFK3와 UFK3를 제외한 나머지 레코드에서는 키값에서 프리픽스를 삭제한 후, 나머지 키값만을 저장하는 것이다. On the other hand, in page 3 of FIG. 6B that is newly created, S is stored 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. That is, after comparing LFK3 and UFK3 to extract the prefix, the remaining records excluding LFK3 and UFK3 are deleted from the key value, and only the remaining key values are stored.

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

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

또한, 도면에는 도시되지 않았지만, 서로 이웃한 두 개의 페이지가 병합 가능한(mergeable) 크기일 때(즉, 두 개의 페이지에 저장된 레코드 개수의 합이 하나의 페이지에 저장될 수 있는 레코드 개수의 최대값 이하일 경우)에는, 두 개의 페이지를 병합하는 것도 가능할 것이다. 이때 두 개의 페이지가 모두 압축된 페이지(즉, 프리픽스를 이용하여 중복 데이터가 삭제된 페이지)라면, 두 페이지의 병합 이후 새롭게 압축을 수행한다. 반면, 두 개의 페이지 중 하나라도 압축된 페이지가 아닐 경우에는 병합을 수행하지 않게 된다.
Although not shown in the drawing, when two neighboring pages are mergeable (that is, when the sum of the number of records stored in two pages is equal to or smaller than the maximum value of the number of records that can be stored in one page , It is also possible to merge two pages. At this time, if both pages are compressed pages (i.e., pages in which redundant data are deleted using a prefix), new compression is performed after merging of two pages. On the other hand, if any one of the two pages is not a compressed page, the 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 according to an embodiment of the present invention is applied This is a comparative table. Table 2 shows the average key length (average key length) when a general database management method and system are applied and the average key value length when a database management method and system according to an embodiment of the present invention is applied This is a comparative table.

인덱스 이름Index name 기존
총 인덱스 페이지 개수
existing
Total index page count
본원발명 적용시
인덱스 페이지
개수 감소 비율(%)
When applying the present invention
Index page
Decrease rate (%)
PK(primary key)PK (primary key) 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
Decrease rate (%)
PK(primary key)PK (primary key) 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 are applied, compared to the case where the conventional database management method and system are applied, the total number of index pages is reduced by about 19% And the average key value length was reduced by about 31%. That is, it can be seen that the storage space can be saved according to the present invention, thereby improving the performance of the database.

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

한편, 해당 페이지에 LFK 또는 UFK가 존재하지 않으면 기존의 방식으로 레코드를 저장할 수 있으며, 따라서 압축된 페이지(즉, 프리픽스가 각 레코드에서 삭제된 페이지)와 압축되지 않은 페이지(즉, 프리픽스가 각 레코드에서 삭제되지 않은 페이지)가 혼재하여 유지될 수 있다. 또한 LFK 및 UFK가 존재하는 페이지 내에서도 압축된 레코드와 압축되지 않은 레코드가 혼재하여 유지될 수 있다. 따라서, B 트리의 현재 상태와 무관하게 실시간(run-time)으로 압축 여부를 동적으로 설정하는 것이 가능해지는 효과를 얻을 수 있다. 그리고, 이와 같은 특징을 이용하여, 특정 영역에 삽입/삭제(insert/delete) 부하가 높아지면 압축을 수행하지 않도록 조정하여 데이터베이스 운영의 효율성을 향상시킬 수 있다. On the other hand, if there is no LFK or UFK in the page, the record can be stored in an existing manner, so that the compressed page (i.e., the page where the prefix is deleted from each record) and the uncompressed page Can be held together. Compressed and uncompressed records can also be kept mixed in pages where LFK and UFK exist. Therefore, it is possible to dynamically set the compression state in real time (run-time) irrespective of the current state of the B-tree. By using such a characteristic, if the load of an insert / delete in a specific area is increased, compression can be prevented from being performed, and the efficiency of database operation can be improved.

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

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

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

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

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

100: 데이터베이스 관리 시스템
110: 데이터베이스
120: 질의문 분석부
130: 실행계획 생성부
140: 실행계획 실행부
150: 엔트리 관리부
160: 인덱스 관리부
161: 인덱스 생성부
163: 레코드 복원부
165: 레코드 업데이트부
100: Database Management System
110: Database
120: Query Analyzer
130: Execution plan generation unit
140: Execution plan execution unit
150: Entry manager
160: Index management unit
161: Index generation unit
163:
165:

Claims (15)

각 페이지에 포함되는 다수 개의 레코드의 키값의 하한값이 LFK(lower fence key)로 저장되거나 또는, 레코드의 키값의 상한값이 UFK(upper fence key)로 저장되는 단계;
상기 페이지를 이루는 다수 개의 레코드의 키값 중 공통 영역이 프리픽스(prefix)로 추출되는 단계; 및
상기 다수 개의 레코드의 키값에서 상기 프리픽스(prefix)에 해당하는 부분을 제외한 나머지 부분이 저장되는 단계;를 포함하고,
상기 LFK와 상기 UFK는 상기 프리픽스를 포함하는 원본키값인 것을 특징으로 하는 데이터베이스 관리 방법.
A lower limit value of a key value 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
And storing a remaining portion of the key value of the plurality of records except a portion corresponding to the prefix,
Wherein the LFK and the UFK are source key values including the prefix.
제 1 항에 있어서,
상기 프리픽스는 LFK(lower fence key) 또는 UFK(upper fence key)에 저장되는 것을 특징으로 하는 데이터베이스 관리 방법.
The method according to claim 1,
Wherein the prefix is stored in a lower fence key (LFK) or an upper fence key (UFK).
제 2 항에 있어서,
상기 각 레코드 중 LFK(lower fence key) 또는 UFK(upper fence key)가 저장되는 레코드 이외의 레코드에는, 각 레코드의 원본키값 중 상기 프리픽스를 제외한 키값들이 저장되는 것을 특징으로 하는 데이터베이스 관리 방법.
3. The method of claim 2,
Wherein the key values other than the prefix are 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.
제 1 항에 있어서,
상기 레코드는 다수 개의 키값을 포함하는 멀티 칼럼(multi column) 형태의 레코드인 것을 특징으로 하는 데이터베이스 관리 방법.
The method according to claim 1,
Wherein the record is a multi-column record including a plurality of key values.
제 4 항에 있어서,
상기 다수 개의 키값 중, 하나의 페이지를 이루는 레코드가 동일한 값을 가지는 키값이 상기 프리픽스로 추출되는 것을 특징으로 하는 데이터베이스 관리 방법.
5. The method of claim 4,
Wherein a key value having a same value as a record of one page among the plurality of key values is extracted by the prefix.
제 1 항에 있어서,
상기 각 페이지는 B 트리 또는 B+ 트리 구조의 리프 노드인 것을 특징으로 하는 데이터베이스 관리 방법.
The method according to claim 1,
Wherein each of the pages is a leaf node of a B-tree or B + tree structure.
제 1 항에 있어서,
상기 데이터베이스 관리 방법은,
상기 페이지에 새로운 레코드가 추가되거나 기 존재하는 레코드가 변경되는 단계를 더 포함하고,
상기 레코드가 추가되거나 변경되는 단계는,
해당 페이지에 상기 LFK와 UFK가 존재하는지 여부가 확인되는 단계;
해당 페이지에 상기 LFK와 UFK가 존재할 경우, 상기 LFK와 UFK를 비교 연산하여 이에 공통되는 프리픽스가 추출되는 단계; 및
추가 또는 변경될 레코드에서 상기 프리픽스가 제외된 나머지 키값이 레코드로 추가 또는 변경되는 단계;를 포함하는 데이터베이스 관리 방법.
The method according to claim 1,
The database management method includes:
Further comprising the step of adding a new record to the page or changing the existing record,
The step of adding or modifying the record includes:
Determining whether the LFK and the UFK are present in the corresponding page;
Comparing the LFK and the UFK when the LFK and the UFK are present in the page, and extracting a common prefix; And
And adding or changing the remaining key values from which the prefix is excluded in the record to be added or changed.
제 7 항에 있어서,
해당 페이지에 상기 LFK와 UFK가 존재하지 않을 경우,
상기 프리픽스가 추출되지 아니하고, 해당 페이지에 레코드가 추가 또는 변경되는 것을 특징으로 하는 데이터베이스 관리 방법.
8. The method of claim 7,
If the LFK and UFK do not exist on the page,
Wherein the prefix is not extracted and a record is added or changed in the page.
제 1 항 내지 제 8 항 중 어느 하나의 항에 기재된 방법을 수행하기 위한 프로그램이 기록된 기록매체.A recording medium on which a program for performing the method according to any one of claims 1 to 8 is recorded. 특정 테이블에 포함된 레코드의 인출요청 및 상기 레코드에 포함된 적어도 하나의 칼럼에 대한 갱신요청이 함께 정의된 질의문을 수신하여 분석하는 질의문 분석부;
상기 분석된 질의문을 수행하기 위한 실행계획을 생성하는 실행계획 생성부;
상기 실행계획에 따라 상기 레코드의 인출 및 상기 적어도 하나의 칼럼에 대한 갱신을 수행함으로써 상기 실행계획을 실행하는 실행계획 실행부; 및
특정 테이블에 대한 인덱스를 생성하며, 상기 인덱스의 각 페이지에 속하는 다수 개의 레코드의 키값의 하한값을 LFK(lower fence key)로 저장하거나 또는, 레코드의 키값의 상한값을 UFK(upper fence key)로 저장하고, 상기 각 페이지를 이루는 다수 개의 레코드의 키값 중 공통 영역을 프리픽스(prefix)로써 추출하는 인덱스 생성부를 포함하는 인덱스 관리부;를 포함하고,
상기 LFK와 상기 UFK는 상기 프리픽스를 포함하는 원본키값인 것을 특징으로 하는 데이터베이스 관리 시스템.
A query analyzer for receiving and analyzing a query statement in which a fetch request for a record included in a specific table and an update request for at least one column included in the record are defined;
An execution plan generating unit for generating an execution plan for executing the analyzed query;
An execution plan execution unit for executing the execution plan by fetching the record and updating the at least one column in accordance with the execution plan; And
The lower limit value of the key value of a plurality of records belonging to each page of the index is stored as a lower fence key, or the upper limit value of the key value of the record is stored as an upper fence key (UFK) And an index generator for extracting a common area among key values of a plurality of records constituting each page by using a prefix,
Wherein the LFK and the UFK are source key values including the prefix.
제 10 항에 있어서,
상기 인덱스 생성부는, 상기 각 페이지를 이루는 다수 개의 레코드의 키값에서 공통 영역인 상기 프리픽스(prefix)에 해당하는 부분을 제외한 나머지 부분을 인덱스에 저장하는 것을 특징으로 하는 데이터베이스 관리 시스템.
11. The method of claim 10,
Wherein the index generator stores, in an index, a remaining portion excluding a portion corresponding to the prefix, which is a common region, from a key value of a plurality of records constituting each page.
제 10 항에 있어서,
상기 프리픽스는 LFK(lower fence key) 또는 UFK(upper fence key)에만 저장되는 것을 특징으로 하는 데이터베이스 관리 시스템.
11. The method of claim 10,
Wherein the prefix is stored only in a lower fence key (LFK) or an upper fence key (UFK).
제 12 항에 있어서,
상기 각 레코드 중 LFK(lower fence key) 또는 UFK(upper fence key)가 저장되는 레코드 이외의 레코드에는, 각 레코드의 원본키값 중 상기 프리픽스를 제외한 키값들만이 저장되는 것을 특징으로 하는 데이터베이스 관리 시스템.
13. The method of claim 12,
Wherein only the key values other than the prefix are stored in the record other than the record in which the lower fence key (LFK) or the upper fence key (UFK) is stored among the records.
제 10 항에 있어서,
상기 인덱스 관리부는,
상기 인덱스의 각 페이지에 새로운 레코드를 추가하거나 기 존재하는 레코드를 변경하는 레코드 업데이트부를 더 포함하는 데이터베이스 관리 시스템.
11. The method of claim 10,
The index management unit,
And a record update unit for adding a new record to each page of the index or changing a record existing.
제 14 항에 있어서,
상기 레코드 업데이트부는,
해당 페이지에 상기 LFK와 UFK가 존재하는지 여부를 확인하고, 해당 페이지에 상기 LFK와 UFK가 존재할 경우 LFK와 UFK를 비교 연산하여 상기 프리픽스를 추출하며, 추가 또는 변경될 레코드에서 상기 프리픽스가 제외된 나머지 데이터를 해당 페이지에 레코드로 추가 또는 변경하는 것을 특징으로 하는 데이터베이스 관리 시스템.
15. The method of claim 14,
Wherein the record update unit comprises:
If the LFK and the UFK exist in the corresponding page, the LFK and the UFK are compared with each other to extract the prefix, and if the LFK and the UFK exist in the page, Wherein the data is added or changed as a record on the page.
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 true KR20150044013A (en) 2015-04-23
KR102013839B1 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3267329A1 (en) 2016-07-05 2018-01-10 Realtimetech Co., Ltd. Data processing method having structure of cache index specified to transaction in mobile environment dbms

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090067825A (en) * 2007-12-21 2009-06-25 (주)큐브리드 Method and system for managing database
KR20090085869A (en) * 2008-02-05 2009-08-10 엔에이치엔(주) Method and system for managing database
US20100082545A1 (en) * 2008-09-30 2010-04-01 International Business Machines Corporation Compression of sorted value indexes using common prefixes

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090067825A (en) * 2007-12-21 2009-06-25 (주)큐브리드 Method and system for managing database
KR20090085869A (en) * 2008-02-05 2009-08-10 엔에이치엔(주) Method and system for managing database
US20100082545A1 (en) * 2008-09-30 2010-04-01 International Business Machines Corporation Compression of sorted value indexes using common prefixes
US8255398B2 (en) * 2008-09-30 2012-08-28 International Business Machines Corporation Compression of sorted value indexes using common prefixes

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3267329A1 (en) 2016-07-05 2018-01-10 Realtimetech Co., Ltd. Data processing method having structure of cache index specified to transaction in mobile environment dbms

Also Published As

Publication number Publication date
KR102013839B1 (en) 2019-10-21

Similar Documents

Publication Publication Date Title
KR101549220B1 (en) Method and System for Managing Database, and Tree Structure for Database
US10657116B2 (en) Create table for exchange
KR101972645B1 (en) Clustering storage method and device
US8560500B2 (en) Method and system for removing rows from directory tables
US20030204513A1 (en) System and methodology for providing compact B-Tree
JP3914662B2 (en) Database processing method and apparatus, and medium storing the processing program
US20090063400A1 (en) Apparatus, system, and method for improving update performance for indexing using delta key updates
US8954407B2 (en) System and method for partially deferred index maintenance
US11868330B2 (en) Method for indexing data in storage engine and related apparatus
US20040225963A1 (en) Dynamic maintenance of web indices using landmarks
EP3867772B1 (en) Distributed join index for shared-nothing and log-structured databases
KR101358793B1 (en) Method of forming index file, Method of searching data and System for managing data using dictionary index file, Recoding medium
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
US10572483B2 (en) Aggregate projection
CN114443625A (en) Database processing method and device
CN114238241B (en) Metadata processing method and computer system for financial data
Kwon et al. Compressed key sort and fast index reconstruction
Nørväg Efficient use of signatures in object-oriented database systems
US20190114323A1 (en) System And Method For Storing Data Records In Key-Value Database
Haapasalo et al. Concurrency control and recovery for multiversion database structures
Cho et al. Meta-data indexing for XPath location steps

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