KR20030044498A - Data Structure, Block Assignment and Record Retrieval Method of Main Memory DataBase Management System - Google Patents
Data Structure, Block Assignment and Record Retrieval Method of Main Memory DataBase Management System Download PDFInfo
- Publication number
- KR20030044498A KR20030044498A KR1020010075262A KR20010075262A KR20030044498A KR 20030044498 A KR20030044498 A KR 20030044498A KR 1020010075262 A KR1020010075262 A KR 1020010075262A KR 20010075262 A KR20010075262 A KR 20010075262A KR 20030044498 A KR20030044498 A KR 20030044498A
- Authority
- KR
- South Korea
- Prior art keywords
- level
- block
- address
- allocated
- last
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
- 238000000034 method Methods 0.000 title claims abstract description 53
- 238000012217 deletion Methods 0.000 description 3
- 230000037430 deletion Effects 0.000 description 3
- 238000003780 insertion Methods 0.000 description 3
- 230000037431 insertion Effects 0.000 description 3
- 238000003491 array Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000002542 deteriorative effect Effects 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/282—Hierarchical databases, e.g. IMS, LDAP data stores or Lotus Notes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/064—Management of blocks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
본 발명은 대용량 데이터의 상호 연관성을 적절하게 표현하면서 검색 성능을 향상시킬 수 있도록 하는 주기억 장치 데이터베이스 관리 시스템의 자료 구조와 블록 할당 및 레코드 검색 방법에 관한 것이다.The present invention relates to a data structure, a block allocation method, and a record retrieval method of a main memory device database management system which can improve retrieval performance while properly expressing correlation of large data.
연결 리스트는 기억 장치 내 물리적인 분포가 산만하고 각 데이터들이 리스트 상에서 정렬되어야 하기 때문에 프로세스의 속도를 현저히 저하시키고, 큐는 제한된 크기 내에서 사용해야 하는 전제 조건이 있으며, 트리 구조는 삽입/삭제 시에 발생하는 구조 변형 오버헤드가 있으므로, 종래 주기억 장치 데이터베이스 관리 시스템에서는 기존의 자료 구조를 그대로 사용할 수 없게 되는 문제점이 있다.The linked list significantly slows down the process because the physical distribution in the storage is scattered and each data has to be sorted on the list, and there is a precondition that queues must be used within a limited size. Since there is a structural deformation overhead that occurs, the conventional main memory database management system has a problem that can not use the existing data structure as it is.
본 발명은, 동적 할당의 기본 단위를 블록으로 지정하고, 각 블록의 주소를 계층적 구조로 연관시켜 관리함으로써, 데이터들의 부분 집합을 블록 단위로 연속하여 배치할 수 있게 되며, 동적 할당의 횟수가 블록 내의 레코드 수만큼 줄어들게 된다.According to the present invention, a basic unit of dynamic allocation is designated as a block, and the address of each block is associated and managed in a hierarchical structure, so that a subset of data can be continuously arranged in block units, and the number of dynamic allocations is increased. It will be reduced by the number of records in the block.
Description
본 발명은 주기억 장치 데이터베이스 관리 시스템의 자료 구조와 블록 할당 및 레코드 검색 방법에 관한 것으로서, 특히 대용량 데이터의 상호 연관성을 적절하게 표현하면서 검색 성능을 향상시킬 수 있도록 하는 주기억 장치 데이터베이스관리 시스템의 자료 구조와 블록 할당 및 레코드 검색 방법에 관한 것이다.The present invention relates to a data structure of a main memory database management system, a block allocation method, and a record retrieval method. In particular, the present invention relates to a data structure of a main memory database management system that can improve retrieval performance while properly expressing a correlation between large amounts of data. Block allocation and record retrieval methods.
일반적으로 데이터베이스 관리 시스템(DataBase Management System;DBMS) 등의 응용에서는 하나의 릴레이션(Relation)에 속하는 레코드(Record)의 수는 이론적으로 무한대의 개념이 된다. 즉, 레코드의 수가 시간의 변화에 따라 무한대로 증가할 가능성을 가진다.In general, in an application such as a database management system (DBMS), the number of records belonging to a relation is theoretically an infinite concept. That is, there is a possibility that the number of records increases indefinitely as time changes.
따라서, 종래 데이터베이스 관리 시스템에서는 대용량의 데이터를 대용량의 보조 기억 장치(하드 디스크, 테이프 등)에 파일 형태로 저장하고, 응용에서 필요한 경우에 주기억 장치로 캐싱(Caching) 기법을 사용해서 로드(load)하고 교환(swapping)하는 방식을 사용한다.Therefore, in a conventional database management system, a large amount of data is stored in a large auxiliary storage device (hard disk, tape, etc.) in the form of a file, and loaded into the main memory using a caching technique when necessary in an application. And swapping.
그러나, 실시간성과 성능이 부각되는 주기억 장치 데이터베이스 관리 시스템(Main Memory DBMS)에서는 대용량의 데이터를 주기억 장치에 상주시키면서 프로세스가 진행되어야 하는 데, 대용량의 데이터를 주기억 장치 내에 동적으로 할당할 때, 종래에는 개별 데이터를 할당의 기본 단위로 하여, 개별 데이터에 대해 그 크기만큼 동적으로 할당하고, 자료 구조를 연결하게 된다.However, in the main memory database management system (Main Memory DBMS), which has high real-time performance and performance, the process must be performed while resident large data is stored in the main memory device. As individual data is the basic unit of allocation, the data is dynamically allocated as much as the size of individual data and the data structures are connected.
전술한 바와 같이, 하나의 프로세스에서 연관된 데이터들을 동적으로 할당할 때, 데이터들의 관련성(선후 관계, 종속 관계 등)을 나타내는 자료 구조로는, 연결 리스트(Linked List), 트리(Tree) 구조, 큐(Queue) 등이 있다.As described above, when dynamically allocating associated data in one process, the data structure indicating the relevance (post-relationship, dependency relationship, etc.) of the data includes a linked list, a tree structure, and a queue. (Queue).
전술한, 연결 리스트는 순서 리스트의 연결된(비순차) 표현으로 임의의 위치에 원소의 삽입, 삭제가 쉬운 반면에, 각 원소마다 링크(포인터 변수)에 다음 원소가 있는 위치에 대한 정보를 추가로 저장해야 하므로, 포인터를 위한 추가의 기억 공간을 필요로 하며, 종류에는 단순 연결 리스트, 원형 연결 리스트, 이중 연결 리스트, 이중 원형 연결 리스트 등이 존재한다.While the linked list described above is a linked (non-sequential) representation of the ordered list, it is easy to insert or delete an element at an arbitrary position, while for each element, additional information about the position of the next element in the link (pointer variable) is added. Since it needs to be stored, it requires additional storage space for pointers, and there are simple linked lists, circular linked lists, dual linked lists, double circular linked lists, and the like.
이와 같은, 연결 리스트를 사용하여 새로운 데이터를 삽입할 경우에는 할당받은 주소에 데이터 값을 복사한 후, 연결을 위한 포인터(링크)로 기존의 데이터들과의 순서 또는 연관 관계를 나타내고, 연결 리스트의 종류에 따라, 전/후, 후, 원형의 포인터들을 모두 연결시켜야 한다.When inserting new data using the linked list, copy the data value to the assigned address, and then indicate the order or association with the existing data with the pointer (link) for linking. Depending on the type, you must connect all of the circular pointers before, after, and after.
그리고, 데이터 삭제 시에는, 삭제할 데이터를 검색해서 노드를 삭제하면서 선행 노드의 링크를 삭제 노드가 가리키는 후행 노드의 포인터로 수정하고, 삭제된 노드를 유휴화시키며, 연결 리스트의 종류에 따라 삭제 노드의 전/후행 노드를 적합한 방식으로 연결시켜야 한다.When deleting data, search for the data to be deleted and delete the node, modify the link of the preceding node with the pointer of the trailing node pointed to by the deleting node, idle the deleted node, and move the deleted node according to the type of the connection list. The trailing nodes must be connected in the proper way.
한편, 큐는 순차 리스트(Array)의 특수한 형태로서, 원소의 삽입은 뒤(rear)에서 삭제는 앞(front)에서 이루어지는 자료 구조로 선입선출(FIFO) 리스트는 제일 먼저 입력된 원소가 제일 먼저 출력된다.On the other hand, a queue is a special form of an sequential list, in which the insertion of an element is done in the rear, the deletion is in the front, and the first-in, first-out (FIFO) list prints the first element first. do.
이러한, 큐의 종류에는 이동 큐와 원형 큐가 존재하는 데, 이동 큐는 뒤(rear)가 큐의 한끝에 도달하고 다른 끝이 비어 있을 때, 큐의 내용을 전체적으로 옮겨 입력이 가능하도록 운영하는 큐로, 오버플로우를 방지하기 위한 큐의 이동을 실행한다. 그리고, 원형 큐는 가장 강력한 큐의 표현 방식으로, 1차 배열을 원형으로 생각하고, 유용 공간이 있을 경우 뒤(rear) 값만 변화시켜 유용 공간에 직접 삽입하는 데, 큐의 크기를 Q(1:n)에서 Q(0:n-1)로 변화시켜 양쪽을 연결시켜 주는 원형 구조이다.There are two types of queues: a moving queue and a circular queue. A moving queue is a queue that operates by inputting the entire contents of the queue when the rear reaches one end of the queue and the other end is empty. The queue moves to prevent overflow. And circular cue is the most powerful cue representation, and considers the primary array as circular, and inserts directly into useful space by changing only the rear value when there is useful space. It is a circular structure that connects both sides by changing from n) to Q (0: n-1).
이와 같은, 큐는 뒤(rear;마지막 포인터)와 앞(front;처음 프인터)이라는 큐 내의 지시자를 이용하여 삽입/삭제 과정을 수행하는 데, 기본적인 1차원 큐에서는 삽입시 뒤(rear)를 하나 증가하고, 삭제시에는 앞(front)을 하나 증가한다. 그리고, 원형 큐에서는 뒤(rear), 앞(front)만을 사용했을 때, 공백 상태와 오버플로우 상태를 나타낼 수 없으므로, 태그(tag) 변수를 사용하여 뒤와 앞이 같아질 때 공백이면 태그를 0으로, 오버플로우일 때는 태그를 1로 세팅한다.As such, the cue performs the insertion / deletion process using indicators in the queue called rear (the last pointer) and front (the first printer). Increment, and delete one by one the front. And since circular queues can't represent empty and overflow states when using only the front and the front, the tag is zero if the back and the front are the same using the tag variable. For overflow, set the tag to 1.
한편, 트리는 연결된 비순화 그래프의 일종으로, 1개 이상의 노드로 이루어진 유한 집합으로 루트 노드를 가지며 나머지 노드들은 분리 집합으로 분리되는 특성을 가진다.On the other hand, the tree is a kind of connected non-purified graph, which has a root node as a finite set of one or more nodes, and the remaining nodes have a property of being separated into a separate set.
이와 같은, 트리의 종류로는 순서 트리{레벨이 같은 노드들의 좌우 배열 순서의 위치가 고정되어 위치상의 의미가 중요한 트리(a>b)}와, 비순서 트리{위치상의 의미가 중요하지 않은 트리(a=b)}로 크게 구분된다. 또 다른 하나의 분류로는 닮은 트리(트리의 노드 수와 위치 등 구조는 같고 노드의 자료 부분만 다른 트리)와 대등한 트리(트리의 구조뿐만 아니라 동일한 위치에 동일한 자료를 가지고 있는 트리)로 구분할 수도 있다.As such types of trees, an order tree (a tree in which the positions of left and right arrays of nodes of the same level are fixed so that the positional meaning is important) (a> b) and an unordered tree {a tree whose positional meaning is not important (a = b)}. Another classification is to classify similar trees (trees with the same structure, such as the number and position of the nodes in the tree, but with different data parts of the nodes) into equivalent trees (trees with the same data in the same location as well as the structure of the tree). It may be.
전술한 바와 같이, 트리 자료 구조는 그 종류가 매우 다양한 데, 모든 트리에서 공통적으로 일어나는 삽입/삭제와 트리 구조의 변형 동작에 대해서만 살펴보면, 삽입시에는 트리 구조의 특성에 맞게 삽입할 노드의 위치를 검색하고, 그 위치에 데이터를 삽입한다. 그 후, 트리 구조의 나머지 자료 구조, 즉, 다른 노드와의연결 포인터를 해당 트리 구조에 맞게 연결한다. 이 때, 노드 오버플로우가 발생하면, 전체 트리의 구조를 변경해야 하는 오버헤드가 발생한다.As mentioned above, the tree data structure is very diverse. Looking only at the insertion / deletion and transformation operations of the tree structure, which are common to all trees, when inserting, the position of the node to be inserted is selected according to the characteristics of the tree structure. Search and insert data at that location. Then, connect the rest of the data structure of the tree structure, that is, the connection pointer with other nodes, to match the tree structure. At this time, when a node overflow occurs, the overhead of changing the structure of the entire tree occurs.
그리고, 삭제시에는 삭제할 노드를 검색하고, 그 데이터를 삭제하면 되는 데, 노드의 언더플로우가 발생하면, 전체 트리 구조를 변경해야 하는 오버헤드가 발생한다.When deleting, the node to be deleted is searched for and the data is deleted. When an underflow of the node occurs, an overhead of changing the entire tree structure occurs.
이상에서 하나의 프로세스에서 연관된 데이터들을 동적을 할당할 때, 데이터들의 관련성을 나타내는 자료 구조에 대해서 살펴봤는 데, 연결 리스트를 사용하여 대용량 데이터를 저장할 경우에는, 기억 장치 내 물리적인 분포가 산만하고, 각 데이터들이 리스트 상에서 정렬되어야 하기 때문에 프로세스의 속도를 현저히 저하시킨다.In the above, we looked at the data structure indicating the relevance of data when dynamically allocating the associated data in one process. When storing a large amount of data using a linked list, the physical distribution in the storage device is distracted, This slows down the process significantly because each piece of data must be sorted on the list.
그리고, 큐는 제한된 크기 내에서 사용해야 하는 전제 조건이 있는 데, 오버플로우/언더플로우 해결 방법이 존재하나, 무한대의 데이터 크기를 작성자가 프로그램 시에 숙지하기는 불가능하므로, 이론적으로 무한대로 증가하는 대용량 데이터에는 사용이 불가능하다.In addition, there is a precondition that queues should be used within a limited size. Although overflow / underflow solutions exist, it is impossible for a writer to know the infinite data size in a program, so the theoretically large capacity increases indefinitely. Not available for data.
그리고, 트리 구조는 대용량 데이터를 위해 사용하기에 가장 적절한 자료 구조지만, 트리 구조의 특성상 삽입/삭제 시에 발생하는 구조 변형(Rebalancing) 오버헤드가 있고, 한쪽으로 치우친(skewed) 상태에서는 동작 성능이 현저히 저하되는 단점을 가지고 있다.The tree structure is the most appropriate data structure to use for large data. However, due to the nature of the tree structure, there is a rebalancing overhead that occurs when inserting and deleting. In the skewed state, the performance is improved. It has the disadvantage of significantly deteriorating.
따라서, 실시간의 속도를 필요로 하는 주기억 장치 데이터베이스 관리 시스템에서는 대용량의 데이터를 주기억 장치에 상주시키면서 프로세스가 진행되어야하므로, 기존의 자료 구조를 그대로 사용할 수 없게 되는 문제점이 있다.Therefore, in a main memory device database management system requiring real-time speed, the process must proceed while resident a large amount of data in the main memory device, and thus there is a problem that the existing data structure cannot be used as it is.
본 발명은 전술한 문제점을 해결하기 위해 안출된 것으로서, 동적 할당의 기본 단위를 블록으로 지정하고, 각 블록의 주소를 계층적 구조로 연관시켜 관리함으로써, 대용량의 데이터를 주기억 장치에 상주시키면서 프로세스가 진행될 수 있도록 하는 주기억 장치 데이터베이스 관리 시스템의 자료 구조와 블록 할당 및 레코드 검색 방법을 제공함에 그 목적이 있다.SUMMARY OF THE INVENTION The present invention has been made to solve the above-described problem, and by designating a basic unit of dynamic allocation as a block and associating and managing addresses of each block in a hierarchical structure, a process can be performed while resident a large amount of data in a main memory device. The purpose of the present invention is to provide a data structure, a block allocation method and a record retrieval method of a main memory device database management system.
도 1 및 도 2는 본 발명에 따른 주기억 장치 데이터베이스 관리 시스템의 자료 구조를 보인 도.1 and 2 show the data structure of the main memory device database management system according to the present invention;
도 3은 본 발명에 따른 주기억 장치 데이터베이스 관리 시스템의 블록 할당 방법을 설명하기 위한 플로우챠트.3 is a flowchart for explaining a block allocation method of a main memory device database management system according to the present invention;
도 4는 본 발명에 따른 주기억 장치 데이터베이스 관리 시스템의 레코드 검색 방법을 설명하기 위한 플로우챠트.4 is a flowchart for explaining a record retrieval method of the main memory device database management system according to the present invention;
전술한 목적을 달성하기 위한 본 발명에 따른 주기억 장치 데이터베이스 관리 시스템의 자료 구조는, 동적 할당의 기본 단위를 블록으로 지정하고, 레벨이라는 계층적 구조를 이용하여 블록들의 주소를 연관시키되, 상기 레벨은 상위 레벨이 하위 레벨의 모든 데이터를 포함하는 기하급수적인 구조로 이루어진다.The data structure of the main memory device database management system according to the present invention for achieving the above object, designates the basic unit of dynamic allocation as a block, and associates the addresses of the blocks using a hierarchical structure called level, The upper level consists of an exponential structure that contains all the data of the lower levels.
여기서, 상기 블록의 크기는, 하나의 블록에 몇 개의 레코드를 담을 것인 가에 따라 결정되는 것을 특징으로 한다.In this case, the size of the block is determined according to how many records are contained in one block.
그리고, 상기 블록들은, 검색시 해당 블록을 가리키는 기준이 되는 포인터와; 각각의 레벨에 대한 레벨 정보와; 현재 최고의 레벨과; 하나의 블록에 들어가는 레코드의 수와; 하나의 레코드 크기를 포함하여 이루어지는 블록 정보에 의거하여 관리되는 것을 특징으로 한다.The blocks may include: a pointer which becomes a reference indicating the corresponding block when searching; Level information for each level; With the current highest level; The number of records in one block; And based on block information including one record size.
그리고, 상기 레벨 정보는, 하나의 레벨 노드 내에 비어 있는 블록의 수와; 하나의 레벨에 포함되는 레코드의 최대 수와; 해당 레벨에서 마지막으로 할당된 블록의 주소를 포함하여 이루어지는 것을 특징으로 한다.The level information may include: the number of empty blocks in one level node; The maximum number of records included in one level; It is characterized by including the address of the block last allocated in the level.
한편, 본 발명에 따른 주기억 장치 데이터베이스 관리 시스템의 블록 할당 방법은, 레벨 정보를 낮은 레벨부터 검사해서 비어있는 블록이 존재하는 레벨을 검색하고, 상기 블록에 저장될 레코드의 수를 정하고, 블록을 할당한 후, 할당된 블록의 주소를 루트라는 변수에 할당하는 과정과; 할당된 레벨의 존재 여부에 따라 할당된 레벨이 존재하지 않는 경우에는 레벨을 새로 할당하는 과정과; 할당된 레벨이 존재하는 경우에는 레벨의 증가 여부에 따라 레벨이 증가되는 경우에는 레벨을 증가시키는 과정과; 레벨이 증가되지 않는 경우에는 현재 레벨의 하위 레벨에서 마지막으로 할당된 블록 내에서 마지막으로 할당된 블록의 주소를 N에 4바이트를 곱한 값에 상기 할당된 블록의 주소를 더한 값으로 지정하는 과정과; 하위 레벨의 존재 여부에 따라 하위 레벨이 존재하는 경우에는 현재 레벨과 하위 레벨과의 연관 관계를 설정해주는 과정과; 하위 레벨이 존재하지 않는 경우에는 하위 레벨의 마지막 블록 주소를 상기 할당된 블록의 주소로 지정하는 과정을 포함하여 이루어진다.On the other hand, in the block allocation method of the main memory device database management system according to the present invention, the level information is checked from a low level to search for a level in which an empty block exists, determine the number of records to be stored in the block, and allocate the block. Then assigning an address of the allocated block to a variable called root; If the assigned level does not exist according to the existence of the assigned level, allocating a new level; Increasing the level when the level is increased according to whether the level is increased when there is an assigned level; If the level is not increased, the process of designating the address of the last allocated block in the last allocated block at the lower level of the current level as N multiplied by 4 bytes and the address of the allocated block; ; Setting an association relationship between the current level and the lower level when the lower level exists according to the existence of the lower level; If the lower level does not exist, the process includes designating the last block address of the lower level as the address of the allocated block.
여기서, 상기 레벨을 새로 할당하는 과정은, 블록 정보의 레벨을 1로 세팅하고, 포인터를 상기 루트라는 변수에 할당된 값으로 지정하고, 레벨1의 레벨 정보의 마지막 블록 주소를 상기 루트라는 변수에 할당된 값으로 지정하는 과정으로 이루어지는 것을 특징으로 한다.Here, the process of newly assigning the level may include setting the level of block information to 1, assigning a pointer to a value assigned to the variable named root, and assigning the last block address of the level information of level 1 to the variable named root. Characterized in that the process of specifying the assigned value.
그리고, 상기 레벨을 증가시키는 과정은, 블록 정보의 레벨을 1증가시키고,상기 증가된 레벨에 포함되는 빈 블록 수를 N-1로 설정하고, 상기 할당된 블록을 가리키는 기준이 되는 포인터를 기설정되어 있는 블록의 루트 값으로 지정하는 과정과; 상기 할당된 블록의 주소를 현재 레벨에서 사용하는 블록의 주소로 지정하고, 상기 할당된 블록의 주소를 상기 할당된 블록이 지시하는 블록의 루트로 지정하는 과정과; 현재 레벨의 하위 레벨에서 마지막으로 할당된 블록 내에서 마지막으로 할당된 블록의 주소를 N에 4바이트를 곱한 값에 상기 할당된 블록의 주소를 더한 값으로 지정하는 과정으로 이루어지는 것을 특징으로 한다.In the process of increasing the level, the level of block information is increased by one, the number of empty blocks included in the increased level is set to N-1, and a preset pointer that indicates the allocated block is set. Assigning the root value of the block; Designating an address of the allocated block as an address of a block used at a current level, and designating an address of the allocated block as a root of a block indicated by the allocated block; And a process of designating the address of the last allocated block in the last allocated block at the current level as N plus 4 bytes plus the address of the allocated block.
그리고, 상기 연관 관계를 설정해주는 과정은, 하위 레벨의 마지막 블록 주소를 상기 하위 레벨의 상위 레벨에서 마지막으로 할당된 블록의 주소로 지정하고, 상기 할당된 블록 내에서 할당된 블록의 주소를 N에 4바이트를 곱한 값에 상기 할당된 블록의 주소를 더한 값으로 지정하고, 상기 하위 레벨에 포함되는 빈 블록 수를 N-1로 설정하는 과정을 최하위 레벨의 상위 레벨까지 반복 수행하는 과정과; 최하위 레벨의 마지막 블록 주소를 상기 최하위 레벨의 상위 레벨에서 마지막으로 할당된 블록의 주소로 지정하는 과정으로 이루어지는 것을 특징으로 한다.The establishing of the association may include assigning a last block address of a lower level as an address of a block allocated last from a higher level of the lower level, and assigning an address of an allocated block to N in the allocated block. Assigning a value obtained by multiplying 4 bytes to an address of the allocated block and repeatedly setting the number of empty blocks included in the lower level to N-1 to a lower level higher level; And assigning the last block address of the lowest level to the address of the block allocated last from the upper level of the lowest level.
한편, 본 발명에 따른 주기억 장치 데이터베이스 관리 시스템의 레코드 검색 방법은, 검색하고자 하는 레코드의 인덱스를 최상위 레벨의 하위 레벨에서 포함할 수 있는 최대의 레코드 수로 나눈 연산의 몫을 인덱스로 하는 블록을 최상위 레벨에서 검색하는 과정과; 상기 연산의 나머지를 상기 인덱스에 대입하고, 상기 인덱스를 상기 하위 레벨의 다음 하위 레벨에서 포함할 수 있는 최대의 레코드 수로 나눈 연산의 몫을 인덱스로 하는 블록을 상기 하위 블록에서 검색하는 과정을 상기검색하고자 하는 레코드가 존재하는 블록을 찾을 때까지 한 단계씩 하위 레벨로 하향하면서 반복 수행하는 과정과; 최종적으로 상기 인덱스에 대입된 값, 레코드 크기, 최종 검색된 블록의 주소에 의거하여 검색 레코드의 주소를 산출하는 과정을 포함하여 이루어진다.On the other hand, the record retrieval method of the main memory device database management system according to the present invention, the top level of the block that is the index of the operation of dividing the index of the record to be searched by the maximum number of records that can be included in the lower level of the highest level Searching in; Retrieving a process of substituting the remainder of the operation into the index and searching for the block having the index of the quotient of the operation obtained by dividing the index by the maximum number of records that can be included in the next lower level of the lower level. Repeatedly performing the steps down to a lower level until a block in which a desired record exists is found; And finally calculating the address of the search record based on the value assigned to the index, the record size, and the address of the last searched block.
이하에서는 첨부한 도면을 참조하여 본 발명의 바람직한 실시예에 따른 주기억 장치 데이터베이스 관리 시스템의 자료 구조와 블록 할당 및 레코드 검색 방법에 대해서 상세하게 설명한다.Hereinafter, a data structure, a block allocation method, and a record retrieval method of a main memory device database management system according to an exemplary embodiment of the present invention will be described in detail with reference to the accompanying drawings.
도 1 및 도 2는 본 발명에 따른 주기억 장치 데이터베이스 관리 시스템의 자료 구조를 보인 도로, 본 발명에서는 동적 할당의 기본 단위를 블록으로 지정하고, 블록의 주소를 자료 구조의 기본 원소로 사용한다. 그리고, 레벨(level)이라는 계층적 구조를 이용하여 하위 노드부터 시작해서 상위 노드로 상향하는 연결 방식으로 전술한 블록들의 주소를 연관시킨다. 여기서, 레벨이라 함은, 계층이라는 개념을 통해서 상위 계층은 하위 계층의 모든 데이터를 포함하는 비선형적인 구조를 나타내는 것으로, 상위의 노드는 그 이하의 노드를 그대로 포함하며, 그 노드들이 상위 노드에서 계속 연속적으로 연결되고, 이들은 또한 그 이상의 상위 노드에 포함되는 것이다.1 and 2 are roads showing the data structure of the main memory database management system according to the present invention. In the present invention, the basic unit of dynamic allocation is designated as a block, and the address of the block is used as a basic element of the data structure. And, using the hierarchical structure of the level (level) to associate the address of the above-described blocks in a connection scheme starting from the lower node to the upper node. Here, the level, through the concept of hierarchy, refers to a nonlinear structure in which the upper layer includes all data of the lower layer, and the upper node includes the lower node as it is, and the nodes continue in the upper node. Are connected in series, and they are also included in more higher nodes.
그리고, 블록의 크기는, 릴레이션 내의 레코드들은 동일한 크기를 가지므로, 하나의 블록에 몇 개의 레코드를 담을 것인 가에 따라 결정되는 것으로, 수학식 1과 같은 공식으로 프로세스가 진행되는 플랫폼에 맞게 설정하면 된다.And, the size of the block is determined by how many records are contained in one block because the records in the relation have the same size. Just do it.
전술한 바와 같이, 본 발명에서는 릴레이션 내의 레코드를 하나의 블록에 기설정된 갯수만큼씩 저장함으로써, 데이터들의 부분 집합을 블록 단위로 연속하여 배치할 수 있게 되며, 동적 할당은 데이터들의 부분 집합인 블록을 지정할 때만 실행되므로, 동적 할당의 횟수가 블록 내의 레코드 수만큼 줄어들게 된다.As described above, in the present invention, by storing a predetermined number of records in a relation in one block, a subset of data can be continuously arranged in units of blocks, and dynamic allocation is a block that is a subset of data. Because it is executed only when specified, the number of dynamic allocations is reduced by the number of records in the block.
전술한 바와 같이, 동적으로 할당된 블록들은 블록 정보에 의거하여 관리되는 데, 블록 정보를 포함하는 구조체는 도 1에 도시하는 바와 같이, 루트(root)와, 레벨 정보(level_info)와, 레벨(levels)과, 블록내 레코드 수(records_in_block)와, 레코드 크기(recbuffer)를 포함하여 이루어진다.As described above, dynamically allocated blocks are managed based on block information. As shown in FIG. 1, a structure including block information includes root, level information (level_info), and level ( levels, records in blocks (records_in_block), and records size (recbuffer).
전술한, 루트(root)에는 검색시 해당 블록을 가리키는 기준이 되는 포인터가 저장되는 데, 이 값은 현재 레벨의 하위 레벨에 대한 레벨 정보의 마지막 블록 주소와 동일한 값을 갖는다.As described above, a pointer, which is a reference for a corresponding block when a search is stored, is stored in the root, and this value has the same value as the last block address of the level information for the lower level of the current level.
그리고, 레벨 정보(level_info)에는 각각의 레벨에 대한 정보가 저장되는 데, 최상위 레벨이 4라고 가정했을 때, 레벨1부터 레벨4까지에 대한 레벨 정보가 각각 저장된다.Information about each level is stored in the level information level_info. Assuming that the highest level is 4, level information for levels 1 to 4 is stored.
그리고, 레벨(levels)에는 현재 최고의 레벨이 저장되고, 블록내 레코드 수(records_in_block)에는 하나의 블록에 들어가는 레코드의 수가 저장되고, 레코드 크기(recbuffer)에는 하나의 레코드의 크기가 저장된다.The current highest level is stored in the levels, the number of records in one block is stored in the number of records in the block (records_in_block), and the size of one record is stored in the record size (recbuffer).
전술한 바와 같은, 블록 정보에 대해서 정의하면 다음과 같다.As described above, block information is defined as follows.
그리고, 블록 정보의 구성 요소인 레벨 정보는 하나의 레벨 노드 내에 비어 있는 블록 수를 나타내는 빈 블록 수(free_ptrs_in_block)와, 하나의 레벨에 포함되는 레코드의 최대 수를 나타내는 레코드 수(records_under_level)와, 마지막으로 할당된 블록의 시작 주소를 나타내는 마지막 블록 주소(last_blocks)를 포함하여 이루어지는 데, 이와 같은, 레벨 정보에 대해서 정의하면 다음과 같다.The level information, which is a component of the block information, includes the number of free blocks (free_ptrs_in_block) indicating the number of empty blocks in one level node, the number of records (records_under_level) indicating the maximum number of records included in one level, and last. It includes the last block address (last_blocks) indicating the start address of the block allocated as, if the level information is defined as follows.
전술한 바와 같은, 블록 정보는 블록이 할당될 때마다 변경되는 것으로, 블록 할당 시에 레벨이 레벨1에서 레벨2로 증가되는 경우에는 도 1에 도시하는 바와 같이, 레벨이 레벨1에서 레벨2로 증가함에 따라, 검색시 블록을 가리키는 기준이 되는 루트 값이 변경되는 데, 이 루트 값은 레벨2의 레벨 정보(level_info[1])의 마지막 블록 주소와 동일한 값으로, 레벨이 증가하지 않는 한 변하지 않는다.As described above, the block information is changed every time a block is allocated. When the level is increased from level 1 to level 2 at the time of block allocation, the level is changed from level 1 to level 2, as shown in FIG. As it increases, the root value that becomes a reference to the block during the search changes, which is the same value as the last block address in level 2's level information (level_info [1]), which does not change unless the level is increased. Do not.
한편, 본 발명에서는 도 2에 도시하는 하는 바와 같이, 레벨이라는 계층적 구조를 이용하여 하위 노드부터 시작해서 상위 노드로 상향하는 연결 방식으로 전술한 블록들의 주소를 연관시키는 데, 블록의 주소를 저장하는 자료 구조를 정의하면 다음과 같다.On the other hand, in the present invention, as shown in Figure 2, using the hierarchical structure of the level to associate the address of the above-described blocks in a connection method starting from the lower node to the upper node, the address of the block is stored The data structure defined is as follows.
그리고, 레벨1(1_level)의 노드가 N개의 원소를 가진다고 가정했을 때, 레벨2(2_level)의 노드는 레벨1(1_level)의 노드들이 원소가 되는 N개의 원소를 가지게 되고, 레벨3(3_level)의 노드는 레벨2(2_level)의 노드들이 원소가 되는 N개의 원소를 가지고, 그 이상의 레벨들에도 동일하게 적용되므로, 이를, 수학식으로 나타내면, 수학식 2와 같다.In addition, assuming that a node of level 1 (1_level) has N elements, a node of level 2 (2_level) has N elements in which nodes of level 1 (1_level) are elements, and level 3 (3_level). Node of level 2 has N elements as elements, and the same applies to more levels. Therefore, this is represented by Equation 2 below.
수학식 2에서, 레벨K(K_level)에서 Nk이라는 것은 현재 레벨 수준에서 저장 가능한 최대의 데이터 수가 Nk개라는 것이다. 그러나, 여기서 주의할 것은 K번째 레벨은 Nk개의 데이터 크기(Nk개*데이터 크기) 만큼을 할당하고 데이터들을 그 위치로 복사하는 것이 아니라, 레벨K에서 저장 가능한 최대의 데이터 수가 Nk개이고, 동적 할당은 블록 단위로 이루어진다는 것이다. 그리고, 각 레벨에 저장되는 정보는 데이터가 아니라 그 레벨에 속하는 블록들의 첫 번지를 나타내고, 그 블록들이 하위 레벨들의 블록들을 포함한다.In equation (2), it is called N k at level K (K_level) is that the maximum number of data that can be stored in the current level one level N k. However, where it is the K-th level to note is not to assign as N k of the data size (N k dog * data size), and copies the data to that location, the maximum number of data that can be stored in the level K N k pieces, Dynamic allocation is done on a block basis. The information stored in each level is not data but represents the first address of blocks belonging to the level, and the blocks include blocks of lower levels.
도 3은 본 발명에 따른 주기억 장치 데이터베이스 관리 시스템의 블록 할당 방법을 설명하기 위한 플로우챠트이다.3 is a flowchart illustrating a block allocation method of a main memory device database management system according to the present invention.
우선, 레코드를 저장하기 위해 블록을 할당하고자 하는 경우에는 각 레벨의레벨 정보(level_info[i])에 포함되어 있는 빈 블록 수(free_ptrs_in_block)를 낮은 레벨부터 검사해서 빈 블록이 존재하는 레벨, 즉, 빈 블록 수(free_ptrs_in_block)가 0이 아닌 레벨을 검색한다(S10).First, when a block is to be allocated to store a record, the number of free blocks (free_ptrs_in_block) included in the level information (level_info [i]) of each level is checked from a low level, that is, a level where free blocks exist. The free block number free_ptrs_in_block is searched for a level other than 0 (S10).
상기한 과정 S10에서 각각의 레벨 정보(level_info[i])를 표현할 때 사용되는 인덱스 i는 레벨-1의 값으로, 레벨1의 레벨 정보는 level_info[0]으로 표현되고, 레벨2의 레벨 정보는 level_info[1]로 표현된다.The index i used to express each level information level_info [i] in step S10 is expressed as a value of level-1, the level information of level1 is represented by level_info [0], and the level information of level2 is represented by It is represented by level_info [1].
이후, 상기한 과정 S10에서 검색된 레벨에 존재하는 빈 블록에 저장될 레코드 수를 정하고, 블록을 할당한 후, 할당된 블록의 시작 주소를 루트(root)라는 변수에 할당한다(S12).Thereafter, the number of records to be stored in an empty block existing at the level retrieved in step S10 is determined, the block is allocated, and then the start address of the allocated block is assigned to a variable called root (S12).
이후, 할당되어 있는 레벨이 존재하는 지, 즉, 상기한 과정 S12에서의 블록 할당이 최초의 블록 할당인 지를 판단한다(S14).Then, it is determined whether there is an allocated level, that is, whether the block allocation in the above-described process S12 is the first block allocation (S14).
상기한 과정 S14의 판단결과 할당된 레벨이 존재하지 않는 경우, 즉, 상기한 과정 S12에서의 블록 할당이 최초의 블록 할당인 경우에는, 레벨을 1로 세팅하고(S16), 블록 정보의 변수 루트(root)를 상기한 과정 S12에서 루트(root)라는 변수에 할당한 값으로 지정하고(block->root=root), 블록 정보의 변수 레벨1 정보의 마지막 블록 주소(last_blocks)를 상기한 과정 S12에서 루트(root)라는 변수에 할당한 값으로 지정(block->level_info[0].last_blocks=root)한다(S18).In the case where the allocated level does not exist, that is, when the block allocation in the above-mentioned process S12 is the first block allocation, the level is set to 1 (S16), and the variable root of the block information is determined. (root) is assigned to the value assigned to the variable root ( root ) in step S12 described above (block-> root = root ), and the process S12 recalling the last block address (last_blocks) of variable level 1 information of the block information. Assign to the value assigned to the variable root ( root ) in (block-> level_info [0] .last_blocks = root ) (S18).
예를 들어, 상기한 과정 S12에서 할당된 블록의 주소가 16진수로 4e2a0이라고 가정했을 때, 도 1에 도시하는 바와 같이, 변수 루트(root)는 4e2a0으로 지정되고, 레벨1의 마지막 블록 주소(level_info[0].last_blocks)도 4e2a0으로 지정된다.For example, assuming that the address of the block allocated in step S12 described above is 4e2a0 in hexadecimal, as shown in FIG. 1, the variable root is designated as 4e2a0 and the last block address of level 1 ( level_info [0] .last_blocks) is also designated 4e2a0.
한편, 상기한 과정 S14의 판단결과 할당된 레벨이 존재하는 경우, 즉, 상기한 과정 S12에서의 블록 할당이 최초의 블록 할당이 아닌 경우에는, 상기한 과정 S10에서 검색된 레벨의 인덱스 i와 블록 정보에 포함되어 있는 변수 레벨(levels)이 서로 동일한 지, 즉, 레벨이 증가되어야 하는 지를 판단한다(S20).On the other hand, if there is an allocated level as a result of the determination in step S14, that is, when the block allocation in step S12 is not the first block allocation, the index i and the block information of the level retrieved in step S10 are found. It is determined whether the variable levels included in are the same, that is, whether the level should be increased (S20).
상기한 과정 S20의 판단결과 상기한 과정 S10에서 검색된 레벨의 인덱스 i와 블록 정보에 포함되어 있는 변수 레벨(levels)이 서로 동일한 경우, 즉, 레벨이 증가되어야 하는 경우에는, 블록 정보에 포함되어 있는 변수 레벨(levels)의 값을 상기한 과정 S10에서 검색된 레벨의 인덱스 i보다 1 큰 값으로 지정하고(block->levels=i+1), 인덱스 i에 해당하는 레벨 정보(level_info[i])의 빈 블록 수(free_ptrs_in_block)를 N-1(한 레벨의 노드가 N개의 원소를 가진다고 가정했을 때, 이미 하나의 블록은 할당되어 있으므로, 비어 있는 블록은 N-1이 된다)로 설정하고(block->level_info[i].free_ptrs_in_block=N-1), 상기한 과정 S12에서 할당된 블록을 검색할 때 해당 블록을 가리키는 기준이 되는 포인터를 블록 정보 내의 변수 루트로 지정{(PTRS**)root[0]=block->root)}한다. 그리고, 상기한 과정 S12에서 할당된 블록을 레벨 내에서 검색할 때 사용하는 블록의 주소를 상기한 과정 S12에서 할당된 블록의 주소(root)로 지정하고(block->root=root), 상기한 과정 S12에서 할당된 블록이 지시하는 블록의 루트를 인덱스가 i인 레벨 정보의 마지막 블록 주소로 지정(block->root=block->level_info[i].last_blocks=root++)한다(S22).As a result of the determination of step S20, when the index i of the level retrieved in step S10 and the variable levels included in the block information are the same, that is, when the level should be increased, the block information included in the block information is included. The value of the variable levels is set to a value 1 greater than the index i of the level retrieved in step S10 (block-> levels = i + 1), and the level information (level_info [i]) corresponding to the index i is set. Set the number of free blocks (free_ptrs_in_block) to N-1 (assuming a level node has N elements, one block is already allocated, so an empty block becomes N-1) (block- > level_info [i] .free_ptrs_in_block = N-1), when retrieving a block allocated in the above step S12, designates a pointer to the block as a variable root in the block information {(PTRS **) root [0 ] = block-> root)}. In addition, the address of the block used when searching for the block allocated in step S12 within the level is designated as the address (root) of the block allocated in step S12 (block-> root = root ). In step S12, the root of the block indicated by the allocated block is designated as the last block address of the level information having the index i (block-> root = block-> level_info [i] .last_blocks = root ++) (S22).
이후에는, 인덱스가 i인 레벨에서 마지막으로 할당된 블록 내에서 마지막으로 할당된 블록의 주소를 N(한 레벨의 노드가 N개의 원소를 가진다고 가정했을 때)에 4바이트를 곱한 값에 상기한 과정 S12에서 할당된 블록의 주소(root)를 더한 값으로 지정{block->level_info[i].last_blocks->blocks[M]=(byte*)root}한다(S24).Subsequently, the process described above is multiplied by 4 bytes multiplied by N (assuming that a node at one level has N elements) of the address of the last allocated block in the last allocated block at the level at index i. {Block-> level_info [i] .last_blocks-> blocks [M] = (byte *) root} by adding the address (root) of the block allocated in S12 (S24).
한편, 상기한 과정 S20의 판단결과 상기한 과정 S10에서 검색된 레벨의 인덱스 i와 블록 정보에 포함되어 있는 변수 레벨(levels)이 서로 동일하지 않은 경우, 즉, 레벨이 증가되지 않아도 되는 경우에는, 상기한 과정 S24로 진행하여 인덱스가 i인 레벨에서 마지막으로 할당된 블록 내에서 마지막으로 할당된 블록의 주소를 N(한 레벨의 노드가 N개의 원소를 가진다고 가정했을 때)에 4바이트를 곱한 값에 상기한 과정 S12에서 할당된 블록의 주소(root)를 더한 값으로 지정{block->level_info[i].last_blocks->blocks[N]=(byte*)root}한다.On the other hand, when the determination result of the step S20 is that the index i of the level retrieved in the step S10 and the variable levels included in the block information are not the same, that is, the level does not need to be increased, Proceeding to step S24, the address of the last allocated block in the last allocated block at the level at index i is multiplied by 4 bytes by N (assuming that a node at a level has N elements). {Block-> level_info [i] .last_blocks-> blocks [N] = (byte *) root} by adding the address (root) of the block allocated in the above step S12.
이후에는, 상기한 과정 S12에서 할당된 블록과 해당 블록에 속하는 하위 레벨의 블록과의 연관 관계를 설정해줘야 하는 데, 우선, 인덱스 i보다 1작은 값인 j가 0보다 큰 지, 즉, 하위 레벨의 블록이 존재하는 지를 판단한다(S26).After that, it is necessary to set an association relationship between the block allocated in step S12 and a block of a lower level belonging to the block. First, j, which is a value smaller than index i, is greater than 0, that is, It is determined whether a block exists (S26).
상기한 과정 S26의 판단결과 j가 0보다 큰 경우, 즉, 하위 레벨의 블록이 존재하는 경우에는, 블록 정보의 변수 레벨[j] 정보의 마지막 블록 주소를 현재 레벨에서 할당된 블록의 주소로 지정하고(block->level_info[j].last_blocks=root++), 인덱스가 j인 레벨에서 마지막으로 할당된 블록 내에서 마지막으로 할당된 블록의 주소를 N에 4바이트를 곱한 값에 상기한 과정 S12에서 할당된 블록의 주소(root)를 더한 값으로 지정하고{block->level_info[j].last_blocks->blocks[0]=(byte*)root}, 블록 정보의 변수 레벨[j] 정보의 빈 블록 수를 N-1로 설정하고(block->level_info[j].free_ptrs_in_block=N-1)(S28), j를 1감소시킨후(S30), j가 0보다 크지 않을 때까지 상기한 과정 S28 내지 과정 S30를 반복 수행한다.When j is greater than 0 as a result of the determination in step S26, that is, when there is a block of a lower level, the last block address of variable level [j] information of the block information is designated as the address of the block allocated at the current level. (Block-> level_info [j] .last_blocks = root ++), and in step S12, the address of the last allocated block in the last allocated block at the level with index j is multiplied by N multiplied by 4 bytes. {Block-> level_info [j] .last_blocks-> blocks [0] = (byte *) root}, and the number of free blocks of variable level [j] information of the block information. Is set to N-1 (block-> level_info [j] .free_ptrs_in_block = N-1) (S28), and j is decreased by 1 (S30), and the above process S28 to process j is not greater than 0. Repeat S30.
한편, 상기한 과정 S26의 판단결과 j가 0보다 크지 않은 경우, 즉, 하위 레벨의 블록이 존재하지 않는 경우에는, 블록 정보의 변수 레벨1 정보의 마지막 블록 주소를 최하위 레벨에서 마지막으로 할당된 블록의 주소로 지정(block->level_info[0].last_block=root)한다(S32).On the other hand, when j is not greater than 0 as a result of the determination in step S26, that is, when there is no lower level block, the last block address of the last block address of variable level 1 information of the block information is allocated at the lowest level. Specify the address (block-> level_info [0] .last_block = root) (S32).
예를 들어, 할당된 블록의 어드레스가 10000이고, 블록 정보의 레벨과 비어있는 블록이 존재하는 레벨의 인덱스 i가 모두 3이고, 블록 정보의 루트가 50000이라고 가정했을 때, 블록 정보의 레벨은 4(=3+1)로 변경되고, 블록 정보의 인덱스 3에 해당하는 레벨 정보(level_info[3])의 빈 블록 수(free_ptrs_in_block)는 127(한 레벨의 노드가 128개의 원소를 가진다고 가정했을 때, 이미 하나의 블록은 할당되어 있으므로, 비어 있는 블록은 127이 된다)로 설정된다.For example, assuming that the address of the allocated block is 10000, the index i of the level of the block information and the level where the empty block exists is 3, and the root of the block information is 50000, the level of the block information is 4 Is changed to (= 3 + 1), and the number of free blocks (free_ptrs_in_block) of the level information level_info [3] corresponding to index 3 of the block information is 127 (assuming that a node of one level has 128 elements, Since one block is already allocated, an empty block becomes 127).
그리고, 블록 정보 내의 변수 루트는 50000으로 지정되고, 레벨에서 사용하는 블록의 주소로 10000이 지정되고, 할당된 블록이 지시하는 블록의 루트는 인덱스가 3인 레벨의 마지막 블록 주소이자 할당된 블록의 주소보다 1단계 증가된 값인 10512(=128*4+10000)로 지정되고, 인덱스가 3인 레벨에서 마지막으로 할당된 블록 내에서 마지막으로 할당된 블록의 주소는 10512(=128*4+10000)로 지정된다.Then, the variable root in the block information is designated as 50000, 10000 is designated as the address of the block used in the level, and the root of the block indicated by the allocated block is the last block address of the level having an index of 3 and the assigned block. It is specified as 10512 (= 128 * 4 + 10000), which is a step incremented from the address, and the address of the last allocated block within the last allocated block at the level with index 3 is 10512 (= 128 * 4 + 10000). It is designated as.
이후, 하위 레벨과의 연관 관계를 설정해주기 위해 인덱스 2에 해당하는 레벨 정보(level_info[2])의 마지막 블록 주소를 10000으로 지정하고, 인덱스가 2인 레벨에서 마지막으로 할당된 블록 내에서 마지막으로 할당된 블록의 주소를10512(=128*4+10000)로 지정하고, 빈 블록 수를 127로 설정한다.Then, the last block address of level information (level_info [2]) corresponding to index 2 is set to 10000 to establish an association with the lower level, and finally, the last block in the last allocated block at the level having index 2 Set the address of the allocated block to 10512 (= 128 * 4 + 10000), and set the number of free blocks to 127.
그리고, 인덱스 1에 해당하는 레벨 정보(level_info[1])의 마지막 블록 주소를 10512로 지정하고, 인덱스가 2인 레벨에서 마지막으로 할당된 블록 내에서 마지막으로 할당된 블록의 주소를 11024(=128*4+10512)로 지정하고, 빈 블록 수를127로 설정한다.Then, the last block address of the level information (level_info [1]) corresponding to index 1 is designated as 10512, and the address of the last allocated block in the last allocated block at the level of index 2 is 11024 (= 128). 4 + 10512), and sets the number of free blocks to 127.
그리고, 인덱스 0에 해당하는 레벨 정보(level_info[0])의 마지막 블록 주소를 11024로 지정한다.The last block address of level information (level_info [0]) corresponding to index 0 is designated as 11024.
도 4는 본 발명에 따른 주기억 장치 데이터베이스 관리 시스템의 레코드 검색 방법을 설명하기 위한 플로우챠트이다.4 is a flowchart illustrating a record retrieval method of the main memory device database management system according to the present invention.
우선, 검색하고자 하는 레코드의 인덱스 m을 최상위 레벨의 하위 레벨에서 포함할 수 있는 최대의 레코드 수로 나눈 연산의 몫을 인덱스로 하는 블록을 최상위 레벨에서 찾는다(S40).First, a block whose index is the quotient of the operation obtained by dividing the index m of the record to be searched by the maximum number of records that can be included in the lower level of the highest level is found at the highest level (S40).
상기한 과정 S40의 연산 결과로 얻어진 나머지를 m에 대입하고, m을 그 다음 하위 레벨에서 포함할 수 있는 최대의 레코드 수로 나눈 연산의 몫을 인덱스로 하는 블록을 하위 레벨에서 찾는다(S42).Substituting the remainder obtained as a result of the operation of step S40 into m, a block is indexed at a lower level where the quotient of the operation obtained by dividing m by the maximum number of records that can be included in the next lower level is indexed (S42).
상기한 검색 레코드가 존재하는 블록을 찾을 때까지 한 단계씩 하위 레벨로 하향하면서 상기한 과정 S42를 반복 수행한다(S44).The process S42 is repeatedly performed while descending to a lower level by one step until a block in which the search record exists is found (S44).
전술한 바와 같이, 상기한 과정 S40 내지 과정 S44를 통해 검색될 레코드가 위치하는 블록을 찾은 후에는, 최종 검색된 블록의 시작 주소, 최종적으로 m에 대입된 나머지 값, 레코드 크기에 의거하여 검색 레코드의 주소를 산출하는 데(S46),검색 레코드의 주소는 최종적으로 남은 나머지 m에 레코드 크기를 곱한 값에 최종 검색된 블록의 시작 주소를 더한 값이 된다.As described above, after locating the block where the record to be searched is located through the process S40 to S44, the search record is based on the start address of the last searched block, the remaining values finally substituted into m, and the record size. In calculating the address (S46), the address of the search record becomes the value obtained by multiplying the record size by the remaining remaining m and adding the start address of the last searched block.
예를 들어, 레벨1에 포함될 수 있는 레코드의 최대 수가 10이고, 레벨2에 포함될 수 있는 레코드의 최대 수가 100이고, 레벨3에 포함될 수 있는 레코드의 최대 수가 1000이고, 레벨4에 포함될 수 있는 레코드의 최대 수가 10000이고, 현재 최상위 레벨이 레벨4라고 가정했을 때, 일예로 1234번째로 저장된 레코드의 주소를 알고 싶을 경우에는, 검색하고자 하는 레코드의 위치 인덱스[1234]를 현재 최상위 레벨인 레벨4의 하위 레벨인 레벨3에서 포함할 수 있는 최대의 레코드 수[1000]로 나눈 몫[1]을 인덱스로 하는 블록[레벨4의 1번 블록]을 찾고, 그 나머지[234]를 레벨3의 하위 레벨인 레벨2에서 포함할 수 있는 최대의 레코드 수[100]로 나눈 몫[2]을 인덱스로 하는 블록[레벨3의 2번 블록]을 찾고, 그 나머지[34]를 레벨2의 하위 레벨인 레벨1에서 포함할 수 있는 최대의 레코드 수[10]로 나눈 몫[3]을 인덱스로 하는 블록[레벨2의 3번 블록]을 찾는 과정을 수행하여 검색될 레코드가 존재하는 블록을 찾게 된다.For example, the maximum number of records that can be included in level 1 is 10, the maximum number of records that can be included in level 2 is 100, the maximum number of records that can be included in level 3 is 1000, and the records can be included in level 4 Assuming that the maximum number of times is 10000 and the current top level is level 4, for example, to find the address of the 1234th stored record, the position index [1234] of the record to be searched is set to the level 4 of the current top level. Find the block [block 1 of level 4] indexed by the quotient [1] divided by the maximum number of records [1000] that can be contained at the lower level, Level 3, and the rest [234] as the lower level of Level 3. Find the block [block 2 of level 3] indexed by the quotient [2] divided by the maximum number of records [100] that can be included in level 2, and the rest [34] to be the lower level of level 2. Maximum level that can be included in 1 DE can and finds a block Levels # 3 of the block; Seeking blocks containing the record to be searched exists by performing the process of the quotient [3], divided by the index [10].
그리고, 그 나머지[4]는 검색된 블록 내에서 검색될 레코드가 몇 번째에 존재하는 가를 나타내므로, 레벨2의 3번 블록의 시작 주소가 50000이고, 레코드의 크기가 40이라고 가정했을 때, 검색 레코드의 주소는 나머지[4]에 레코드 크기[40]를 곱한 값[160]에 검색된 블록의 시작 주소[50000]를 더한 값[50160]이 된다.Since the rest [4] indicates how many records exist to be searched in the searched block, it is assumed that the start address of block 3 of level 2 is 50000 and the record size is 40. The address of is equal to the remainder [4] multiplied by the record size [40] plus the start address [50000] of the retrieved block [50160].
타예로 2000번째로 저장된 레코드의 주소를 알고 싶을 경우에는, 검색하고자 하는 레코드의 위치 인덱스[2000]을 현재 최상위 레벨인 레벨4의 하위 레벨인레벨3에서 포함할 수 있는 최대의 레코드 수[1000]로 나눈 몫[2]을 인덱스로 하는 블록[레벨4의 2번 블록]을 찾고, 그 나머지[0]을 레벨3의 하위 레벨인 레벨2에서 포함할 수 있는 최대의 레코드 수[100]로 나눈 몫[0]을 인덱스로 하는 블록[레벨3의 0번 블록]을 찾고, 그 나머지[0]를 레벨2의 하위 레벨인 레벨1에서 포함할 수 있는 최대의 레코드 수[10]로 나눈 몫[0]을 인덱스로 하는 블록[레벨2의 0번 블록]을 찾는 과정을 수행하여 검색될 레코드가 존재하는 블록을 찾게 된다.For example, if you want to know the address of the 2000th stored record, the maximum number of records that can contain the position index [2000] of the record to be searched at level 3, which is a lower level of level 4, which is the current highest level [1000]. Find the block [block 2 of level 4] indexed by the quotient [2] divided by. The remainder [0] divided by the maximum number of records [100] that can be included in level 2, the lower level of level 3. Find the block [block 0 of level 3] with index [0] and divide the remainder [0] by the maximum number of records [10] that can be included in level 1, which is a lower level of level 2. A block [block 0 of level 2] whose index is 0] is searched to find a block in which a record to be searched exists.
그리고, 그 나머지[0]는 검색된 블록 내에서 검색될 레코드가 몇 번째에 존재하는 가를 나타내므로, 레벨2의 0번 블록의 시작 주소가 10000이고, 레코드의 크기가 40이라고 가정했을 때, 검색 레코드의 주소는 나머지[0]에 레코드 크기[40]를 곱한 값[0]에 검색된 블록의 시작 주소[10000]를 더한 값[10000]이 된다.Since the rest [0] indicates how many records exist to be searched in the searched block, it is assumed that the start address of block 0 of level 2 is 10000 and the size of the record is 40. The address of is equal to [1000] obtained by multiplying the record size [40] by the remaining [0] and the starting address [10000] of the searched block.
본 발명의 주기억 장치 데이터베이스 관리 시스템의 자료 구조와 블록 할당 및 레코드 검색 방법은 전술한 실시예에 국한되지 않고 본 발명의 기술 사상이 허용하는 범위 내에서 다양하게 변형하여 실시할 수 있다.The data structure, block allocation, and record retrieval method of the main memory device database management system of the present invention are not limited to the above-described embodiments, and various modifications can be made within the scope of the technical idea of the present invention.
이상에서 설명한 바와 같은 본 발명의 주기억 장치 데이터베이스 관리 시스템의 자료 구조와 블록 할당 및 레코드 검색 방법에 따르면, 동적 할당의 기본 단위를 블록으로 지정하고, 각 블록의 주소를 계층적 구조로 연관시켜 관리함으로써, 데이터들의 부분 집합을 블록 단위로 연속하여 배치할 수 있게 되며, 동적 할당의 횟수가 블록 내의 레코드 수만큼 줄어들게 된다.According to the data structure and the block allocation and record retrieval method of the main memory database management system of the present invention as described above, by designating the basic unit of dynamic allocation as a block, by managing the address of each block in a hierarchical structure As a result, a subset of the data can be arranged in blocks, and the number of dynamic allocations is reduced by the number of records in the block.
따라서, 개별적으로 데이터를 조작하는 종래에 비해 오버헤드를 줄일 수 있게 된다.Therefore, overhead can be reduced as compared with the conventional method of manipulating data individually.
그리고, 블록 주소를 계층적 구조로 관리함으로써, 데이터 검색 및 포인터 관리가 간단해져 성능 및 속도가 향상된다.In addition, by managing block addresses in a hierarchical structure, data retrieval and pointer management are simplified, thereby improving performance and speed.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020010075262A KR20030044498A (en) | 2001-11-30 | 2001-11-30 | Data Structure, Block Assignment and Record Retrieval Method of Main Memory DataBase Management System |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020010075262A KR20030044498A (en) | 2001-11-30 | 2001-11-30 | Data Structure, Block Assignment and Record Retrieval Method of Main Memory DataBase Management System |
Publications (1)
Publication Number | Publication Date |
---|---|
KR20030044498A true KR20030044498A (en) | 2003-06-09 |
Family
ID=29572272
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020010075262A Ceased KR20030044498A (en) | 2001-11-30 | 2001-11-30 | Data Structure, Block Assignment and Record Retrieval Method of Main Memory DataBase Management System |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR20030044498A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100899147B1 (en) * | 2007-05-04 | 2009-05-27 | 한양대학교 산학협력단 | Meta data storage method and metadata storage system |
KR101134557B1 (en) * | 2010-12-23 | 2012-04-13 | 한전케이디엔주식회사 | Data transfer method using interrupt operation and intelligent electronic device using thereof |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS61141035A (en) * | 1984-12-14 | 1986-06-28 | Hitachi Ltd | Data retrieval system |
US5359724A (en) * | 1992-03-30 | 1994-10-25 | Arbor Software Corporation | Method and apparatus for storing and retrieving multi-dimensional data in computer memory |
US5752243A (en) * | 1993-10-20 | 1998-05-12 | Microsoft Corporation | Computer method and storage structure for storing and accessing multidimensional data |
KR20010022028A (en) * | 1997-07-21 | 2001-03-15 | 클라스 노린, 쿨트 헬스트룀 | Structure for a data-base |
KR20010064226A (en) * | 1999-12-27 | 2001-07-09 | 오길록 | Compacting, searching and insert method reflecting memory hierarchy |
-
2001
- 2001-11-30 KR KR1020010075262A patent/KR20030044498A/en not_active Ceased
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS61141035A (en) * | 1984-12-14 | 1986-06-28 | Hitachi Ltd | Data retrieval system |
US5359724A (en) * | 1992-03-30 | 1994-10-25 | Arbor Software Corporation | Method and apparatus for storing and retrieving multi-dimensional data in computer memory |
US5752243A (en) * | 1993-10-20 | 1998-05-12 | Microsoft Corporation | Computer method and storage structure for storing and accessing multidimensional data |
KR20010022028A (en) * | 1997-07-21 | 2001-03-15 | 클라스 노린, 쿨트 헬스트룀 | Structure for a data-base |
KR20010064226A (en) * | 1999-12-27 | 2001-07-09 | 오길록 | Compacting, searching and insert method reflecting memory hierarchy |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100899147B1 (en) * | 2007-05-04 | 2009-05-27 | 한양대학교 산학협력단 | Meta data storage method and metadata storage system |
KR101134557B1 (en) * | 2010-12-23 | 2012-04-13 | 한전케이디엔주식회사 | Data transfer method using interrupt operation and intelligent electronic device using thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11238098B2 (en) | Heterogenous key-value sets in tree database | |
CN110383261B (en) | Stream selection for multi-stream storage | |
US7647355B2 (en) | Method and apparatus for increasing efficiency of data storage in a file system | |
US20200334294A1 (en) | Merge tree modifications for maintenance operations | |
US4611272A (en) | Key-accessed file organization | |
EP1364314B1 (en) | Method of organising, interrogating and navigating a database | |
US6952730B1 (en) | System and method for efficient filtering of data set addresses in a web crawler | |
EP0408070B1 (en) | Method for allocating real pages to virtual pages having different page sizes therefrom | |
US6842826B1 (en) | Method and apparatus for providing efficient management of least recently used (LRU) algorithm insertion points corresponding to defined times-in-cache | |
US6874062B1 (en) | System and method for utilizing a hierarchical bitmap structure for locating a set of contiguous ordered search items having a common attribute | |
JPH0883210A (en) | Device provided with electronic data processing device | |
US7752206B2 (en) | Method and data processing system for managing a mass storage system | |
US7330956B1 (en) | Bucket based memory allocation | |
JP2001142752A (en) | Database management method | |
KR100907477B1 (en) | Apparatus and method for managing index information of data stored in flash memory | |
JPH08129551A (en) | Hash method | |
CN108804571B (en) | Data storage method, device and equipment | |
KR20030044498A (en) | Data Structure, Block Assignment and Record Retrieval Method of Main Memory DataBase Management System | |
EP0117906B1 (en) | Key-accessed file organization | |
EP0905619A2 (en) | A list management system and method | |
CN114706849B (en) | Data retrieval method and device and electronic equipment | |
JP2874810B2 (en) | Key memory allocation method | |
EA005269B1 (en) | Organising data in a database | |
JP3929269B2 (en) | Data processing method and apparatus | |
KR100256678B1 (en) | Method of management directory for the partitioned signature file |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
PA0109 | Patent application |
Patent event code: PA01091R01D Comment text: Patent Application Patent event date: 20011130 |
|
PA0201 | Request for examination | ||
N231 | Notification of change of applicant | ||
PN2301 | Change of applicant |
Patent event date: 20020614 Comment text: Notification of Change of Applicant Patent event code: PN23011R01D |
|
PG1501 | Laying open of application | ||
E902 | Notification of reason for refusal | ||
PE0902 | Notice of grounds for rejection |
Comment text: Notification of reason for refusal Patent event date: 20031030 Patent event code: PE09021S01D |
|
E601 | Decision to refuse application | ||
PE0601 | Decision on rejection of patent |
Patent event date: 20040713 Comment text: Decision to Refuse Application Patent event code: PE06012S01D Patent event date: 20031030 Comment text: Notification of reason for refusal Patent event code: PE06011S01I |