WO2013035287A1 - Database management device, database management method, and program - Google Patents

Database management device, database management method, and program Download PDF

Info

Publication number
WO2013035287A1
WO2013035287A1 PCT/JP2012/005519 JP2012005519W WO2013035287A1 WO 2013035287 A1 WO2013035287 A1 WO 2013035287A1 JP 2012005519 W JP2012005519 W JP 2012005519W WO 2013035287 A1 WO2013035287 A1 WO 2013035287A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
hierarchy
belonging
tree
nodes
Prior art date
Application number
PCT/JP2012/005519
Other languages
French (fr)
Japanese (ja)
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 日本電気株式会社
Publication of WO2013035287A1 publication Critical patent/WO2013035287A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9027Trees
    • 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/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • 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

Definitions

  • the present invention relates to a database management device, a database management method, and a program for managing a database having a tree index structure.
  • Non-Patent Document 1 The B-tree index described in Non-Patent Document 1 is designed as a guideline to minimize the number of disk accesses.
  • Non-Patent Document 2 describes a derived index including B + -tree.
  • Insertion in CSB + -tree is similar to insertion in B + -tree and is done by splitting nodes. However, the node generated by the division must be included in the same node group as the original node. Therefore, in order to divide a node, it is essential to allocate a large continuous area to a node group in advance or update for each node group.
  • Non-patent document 7 proposed Fractal Prefetching B + -tree (fpB + -tree) that is conscious of both CPU cache and disk.
  • the node size of the B + -tree is 32-128B when optimized for the cache and 4K-64KB when optimized for the disk. If the node size is reduced to match the cache, the number of disk I / Os will increase greatly. If the node size is adjusted to the size of the disk, a binary search is performed for a large number of entries in the node, and cache misses increase. Therefore, in the fpB + -tree, a B + -tree having a node having a size optimized for the disk is generated, and a (sub) node having a size optimized for the cache is generated in the node.
  • the tree index 10 is set so that the nodes belonging to the first hierarchy have the first size, and the nodes belonging to the second hierarchy are the second, as in the first embodiment.
  • the nodes may belong to all the hierarchies and may have the same size. Also in this embodiment, the size of the leaf node may be larger than the size of the first node.
  • each of the first hierarchy and the second hierarchy may be a single hierarchy or a plurality of hierarchies.
  • all layers below a certain layer may be the first layer, and all the remaining layers may be the second layer.
  • FIG. 3 is a flowchart showing search processing performed by the node management unit 120 shown in FIG.
  • the node management unit 120 performs the following processing using a management unit (for example, one of the first node management unit 122 and the second node management unit 124) corresponding to the hierarchy to be searched.
  • a management unit for example, one of the first node management unit 122 and the second node management unit 124.
  • the node management unit 120 sets the search target hierarchy to the highest hierarchy (step S100).
  • the node management unit 120 searches for a node belonging to the search target hierarchy using the search key (step S102). Since there is only one node (root node) at the highest level, when the search target is the highest hierarchy, the node to be searched is clear.
  • the search target node is not a leaf node (step S104: No)
  • the search target hierarchy is lowered by one (step S105).
  • the node management unit 120 specifies one of the nodes belonging to the newly set search target hierarchy from the pointer included in the entry of the node of the hierarchy before update (step S106), and returns to step S102.
  • step S124 when the node in the next lower hierarchy is a leaf node (step S124: Yes), the node management unit 120 determines a leaf node to be inserted (step S127 in FIG. 4).
  • step S1228 the node management unit 120 inserts an entry into the determined leaf node (step S128). If no overflow occurs (step S129: No), the process is terminated.
  • the node management unit 120 generates a new entry.
  • This entry has x as a key and a pointer to the newly generated node (step S132).
  • the node management unit 120 moves up one hierarchy (step S134), returns to step S128, and generates it in step S132. Entry processing of the entered entry is performed.
  • step S134 When there is no hierarchy one level higher than the current hierarchy, that is, when the current node is a root node (step S134: No), the node management unit 120 adds a new route above the current root node. A node is created (step S135). Then, the node management unit 120 inserts an entry representing each of the node newly generated in step S130 and the node that is the division source into the root node generated in step S135 (step S136). An entry corresponding to the newly generated node is generated in step S132. The entry corresponding to the split source node includes a pointer pointing to the split source node, but the key corresponding to this pointer is not necessary.
  • division, insertion, and search are performed on a node according to the hierarchy to which the node belongs. Accordingly, the database division, insertion, and search speed can be increased.
  • the database management apparatus 100 handles the tree index 10 in a flat node state in which entries are not sorted. Then, the size of the node belonging to the hierarchy positioned relatively lower is made larger than the size of the node belonging to the hierarchy positioned higher than that.
  • the lowermost node (leaf node) may be 4 KB, and the other nodes may be 128 B.
  • the size of the lowermost node may be 8 KB, the size of the node one level higher than that may be 4 KB, and the size of the node one level higher than that may be 2 KB.
  • the search can be performed at high speed. If the node size is large, the number of node divisions required at the time of insertion is reduced, so that the insertion can be performed at high speed.
  • FIG. 6 is a diagram showing a configuration of a flat node.
  • the flat node is provided with an area for storing an entry, an area for storing a numerical value indicating the number of entries in the node, and an area for storing a minimum pointer.
  • the minimum pointer is a pointer given when the given search key is smaller than the key of any entry in the flat node.
  • FIG. 7 is a flowchart showing the operation at the time of search of the node management unit 120 in this embodiment. The operation shown in this figure performs a search within a certain flat node.
  • the node management unit 120 determines the first entry as a target (step S140). Next, the node management unit 120 determines whether or not the key included in the target entry is equal to or less than the search key (step S141).
  • the node management unit 120 sets the key as the maximum key (step S145).
  • the node management unit 120 sets the next entry as a target (step S146), and determines whether there is a target entry (step S147). When there is no entry (step S147: No), the node management unit 120 reads the entry currently targeted (step S148).
  • step S147: Yes the node management unit 120 determines whether the key included in the target entry is equal to or less than the search key (step S149). When the key is larger than the search key (step S149: No), the node management unit 120 returns to step S146.
  • step S162 When the key is larger than the search key (step S162: No), the node management unit 120 sets the next entry as a target (step S163), and determines whether there is a target entry (step S164). ). If there is an entry (step S164: Yes), the node management unit 120 returns to step S162. When there is no entry (step S164: No), the node management unit 120 ends the process.
  • step S162 when the key included in the target entry is equal to or lower than the search key (Yes), the node management unit 120 inserts the current target entry into a new node ( Step S165). Then, the node management unit 120 moves the last entry to the position where the entry targeted for insertion in step S165 was present (step S166), and reduced the number of entries by one (step S167), and then proceeds to step S162. Return.
  • the node management unit 120 inserts an entry into the flat node as follows. First, if the entry to be inserted is c, the node management unit 120 writes this entry at the position of the c-th entry. Then, the node management unit 120 sets the number of entries of the flat node as (c + 1). If there is no space to insert a new entry, the above node division processing is performed.
  • the database management apparatus 100 handles the tree index 10 in a state in which both a flat node state and a sorted node (sorted node) are included.
  • the configuration of the sorted node is the same as that of the flat node shown in FIG.
  • the nodes belonging to the same hierarchy are unified as either a flat node or a sorted node.
  • the tree index 10 for example, nodes below a certain hierarchy are flat nodes, and other nodes are sorted nodes. Note that, in a hierarchy that is a flat node, the node may become larger as the layer becomes lower. Further, in a hierarchy that is a sorted node, the node may become larger as it becomes an upper layer.
  • the node management unit 120 performs division, insertion, and search on the flat node by the method described in the third embodiment. Further, the node management unit 120 performs division, insertion, and search on the sorted node by the following method.
  • FIG. 9 is a flowchart showing an operation when the node management unit 120 searches the sorted node.
  • the node management unit 120 determines whether or not the key in the first entry (that is, the smallest key in the node) is equal to or less than the search key (step S180). If the target key is larger than the search key (step S180: No), the node management unit 120 reads the minimum pointer (step S181).
  • step S190 If there is an unsearched key, that is, if le is greater than 0 (step S190: Yes), the node management unit 120 sets the key of the entry located in the center among the unsearched entries as the next search target key. (Step S191). Then, the node management unit 120 sets the number re of unsearched entries having a key larger than the t-th entry to re / 2, and the number le of unsearched entries having a key smaller than the search target entry (re-1). ) Set to / ⁇ ⁇ ⁇ 2 (step S192). Then, the process returns to step S184.
  • the node management unit 120 performs division processing on the sorted node as follows. First, the node management unit 120 inserts the (c ⁇ 1) th entry from the c / 2th entry into a new node, where c is the number of entries stored in the sorted node. Then, the number of entries is reduced from c to c / 2.
  • the database management apparatus 100 handles the tree index 10 in the state of a sorted node. Then, the size of the node belonging to the hierarchy positioned relatively lower is made smaller than the size of the node belonging to the hierarchy positioned higher than that. For example, the lowest layer node (leaf node) may be 128B and the branch node may be 4 kB. As described above, in a sorted node, the smaller the node size, the shorter the time required for insertion. This is because entry insertion frequently occurs (for example, half of the entries) in the insertion of a sorted node.
  • the speed of the database can be increased.
  • the table in FIG. 11 shows the calculation amount necessary for search, the calculation amount necessary for insertion, and space efficiency in each of the flat node, the sorted node, and the tree node.
  • the search is performed by binary search, so the amount of calculation at the time of search is O (log n).
  • O the calculation amount
  • the root node is a node that considers the cache size, such as a CSS node, and the leaf node is one of flat / sorted / tree nodes. Nodes in other layers are arbitrarily selected.
  • the CSS node is used for the root node, which has a low write ratio and tends to be recorded in the highest media (typically CPU cache) in order to provide high-speed search and high space efficiency.

Abstract

In the present invention, a node management unit (120) performs a transition of a level of a tree-index (10), and performs partitioning, insertion, and searching with respect to each node of the tree-index (10). For the tree-index (10), nodes belonging to a first level are set to be of a first size, and nodes belonging to a second level are set to be of a second size. For example, for the tree-index (10), leaf-nodes (described as zeroth nodes within the figure) and first nodes belonging to an upper level of the same are made to differ in size. For example, the size of the leaf-nodes is made to be larger than the size of the first nodes.

Description

データベース管理装置、データベース管理方法、及びプログラムDatabase management apparatus, database management method, and program
 本発明は、ツリーインデックス構造のデータベースを管理するデータベース管理装置、データベース管理方法、及びプログラムに関する。 The present invention relates to a database management device, a database management method, and a program for managing a database having a tree index structure.
 データベースの構造の一つに、ツリーインデックス構造がある(例えば特許文献1参照)。また非特許文献1~21には、以下の技術が開示されている。 One of the database structures is a tree index structure (see, for example, Patent Document 1). Non-Patent Documents 1 to 21 disclose the following techniques.
 非特許文献1に記載のB-treeインデックスは、ディスクアクセス数を最小化すること指針として設計されている。非特許文献2には、B+-treeを含むその派生インデックスについて記載されている。 The B-tree index described in Non-Patent Document 1 is designed as a guideline to minimize the number of disk accesses. Non-Patent Document 2 describes a derived index including B + -tree.
 非特許文献3には、メモリ使用量とCPUサイクルを削減することを目的としたT-treeが記載されている。非特許文献3は、ポインタを参照するようにすることで、メモリ使用量を抑制している。さらに非特許文献3では、二分木ではなく多分木を用いることで、木を平衡させるための処理である「回転」が発生する頻度を低くすることで、CPUサイクルを削減している。 Non-Patent Document 3 describes a T-tree for the purpose of reducing memory usage and CPU cycles. Non-Patent Document 3 suppresses memory usage by referring to a pointer. Further, Non-Patent Document 3 uses a multi-tree instead of a binary tree to reduce the frequency of occurrence of “rotation”, which is a process for balancing the tree, thereby reducing the CPU cycle.
 非特許文献4では、Cache-Sensitive Search Tree (CSS-tree)が提案されている。CSS-treeの目的は、インクリメンタルな更新がほとんど発生しないOLAP(online analytical processing)のワークロードにおいて、高速な検索を実現することである。CSS-treeでは、ノードのサイズをキャッシュラインと同じにして、ノードあたりのキャッシュミスの回数を1に抑える。また、ノード内でキーが記録されている位置から、次にアクセスすべきデータを決定する。B-treeなどではキーとポインタの組から次にアクセスするデータを決定するが、CSS-treeではポインタが省略できるので、ノードに記録できるキーの数を増加することができる。そして、一つのキャッシュライン上のデータからより少数のキーに絞り込むことができる。 Non-Patent Document 4 proposes Cache-Sensitive Search Tree (CSS-tree). The purpose of CSS-tree is to enable fast searching in OLAP (online-analytical-processing) workloads where few incremental updates occur. In CSS-tree, the size of the node is the same as the cache line, and the number of cache misses per node is reduced to one. Further, the data to be accessed next is determined from the position where the key is recorded in the node. In a B-tree or the like, the next data to be accessed is determined from a pair of a key and a pointer. However, since a pointer can be omitted in a CSS-tree, the number of keys that can be recorded in a node can be increased. Then, it is possible to narrow down to a smaller number of keys from data on one cache line.
 非特許文献5では、更新可能なCSS-treeであるCache-Sensitive B+-tree (CSB+-tree)が提案された。CSB+-treeでは、ノードの下位に、連続領域に配置されたノードからなるノードグループが形成される。上位のノードには、ノードグループの先頭へのポインタとキーが含まれる。キーの記録位置が、グループ中のどのノードに次にアクセスすべきかを決定する。キー毎に1つのポインタを持つB-treeに比べて、ポインタの数を大きく削減できるため、CSS-treeと同様に高速な検索が実現できる。CSS-treeと異なるのは、更新を考慮している点である。CSB+-treeにおける挿入は、B+-treeにおける挿入と似ていて、ノードを分割することにより行われる。ただし、分割により生成されたノードは、分割元のノードと同じノードグループに含まれなければならない。よって、大きな連続領域を事前にノードグループに割り当てること、またはノードグループごと更新することが、ノードを分割するためには必須となる。 Non-Patent Document 5 proposed Cache-Sensitive B + -tree (CSB + -tree), which is an updatable CSS-tree. In the CSB + -tree, a node group including nodes arranged in a continuous area is formed below the nodes. The upper node includes a pointer to the head of the node group and a key. The recording location of the key determines which node in the group should be accessed next. Compared to a B-tree that has one pointer for each key, the number of pointers can be greatly reduced, so that high-speed search can be realized in the same way as CSS-tree. The difference from CSS-tree is that it considers updates. Insertion in CSB + -tree is similar to insertion in B + -tree and is done by splitting nodes. However, the node generated by the division must be included in the same node group as the original node. Therefore, in order to divide a node, it is essential to allocate a large continuous area to a node group in advance or update for each node group.
 非特許文献6では、プリフェッチを活用することで性能を向上させるPrefetching B+-tree (pB+-tree)が提案された。B+-treeを用いた検索において、データキャッシュのミスによって生じる待ち時間が実行時間に占める割合は、一つのキーを検索する場合は65%、一度に複数のキーを検索する場合は84%である。pB+-treeは、プリフェッチを用いてこの待ち時間を削減する。一つのキーを検索する際、次にアクセスするノード中のデータの全てがプリフェッチされる。複数キーの検索では、さらに、リーフノード間をたどってデータを取得するときにもプリフェッチが行われる。リーフノードのプリフェッチは、リーフノードへのポインタの配列を作るか、またはリーフの一つ上のブランチブロック間で水平方向のリンクを張ることで可能になる。プリフェッチによる検索性能の向上により、更新速度も向上する。 Non-Patent Document 6 proposed Prefetching B + -tree (pB + -tree), which improves performance by utilizing prefetching. In a search using B + -tree, the ratio of the waiting time caused by a data cache miss to the execution time is 65% when searching for one key and 84% when searching for multiple keys at once. . pB + -tree uses prefetch to reduce this latency. When retrieving one key, all of the data in the next accessed node is prefetched. In the search for a plurality of keys, prefetching is also performed when data is acquired by tracing between leaf nodes. Leaf node prefetching is made possible by creating an array of pointers to leaf nodes or by creating horizontal links between branch blocks one leaf above. Update speed is also improved by improving search performance by prefetch.
 非特許文献7では、CPUキャッシュとディスクの双方を意識するFractal Prefetching B+-tree (fpB+-tree)が提案された。B+-treeのノードサイズは、キャッシュに合わせて最適化すると32-128B、ディスクに合わせて最適化すると4K-64KBになる。ノードサイズをキャッシュに合わせて小さなサイズにすると、ディスクI/Oの数が大きく増加してしまう。ノードサイズをディスクに合わせたサイズにすれば、ノード内で多数のエントリに対する二分探索を行うことになり、キャッシュミスが多くなる。そこで、fpB+-treeでは、ディスクに最適化したサイズのノードを持つB+-treeが生成され、さらにノードの中に、キャッシュに最適化したサイズの(サブ)ノードが生成される。 Non-patent document 7 proposed Fractal Prefetching B + -tree (fpB + -tree) that is conscious of both CPU cache and disk. The node size of the B + -tree is 32-128B when optimized for the cache and 4K-64KB when optimized for the disk. If the node size is reduced to match the cache, the number of disk I / Os will increase greatly. If the node size is adjusted to the size of the disk, a binary search is performed for a large number of entries in the node, and cache misses increase. Therefore, in the fpB + -tree, a B + -tree having a node having a size optimized for the disk is generated, and a (sub) node having a size optimized for the cache is generated in the node.
 非特許文献8では、CSB+-treeの解析的な性能モデルを作成し、CSB+-treeの実装と性能評価を通じて、その正当性を示した。性能モデルの概略は以下の式で表される。
    t = I × cpi + M × miss_latency + B × pred_penalty + T × tlb_penalty
 ただし、tは実行時間、cpiは命令あたりのサイクル数、miss_latencyはキャッシュミスの、pred_penaltyは分岐ミスの、miss_latencyはTLBミスのコストである。また、Iは命令数、Mはキャッシュミス数、Bは分岐ミス数、TはTLBミス数である。メインメモリデータベースにおいて、キャッシュミスは速度を低下させる大きな原因である。通念的には、キャッシュラインとインデックスのノードサイズを一致させることがキャッシュミスを減らすのに有効である。しかしこれでは、命令数や、分岐ミス、TLBミスなどの他の要因が無視される。そこで、非特許文献8では、上記のモデルを作成し、その正当性を実装と評価を通じて示した。その結果、ノードサイズを大きく(ex. 512B)すると、速度が17%、空間効率が57%向上することが示された。
In Non-Patent Document 8, an analytical performance model of CSB + -tree was created, and its validity was shown through implementation and performance evaluation of CSB + -tree. The outline of the performance model is expressed by the following equation.
t = I × cpi + M × miss_latency + B × pred_penalty + T × tlb_penalty
Where t is the execution time, cpi is the number of cycles per instruction, miss_latency is the cache miss, pred_penalty is the branch miss, and miss_latency is the TLB miss cost. I is the number of instructions, M is the number of cache misses, B is the number of branch misses, and T is the number of TLB misses. In the main memory database, cache misses are a major cause of reduced speed. Generally, matching the cache line and index node sizes is effective in reducing cache misses. However, this ignores other factors such as the number of instructions, branch misses, and TLB misses. Therefore, in Non-Patent Document 8, the above model is created, and its correctness is shown through implementation and evaluation. As a result, it was shown that increasing the node size (ex. 512B) improved the speed by 17% and the space efficiency by 57%.
 非特許文献9では、ツリーインデックスのキーを効率的に圧縮する方法が述べられた。メモリ上では、ディスク上よりも、キーサイズが問題になりやすい。しかし、キーをポインタ参照で扱うと、キャッシュミスが頻発してしまう。Prefix B-tree(非特許文献10)は、キーが可変長になるために空間効率が低下する場合がある。これに対し、キーへのポインタ、差異が生じる桁(ビット)のオフセット、オフセットからの最初のLバイトからなる部分キーを使うと、1) キーサイズによらず、キャッシュミスを最小化できる、2) キーサイズが大きいときには通常のキーを扱うよりも高速である(キーサイズが小さいときには遅くなる)、3) 空間効率はT-treeよりも少し悪く、非圧縮キーよりもずっとよい、4) 小さな、固定長の部分キーを使えば、大部分の間接参照を避けられる、という結論が得られた。 Non-Patent Document 9 describes a method for efficiently compressing a key of a tree index. On memory, key size is more problematic than on disk. However, when a key is handled by a pointer reference, cache misses frequently occur. In Prefix B-tree (Non-patent Document 10), the key has a variable length, so that the space efficiency may decrease. On the other hand, if a partial key consisting of a pointer to a key, a digit (bit) where a difference occurs, and the first L bytes from the offset are used, 1) cache miss can be minimized regardless of the key size. ) It is faster than handling normal keys when the key size is large (slower when the key size is small) 3) Space efficiency is a little worse than T-tree, much better than uncompressed keys 4) Small The conclusion was that using a fixed-length partial key would avoid most indirect references.
 非特許文献11では、個々のハードウェアに最適化した二進木である「FAST」が提案された。FASTにおいて考慮されるのは、SIMDレジスタのサイズ、ラインサイズ、ページサイズなどである。典型的には、8B、64B、2M(4K)Bがこれらのサイズである。非特許文献6ではディスクに合わせたサイズのノードの中にキャッシュに合わせたサイズのノードを設けていたが、非特許文献11では、キャッシュに合わせたサイズのノードの中に、さらにSIMDレジスタに合わせたサイズのノードを設ける。これら三種のノード内で、幅優先でエントリを詰める。例えば、あるエントリと、その子にあたる二つのエントリを詰める。キー圧縮などの他の要因と合わせて、結果的には、CPUベースだと5倍の性能向上が見られた。 In Non-Patent Document 11, “FAST”, which is a binary tree optimized for individual hardware, was proposed. In FAST, the SIMD register size, line size, page size, etc. are considered. Typically, 8B, 64B, 2M (4K) B are these sizes. In Non-Patent Document 6, a node sized according to the cache is provided in a node sized according to the disk. However, in Non-Patent Document 11, a node sized according to the cache is further aligned with the SIMD register. Provide nodes of different sizes. Within these three types of nodes, entries are packed with width priority. For example, a certain entry and two entries corresponding to its children are packed. Combined with other factors such as key compression, the result is a five-fold improvement in performance on a CPU basis.
 さらに、ディスクでもメモリでもなく、フラッシュメモリを想定したツリーインデックスも提案されている。大まかに言って、フラッシュメモリはディスクよりも高速で、メモリよりも低速な記録媒体である。基本的には非公開であるフラッシュメモリ関連のアルゴリズムとデータ構造を特許文献に基づいてサーベイしたのが、非特許文献12である。フラッシュメモリは、新たなデータをページに書き込む前に、いくつかのページをまとめたブロック単位での消去を必要とする。また、消去回数は十万から百万回であることが多い。そのため、Flash Translation Layer (FTL)のような、ソフトウェア的な制御が入る。FTLでは通常、循環ログにデータを追記する。つまり、ページを書き換えず、古いデータを含むページはそのままにして、新たなデータを空いているページに書き込む。ここで問題となるのが、同一ブロック中に有効な(最新のデータを持つ)ページと無効な(参照されない古いデータを持つ)ページが混在することである。記憶領域を有効に活用するには、無効なページを削除し、有効なページを同一ブロックにまとめる必要がある。これはガーベッジ・コレクション(GC)と呼ばれる。 Furthermore, a tree index that assumes flash memory, not disk or memory, has also been proposed. Broadly speaking, flash memory is a recording medium that is faster than disk and slower than memory. Non-patent document 12 is a survey of algorithms and data structures related to flash memory, which are basically not disclosed, based on the patent document. The flash memory requires erasing in units of blocks in which several pages are combined before new data is written to the page. In many cases, the number of erasures is 100,000 to 1 million. Therefore, software control such as Flash Translation Layer (FTL) is included. In FTL, data is usually added to the circular log. That is, without rewriting the page, the page including the old data is left as it is, and new data is written in the empty page. The problem here is that valid pages (having the latest data) and invalid pages (having old data that is not referenced) coexist in the same block. In order to effectively use the storage area, it is necessary to delete invalid pages and collect valid pages in the same block. This is called garbage collection (GC).
 非特許文献13では、ブラックボックスであるFTLの影響を強く受けるSolid State Drive (SSD)の性能が評価された。分かったことは、1) リード性能はアクセスパターンに依存する、2) ローエンドSSDのライト性能はアクセスパターンに強く依存する、3) ディスクキャッシュは高速化に非常に有効である、4) 同時に処理していなくても、リードとライトが干渉する、5) FTLのバックグラウンドジョブは性能を低下させる、6) ランダムライトによるフラグメンテーションは性能を大きく低下させる、の六つである。そして、これらの複雑性のために、SSDがすぐにHDDを置換することはないだろう、という見解が提示された。 Non-patent document 13 evaluated the performance of Solid State Drive (SSD), which is strongly influenced by the FTL that is a black box. It turns out that 1) read performance depends on the access pattern, 2) ラ イ ト low-end SSD write performance strongly depends on the access pattern, 3) disk cache is very effective for speedup, 4) process simultaneously Even if not, read and write interfere with each other, 5) FTL background job degrades performance, and 6) Random write fragmentation significantly degrades performance. And the view that SSDs will not replace HDDs right away because of these complexities was presented.
 非特許文献14では、B-treeで生じる細かいデータ更新を効率的に扱うレイヤーであるBFTLが提案された。BFTLは、ブロックデバイス(FTL)とアプリケーションの間のレイヤーである。ブロックデバイスへのリクエストは、BFTLへのリクエストに読み替えられる。BFTLは、バッファと変換テーブルを持つ。ブロックの変更は(メモリ上の)バッファに記録され、一度にフラッシュされる。論理から物理へのブロックアドレスの変換には、チェーンハッシュである変換テーブルを用いる。よって、ライトが高速化され、リードは少し低速になる。 Non-Patent Document 14 proposed BFTL, which is a layer that efficiently handles fine data updates that occur in a B-tree. BFTL is a layer between block devices (FTL) and applications. Requests to block devices are read as requests to BFTL. BFTL has a buffer and a conversion table. Block changes are recorded in a buffer (on memory) and flushed at once. A conversion table that is a chain hash is used to convert a block address from logical to physical. As a result, the write speed is increased and the read speed is slightly reduced.
 非特許文献15では、フラッシュメモリへのアクセスを最小化することで高い性能を達成できるLazy-Adaptive Tree (LA-Tree)が提案された。LA-Treeの特徴は、ツリーの中のサブツリーに対してバッファ(cascaded buffers)を割り当てることにある。バッファがあふれると下位のサブツリーのバッファにフラッシュされる。バッファサイズは適応的に決定される(adaptive buffering)。更新が多ければ大きなバッファが、少なければ小さなバッファが割り当てられる。多くの変更を記録すると更新の性能は上がるが、検索の性能が下がるためである。LA-Treeは、BFTLなどの既存の方法に比べて、2-12倍高速なレスポンスタイムを示した。 Non-Patent Document 15 proposes Lazy-Adaptive Tree (LA-Tree), which can achieve high performance by minimizing access to flash memory. The feature of LA-Tree is that buffers (cascaded buffers) are assigned to subtrees in the tree. When the buffer overflows, it is flushed to the buffer of the lower subtree. The buffer size is adaptively determined (adaptive buffering). A large buffer is allocated if there are many updates, and a small buffer is allocated if there are few updates. This is because, if many changes are recorded, the update performance increases, but the search performance decreases. LA-Tree showed a response time 2-12 times faster than existing methods such as BFTL.
 非特許文献16および17では、フラッシュメモリへのランダムライトが低速であることを解決することを目的として、FD-treeが提案された。FD-treeは、ノードサイズがフラッシュメモリのページサイズに等しい、小さなB+-treeであるヘッドツリーと、ソートされたブロックの配列からなる。配列は概ねツリーの一つのレベルに対応し、ツリーの低いレベルの配列ほどサイズが大きい。ヘッドツリー、または配列のブロック内を検索すると、一つ下位のレベルの、次に検索すべきブロックを特定できる。ヘッドツリーを設けると、メモリ上のデータへのランダムライトは高速に処理できる。ライトはヘッドツリーにバッファされ、バッファがいっぱいになると下位のレベルのバッファへフラッシュされる。 In Non-Patent Documents 16 and 17, FD-tree was proposed for the purpose of solving the problem of random writing to the flash memory at a low speed. The FD-tree is composed of a head tree that is a small B + -tree whose node size is equal to the page size of the flash memory, and an array of sorted blocks. The array generally corresponds to one level of the tree, with lower level arrays in the tree being larger in size. By searching the block of the head tree or the array, the block to be searched next in the next lower level can be specified. When a head tree is provided, random writing to data on the memory can be processed at high speed. Writes are buffered in the head tree and are flushed to lower level buffers when the buffer is full.
 また、データをどの記憶階層におくと採算に合うかについては、次の5分ルールが有名である。非特許文献18では、データをメモリにおくことの採算性が5分ルールとして示された。Rを参照間隔、Mをメモリのバイト単価、Aをディスクの帯域単価、Bをデータサイズ、Bmaxをディスクのブロックサイズとする。すると、A/R - M*B = 0になるときに、データをメモリに置くことの採算がとれるが、それはRが5分のときである。また、1秒に1命令を省けるなら、10バイト余計に使っても採算がとれることが同様に算出される。 Also, the following 5-minute rule is well-known as to which storage hierarchy data will be profitable. Non-Patent Document 18 shows the profitability of storing data in a memory as a 5-minute rule. R is the reference interval, M is the memory unit price, A is the disk bandwidth unit price, B is the data size, and Bmax is the disk block size. Then, when A / R-M * B = 0, it is profitable to put data in memory, but when R is 5 minutes. Similarly, if one instruction can be omitted per second, it is calculated in the same manner that the profit can be obtained even if the extra 10 bytes are used.
 非特許文献19では、十年たった後のハードウェア環境でも5分ルールが成立することが示された。ハードウェアの絶対性能は大きく変化したが、ディスクのランダムアクセスに関して5分ルールは成り立つ。シーケンシャルアクセス(sort、 cube、 join、 etc.)に関しては、1分ルールが成り立つ。さらにB木のノードサイズを、ディスクのレイテンシと、帯域、ノードのutility(ノード内のエントリ数の2の対数)で最適化すると、8K-32KBになる。一方、ミニコンでは10バイトルールが成り立つが、PCでは1バイトルール、メインフレームでは1Kバイトルールになる。 Non-Patent Document 19 shows that the 5-minute rule is established even in a hardware environment after ten years. Although the absolute performance of hardware has changed greatly, the 5-minute rule holds for random disk access. For sequential access (sort, cube, join, etc.), the 1-minute rule holds. Furthermore, if the node size of the B-tree is optimized by the latency of the disk, the bandwidth, and the utility of the node (the logarithm of 2 of the number of entries in the node), it becomes 8K-32 KB. On the other hand, the 10-byte rule holds for minicomputers, but the 1-byte rule for PCs and the 1K-byte rule for mainframes.
 非特許文献20では、二十年たった後のハードウェア環境で5分ルールが成立する環境が提示された。大きなページのフラッシュメモリとメモリの間の移動と、小さなページのフラッシュメモリとディスクの間の移動では、5分ルールが有効である。近年のディスク帯域の拡大に伴い、ディスクとメモリを対象としたB木のノードサイズは、256KBが最適に近い。フラッシュとメモリを対象とすると、2KBのノードサイズが好ましい。ディスクとフラッシュで最適なノードサイズが異なるので、フラッシュとディスクの間は256KBで、メモリとフラッシュの間は4KBでデータを転送するのが有益だと推定した。 Non-Patent Document 20 presented an environment in which a 5-minute rule is established in a hardware environment after 20 years. The 5 minute rule is valid for moving between large pages of flash memory and memory and between small pages of flash memory and disk. Along with the recent expansion of the disk bandwidth, the node size of the B-tree for disks and memories is nearly optimal at 256 KB. For flash and memory targets, a 2 KB node size is preferred. Since the optimal node size is different between disk and flash, we estimated that it would be beneficial to transfer data at 256 KB between flash and disk and 4 KB between memory and flash.
特開平04-112240号公報Japanese Patent Laid-Open No. 04-112240
 データベースには、速度を向上させることが常に求められている。本発明は、データベースの速度を向上させることができるデータベース管理装置、データベース管理方法、及びプログラムを提供することにある。 Databases are always required to improve speed. An object of the present invention is to provide a database management apparatus, a database management method, and a program capable of improving the speed of a database.
 本発明によれば、ツリーインデックス構造のデータベースを管理するデータベース管理装置であって、
 第1の階層に属するノードは第1のサイズとなるように設定されており、第2の階層に属するノードは第2のサイズとなるように設定されており、
 前記第1の階層に属するノード及び前記第2の階層に属するノードそれぞれに対して、分割、挿入、及び探索を行うノード管理手段を備えるデータベース管理装置が提供される。
According to the present invention, there is provided a database management apparatus for managing a database having a tree index structure,
Nodes belonging to the first hierarchy are set to be the first size, nodes belonging to the second hierarchy are set to be the second size,
There is provided a database management apparatus comprising node management means for performing division, insertion, and search for each of nodes belonging to the first hierarchy and nodes belonging to the second hierarchy.
 本発明によれば、ツリーインデックス構造のデータベースを管理するデータベース管理装置であって、
 第1の階層に属するノードに対して、分割、挿入、及び探索を行う第1ノード管理手段と、
 第2の階層に属するノードに対して、前記第1ノード管理手段とは異なる方法で分割、挿入、及び探索を行う第2ノード管理手段と、
を有するデータベース管理装置が提供される。
According to the present invention, there is provided a database management apparatus for managing a database having a tree index structure,
First node management means for dividing, inserting, and searching for nodes belonging to the first hierarchy;
Second node management means for dividing, inserting, and searching for nodes belonging to the second hierarchy by a method different from the first node management means;
A database management device is provided.
 本発明によれば、ツリーインデックス構造のデータベースを管理するデータベース管理方法であって、
 コンピュータが、第1の階層に属するノードに対して、分割、挿入、及び探索を行い、
 前記コンピュータが、第2の階層に属するノードに対して、前記第1ノード管理手段とは異なる方法で分割、挿入、及び探索を行うデータベース管理方法が提供される。
According to the present invention, there is provided a database management method for managing a database having a tree index structure,
The computer performs division, insertion, and search for nodes belonging to the first hierarchy,
A database management method is provided in which the computer divides, inserts, and searches a node belonging to a second hierarchy by a method different from the first node management unit.
 本発明によれば、コンピュータを、ツリーインデックス構造のデータベースを管理するデータベース管理装置として機能させるためのプログラムであって、
 前記コンピュータに、
 第1の階層に属するノードに対して、分割、挿入、及び探索を行う第1ノード管理機能と、
 第2の階層に属するノードに対して、前記第1ノード管理機能とは異なる方法で分割、挿入、及び探索を行う第2ノード管理機能と、
を実現させるプログラムが提供される。
According to the present invention, there is provided a program for causing a computer to function as a database management device that manages a database having a tree index structure,
In the computer,
A first node management function for dividing, inserting, and searching for nodes belonging to the first hierarchy;
A second node management function for dividing, inserting, and searching for nodes belonging to the second hierarchy in a method different from the first node management function;
A program for realizing the above is provided.
 本発明によれば、データベースの速度を向上させることができる。 According to the present invention, the speed of the database can be improved.
 上述した目的、およびその他の目的、特徴および利点は、以下に述べる好適な実施の形態、およびそれに付随する以下の図面によってさらに明らかになる。 The above-described object and other objects, features, and advantages will be further clarified by a preferred embodiment described below and the following drawings attached thereto.
第1の実施形態に係るデータベース管理装置の構成を示す機能ブロック図である。It is a functional block diagram which shows the structure of the database management apparatus which concerns on 1st Embodiment. 第2の実施形態に係るデータベース管理装置の構成を示す機能ブロック図である。It is a functional block diagram which shows the structure of the database management apparatus which concerns on 2nd Embodiment. 図2に示したノード管理部が行う探索処理を示すフローチャートである。3 is a flowchart illustrating search processing performed by a node management unit illustrated in FIG. 2. 図2に示したノード管理部が行う挿入処理を示すフローチャートである。3 is a flowchart showing an insertion process performed by a node management unit shown in FIG. 2. 図4の続きを示すフローチャートである。5 is a flowchart showing a continuation of FIG. フラットノードの構成を示す図である。It is a figure which shows the structure of a flat node. 第3の実施形態に係るノード管理部の検索時の動作を示すフローチャートである。It is a flowchart which shows the operation | movement at the time of the search of the node management part which concerns on 3rd Embodiment. 第3の実施形態に係るノード管理部のノード分割時の動作を示すフローチャートである。It is a flowchart which shows the operation | movement at the time of node division of the node management part which concerns on 3rd Embodiment. 第4の実施形態に係るノード管理部がソーテッドノードに対して探索を行うときの動作を示すフローチャートである。It is a flowchart which shows operation | movement when the node management part which concerns on 4th Embodiment searches with respect to a sorted node. 第6の実施形態に係るデータベース管理装置の構成を、ツリーインデックスの構造とともに示す図である。It is a figure which shows the structure of the database management apparatus which concerns on 6th Embodiment with the structure of a tree index. フラットノード、ソーテッドノード、及びツリーノードのそれぞれにおいて、検索に必要な計算量、挿入に必要な計算量、及び空間効率を示す表である。It is a table | surface which shows the calculation amount required for a search, the calculation amount required for insertion, and space efficiency in each of a flat node, a sorted node, and a tree node.
 以下、本発明の実施の形態について、図面を用いて説明する。尚、すべての図面において、同様な構成要素には同様の符号を付し、適宜説明を省略する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. In all the drawings, the same reference numerals are given to the same components, and the description will be omitted as appropriate.
(第1の実施形態)
 図1は、第1の実施形態に係るデータベース管理装置100の構成を示す機能ブロック図である。データベース管理装置100は、ツリーインデックス10を管理する装置であり、ノード管理部120を備えている。ノード管理部120は、ツリーインデックス10の階層の遷移を行うとともに、ツリーインデックス10の各ノードに対して、分割、挿入、及び探索を行う。
(First embodiment)
FIG. 1 is a functional block diagram showing the configuration of the database management apparatus 100 according to the first embodiment. The database management device 100 is a device that manages the tree index 10 and includes a node management unit 120. The node management unit 120 performs transition of the hierarchy of the tree index 10 and performs division, insertion, and search for each node of the tree index 10.
 ノード管理部120は、挿入処理において、ノードにエントリを書き込む。エントリとは、キーまたはキーへのポインタと、ポインタの組である。ポインタからは、他の(下位の)ノードやキーに付随するデータの場所が特定できる。なお、ポインタは省略可能である。 The node management unit 120 writes an entry in the node in the insertion process. An entry is a key or a pointer to a key and a set of pointers. From the pointer, the location of data associated with other (lower) nodes and keys can be specified. The pointer can be omitted.
 またノード管理部120は、探索処理において、指定されたキーに対応するエントリを探索する。さらにノード管理部120は、分割処理において、分割対象とするノードと同じレベルの新たなノードを確保し、対象ノードのエントリの一部を新たなノードに移動させる。ノード管理部120は、これらの処理を、異なる階層のノード間にまたがって実行することができる。 Further, the node management unit 120 searches for an entry corresponding to the designated key in the search process. Further, in the dividing process, the node management unit 120 secures a new node at the same level as the node to be divided, and moves a part of the entry of the target node to the new node. The node management unit 120 can execute these processes across nodes in different hierarchies.
 ツリーインデックス10は、第1の階層に属するノードは第1のサイズとなるように設定されており、第2の階層に属するノードは第2のサイズとなるように設定されている。例えばツリーインデックス10は、リーフノード(図中では第0ノードと記載)と、その上の階層に属する第1ノードとで、サイズを異ならせている。本実施形態では、例えば、リーフノードのサイズを、第1ノードのサイズよりも大きくする。ノードのサイズに関しては非特許文献8に記載の技術を参考にしても良い。また、非特許文献9や10に示されるキーの圧縮方法を用いても良い。 The tree index 10 is set so that nodes belonging to the first hierarchy have the first size, and nodes belonging to the second hierarchy are set to the second size. For example, the tree index 10 is different in size between a leaf node (denoted as the 0th node in the figure) and a first node belonging to the hierarchy above it. In the present embodiment, for example, the size of the leaf node is made larger than the size of the first node. Regarding the node size, the technique described in Non-Patent Document 8 may be referred to. Alternatively, the key compression method shown in Non-Patent Documents 9 and 10 may be used.
 ノードの階層によって、そのノードに求められる特性は異なる。例えばある階層に属するノードは、検索に高速性が求められることがあり、他の階層に属するノードは、挿入に高速が求められることがある。ノードが、ソートされていないフラットノードである場合、ノードのサイズが小さいと、検索を高速に行うことができる。ノードのサイズが大きいと、挿入時に要求されるノード分割の回数が減るため、挿入を高速に行える。従って、本実施形態によれば、データベースの速度を向上させることができる。 The characteristics required for the node differ depending on the node hierarchy. For example, a node belonging to a certain hierarchy may be required to have high speed for search, and a node belonging to another hierarchy may be required to be high speed for insertion. When the node is an unsorted flat node, if the size of the node is small, the search can be performed at high speed. If the node size is large, the number of node divisions required at the time of insertion is reduced, so that the insertion can be performed at high speed. Therefore, according to this embodiment, the speed of the database can be improved.
 なお、図1に示したデータベース管理装置100の各構成要素は、ハードウエア単位の構成ではなく、機能単位のブロックを示している。データベース管理装置100の各構成要素は、任意のコンピュータのCPU、メモリ、メモリにロードされた本図の構成要素を実現するプログラム、そのプログラムを格納するハードディスクなどの記憶メディア、ネットワーク接続用インタフェースを中心にハードウエアとソフトウエアの任意の組合せによって実現される。そして、その実現方法、装置には様々な変形例がある。 Each component of the database management apparatus 100 shown in FIG. 1 is not a hardware unit configuration but a functional unit block. Each component of the database management apparatus 100 is centered on an arbitrary computer CPU, memory, a program for realizing the components shown in the figure loaded in the memory, a storage medium such as a hard disk for storing the program, and a network connection interface. It is realized by any combination of hardware and software. There are various modifications of the implementation method and apparatus.
(第2の実施形態)
 図2は、第2の実施形態に係るデータベース管理装置100の構成を示す機能ブロック図である。本実施形態に係るデータベース管理装置100は、ノード管理部120が、少なくとも第1ノード管理部122及び第2ノード管理部124を備えている点を除いて、第1の実施形態に係るデータベース管理装置100と同一である。
(Second Embodiment)
FIG. 2 is a functional block diagram showing a configuration of the database management apparatus 100 according to the second embodiment. The database management apparatus 100 according to the present embodiment is the database management apparatus according to the first embodiment, except that the node management unit 120 includes at least a first node management unit 122 and a second node management unit 124. 100.
 本実施形態において、ツリーインデックス10は、第1の実施形態と同様に、第1の階層に属するノードは第1のサイズとなるように設定されており、第2の階層に属するノードは第2のサイズとなるように設定されていてもよいし、全ての階層に属するノードが同一のサイズを有していても良い。本実施形態においても、リーフノードのサイズを、第1ノードのサイズよりも大きくしてもよい。 In the present embodiment, the tree index 10 is set so that the nodes belonging to the first hierarchy have the first size, and the nodes belonging to the second hierarchy are the second, as in the first embodiment. The nodes may belong to all the hierarchies and may have the same size. Also in this embodiment, the size of the leaf node may be larger than the size of the first node.
 そして第1ノード管理部122は、第1の階層に属するノードに対して、分割、挿入、及び探索を行う。また第2ノード管理部124は、第2の階層に属するノードに対して、第1ノード管理部122とは異なる方法で、分割、挿入、及び探索を行う。 Then, the first node management unit 122 performs division, insertion, and search for the nodes belonging to the first hierarchy. In addition, the second node management unit 124 performs division, insertion, and search on the nodes belonging to the second hierarchy by a method different from that of the first node management unit 122.
 ここで、第1の階層及び第2の階層は、いずれも、一つの階層であっても良いし、複数の階層であっても良い。例えば、ある階層より下の階層が、全て第1の階層であり、残りの階層の全てが第2の階層であっても良い。 Here, each of the first hierarchy and the second hierarchy may be a single hierarchy or a plurality of hierarchies. For example, all layers below a certain layer may be the first layer, and all the remaining layers may be the second layer.
 また、ノード管理部120は、ツリーインデックス10の各階層ごとに、異なる管理部を設けても良い。この場合、ツリーインデックス10の各階層ごとに、異なる方法で分割、挿入、及び探索が行われる。 Further, the node management unit 120 may be provided with a different management unit for each hierarchy of the tree index 10. In this case, division, insertion, and search are performed for each hierarchy of the tree index 10 by different methods.
 図3は、図2に示したノード管理部120が行う探索処理を示すフローチャートである。ノード管理部120は、検索対象となる階層に対応する管理部(例えば第1ノード管理部122及び第2ノード管理部124のいずれか一つ)を用いながら、以下の処理を行う。 FIG. 3 is a flowchart showing search processing performed by the node management unit 120 shown in FIG. The node management unit 120 performs the following processing using a management unit (for example, one of the first node management unit 122 and the second node management unit 124) corresponding to the hierarchy to be searched.
 まずノード管理部120は、検索キーを受け取ると、探索対象の階層を最上位の階層に設定する(ステップS100)。次に、ノード管理部120は、検索キーを用いて、検索対象の階層に属するノードを検索する(ステップS102)。最上位のレベルのノード(ルートノード)は1つしかないため、検索対象が最上位の階層のときには、探索対象とするノードは明らかである。そして検索対象のノードがリーフノードでないとき(ステップS104:No)、検索対象の階層を一つ下げる(ステップS105)。そしてノード管理部120は、更新前の階層のノードのエントリに含まれるポインタから、新たに設定された検索対象の階層に属するノードの一つを特定し(ステップS106)、ステップS102に戻る。 First, when receiving the search key, the node management unit 120 sets the search target hierarchy to the highest hierarchy (step S100). Next, the node management unit 120 searches for a node belonging to the search target hierarchy using the search key (step S102). Since there is only one node (root node) at the highest level, when the search target is the highest hierarchy, the node to be searched is clear. When the search target node is not a leaf node (step S104: No), the search target hierarchy is lowered by one (step S105). Then, the node management unit 120 specifies one of the nodes belonging to the newly set search target hierarchy from the pointer included in the entry of the node of the hierarchy before update (step S106), and returns to step S102.
 またノード管理部120は、検索対象のノードがリーフノードである場合(ステップS104:Yes)、検索対象のノードのエントリに含まれるポインタを用いて、検索キーに関連するデータを読み出す(ステップS107)。 Further, when the search target node is a leaf node (step S104: Yes), the node management unit 120 reads out data related to the search key using the pointer included in the entry of the search target node (step S107). .
 図4及び図5は、図2に示したノード管理部120が行う挿入処理を示すフローチャートである。ノード管理部120は、検索対象となる階層に対応する管理部(例えば第1ノード管理部122及び第2ノード管理部124のいずれか一つ)を用いながら、以下の処理を行う。 4 and 5 are flowcharts showing the insertion processing performed by the node management unit 120 shown in FIG. The node management unit 120 performs the following processing using a management unit (for example, one of the first node management unit 122 and the second node management unit 124) corresponding to the hierarchy to be searched.
 まずノード管理部120は、挿入対象となるエントリを受け取ると、そのエントリ内のキーを、検索キーと認識する。そしてノード管理部120は、探索対象の階層を最上位の階層に設定する(図4のステップS120)。次に、ノード管理部120は、検索キーを用いて、検索対象の階層に属するノードを検索する(図4のステップS122)。最上位のレベルのノード(ルートノード)は1つしかないため、検索対象が最上位の階層のときには、探索対象とするノードは明らかである。そしてノード管理部120は、現在検索している階層の一つ下のノードがリーフノードであるか否かを判断する(図4のステップS124)。リーフノードではないとき(図4のステップS124:No)、検索対象の階層を一つ下げる(図4のステップS125)。そしてノード管理部120は、更新前の階層のノードのエントリに含まれるポインタから、新たに設定された検索対象の階層に属するノードの一つを特定し(図4のステップS126)、ステップS122に戻る。 First, when receiving an entry to be inserted, the node management unit 120 recognizes a key in the entry as a search key. Then, the node management unit 120 sets the search target hierarchy to the highest hierarchy (step S120 in FIG. 4). Next, the node management unit 120 searches for a node belonging to the hierarchy to be searched using the search key (step S122 in FIG. 4). Since there is only one node (root node) at the highest level, when the search target is the highest hierarchy, the node to be searched is clear. Then, the node management unit 120 determines whether the node immediately below the currently searched hierarchy is a leaf node (step S124 in FIG. 4). When it is not a leaf node (step S124 in FIG. 4: No), the search target hierarchy is lowered by one (step S125 in FIG. 4). Then, the node management unit 120 identifies one of the nodes belonging to the newly set search target hierarchy from the pointer included in the entry of the node of the hierarchy before update (step S126 in FIG. 4), and proceeds to step S122. Return.
 またノード管理部120は、一つ下の階層のノードがリーフノードである場合(ステップS124:Yes)、挿入対象のリーフノードを決定する(図4のステップS127)。 Further, when the node in the next lower hierarchy is a leaf node (step S124: Yes), the node management unit 120 determines a leaf node to be inserted (step S127 in FIG. 4).
 次いでノード管理部120は、決定したリーフノードにエントリを挿入する(ステップS128)。ここでオーバーフローが生じなければ(ステップS129:No)、処理を終了する。 Next, the node management unit 120 inserts an entry into the determined leaf node (step S128). If no overflow occurs (step S129: No), the process is terminated.
 オーバーフローが生じたとき(ステップS129:Yes)、ノード管理部120は、リーフノードの分割処理を行い(ステップS130)、分割処理後のリーフノードの一方に、エントリを挿入する(ステップS131)。例えばある値xよりも小さい値を持つエントリは、分割元のノードに挿入され、x以上の値を持つエントリは、新たに生成したノードが挿入される。 When an overflow occurs (step S129: Yes), the node management unit 120 performs a leaf node division process (step S130), and inserts an entry into one of the leaf nodes after the division process (step S131). For example, an entry having a value smaller than a certain value x is inserted into the node of the division source, and a newly generated node is inserted into an entry having a value greater than or equal to x.
 そしてノード管理部120は、新たなエントリを生成する。このエントリは、xをキーとして有しており、かつ新たに生成したノードを指すポインタを有している(ステップS132)。そしてノード管理部120は、現在の階層よりも一つ上の階層が存在する場合(ステップS133:Yes)、階層を一つ上げた上で(ステップS134)、ステップS128に戻り、ステップS132で生成したエントリの挿入処理を行う。 Then, the node management unit 120 generates a new entry. This entry has x as a key and a pointer to the newly generated node (step S132). Then, when there is a hierarchy one level higher than the current hierarchy (step S133: Yes), the node management unit 120 moves up one hierarchy (step S134), returns to step S128, and generates it in step S132. Entry processing of the entered entry is performed.
 現在の階層よりも一つ上の階層が存在しない場合、すなわち現在のノードがルートノードである場合(ステップS134:No)、ノード管理部120は現在のルートノードの一つ上に、新たなルートノードを作成する(ステップS135)。そしてノード管理部120は、ステップS130において新たに生成されたノード、及び分割元のノードそれぞれを表すエントリを、ステップS135で生成したルートノードに挿入する(ステップS136)。新たに生成されたノードに対応するエントリは、ステップS132で生成されている。また、分割元のノードに対応するエントリは、分割元のノードを指すポインタを含んでいるが、このポインタに対応するキーは必要ではない。 When there is no hierarchy one level higher than the current hierarchy, that is, when the current node is a root node (step S134: No), the node management unit 120 adds a new route above the current root node. A node is created (step S135). Then, the node management unit 120 inserts an entry representing each of the node newly generated in step S130 and the node that is the division source into the root node generated in step S135 (step S136). An entry corresponding to the newly generated node is generated in step S132. The entry corresponding to the split source node includes a pointer pointing to the split source node, but the key corresponding to this pointer is not necessary.
 以上、本実施形態によれば、ノードが属する階層に応じて、そのノードに対する分割、挿入、及び探索を行う。従って、データベースの分割、挿入、及び探索の速度を速くすることができる。 As described above, according to the present embodiment, division, insertion, and search are performed on a node according to the hierarchy to which the node belongs. Accordingly, the database division, insertion, and search speed can be increased.
(第3の実施形態)
 第3の実施形態に係るデータベース管理装置100は、ツリーインデックス10を、エントリをソートしないフラットノードの状態で扱う。そして、相対的に下に位置する階層に属するノードのサイズを、それよりも上に位置する階層に属するノードのサイズよりも大きくする。例えば、最下層のノード(リーフノード)を4KBとして、それ以外のノードを128Bとしてもよい。または、最下層のノードのサイズを8KBにして、それより一つ上のノードのサイズを4KB、さらに一つ上のノードのサイズを2KBとしてもよい。
(Third embodiment)
The database management apparatus 100 according to the third embodiment handles the tree index 10 in a flat node state in which entries are not sorted. Then, the size of the node belonging to the hierarchy positioned relatively lower is made larger than the size of the node belonging to the hierarchy positioned higher than that. For example, the lowermost node (leaf node) may be 4 KB, and the other nodes may be 128 B. Alternatively, the size of the lowermost node may be 8 KB, the size of the node one level higher than that may be 4 KB, and the size of the node one level higher than that may be 2 KB.
 第1の実施形態で説明したように、ノードがフラットノードである場合、ノードのサイズが小さいと、検索を高速に行うことができる。ノードのサイズが大きいと、挿入時に要求されるノード分割の回数が減るため、挿入を高速に行える。 As described in the first embodiment, when the node is a flat node, if the size of the node is small, the search can be performed at high speed. If the node size is large, the number of node divisions required at the time of insertion is reduced, so that the insertion can be performed at high speed.
 図6は、フラットノードの構成を示す図である。フラットノードには、エントリを格納する領域と、ノード中のエントリ数を示す数値を格納する領域と、最小ポインタを格納する領域が設けられている。最小ポインタは、与えられた検索キーがそのフラットノード内のどのエントリのキーよりも小さい場合に与えられるポインタである。 FIG. 6 is a diagram showing a configuration of a flat node. The flat node is provided with an area for storing an entry, an area for storing a numerical value indicating the number of entries in the node, and an area for storing a minimum pointer. The minimum pointer is a pointer given when the given search key is smaller than the key of any entry in the flat node.
 図7は、本実施形態におけるノード管理部120の検索時の動作を示すフローチャートである。本図に示す動作は、あるフラットノード内において検索を行うものである。 FIG. 7 is a flowchart showing the operation at the time of search of the node management unit 120 in this embodiment. The operation shown in this figure performs a search within a certain flat node.
 まずノード管理部120は、最初のエントリを対象に定める(ステップS140)。次いでノード管理部120は、対象となっているエントリに含まれているキーが、検索キー以下であるか否かを判断する(ステップS141)。 First, the node management unit 120 determines the first entry as a target (step S140). Next, the node management unit 120 determines whether or not the key included in the target entry is equal to or less than the search key (step S141).
 そのキーが検索キーよりも大きい場合(ステップS141:No)、ノード管理部120は、次のエントリを対象に設定し(ステップS142)、対象となるエントリがあるか否かを判断する(ステップS143)。エントリがある場合(ステップS143:Yes)、ノード管理部120はステップS141に戻る。エントリがない場合(ステップS143:No)、ノード管理部120は、フラットノード内の最小ポインタを読み出す(ステップS144)。 When the key is larger than the search key (step S141: No), the node management unit 120 sets the next entry as a target (step S142) and determines whether there is a target entry (step S143). ). If there is an entry (step S143: Yes), the node management unit 120 returns to step S141. When there is no entry (step S143: No), the node management unit 120 reads the minimum pointer in the flat node (step S144).
 また、ステップS141において、対象となっているエントリに含まれているキーが、検索キー以下である場合(Yes)、ノード管理部120は、そのキーを、最大キーに設定する(ステップS145)。ノード管理部120は、次のエントリを対象に設定し(ステップS146)、対象となるエントリがあるか否かを判断する(ステップS147)。エントリがない場合(ステップS147:No)、ノード管理部120は、現在対象となっているエントリを読み出す(ステップS148)。 If the key included in the target entry is equal to or lower than the search key in step S141 (Yes), the node management unit 120 sets the key as the maximum key (step S145). The node management unit 120 sets the next entry as a target (step S146), and determines whether there is a target entry (step S147). When there is no entry (step S147: No), the node management unit 120 reads the entry currently targeted (step S148).
 またエントリがある場合(ステップS147:Yes)、ノード管理部120は、対象となっているエントリに含まれているキーが、検索キー以下であるか否かを判断する(ステップS149)。そのキーが検索キーより大きい場合(ステップS149:No)、ノード管理部120は、ステップS146に戻る。 If there is an entry (step S147: Yes), the node management unit 120 determines whether the key included in the target entry is equal to or less than the search key (step S149). When the key is larger than the search key (step S149: No), the node management unit 120 returns to step S146.
 そのキーが検索キー以下の場合(ステップS149:Yes)、ノード管理部120は、エントリ中のキーが、ステップS145で設定した最大キーよりも大きいか否かを判断する(ステップS150)。ノード管理部120は、エントリ中のキーが最大キーよりも大きい場合(ステップS150:Yes)はステップS145に戻り、エントリ中のキーが最大キー以下の場合(ステップS150:No)はステップS146に戻る。 If the key is equal to or less than the search key (step S149: Yes), the node management unit 120 determines whether the key in the entry is larger than the maximum key set in step S145 (step S150). The node management unit 120 returns to step S145 when the key in the entry is larger than the maximum key (step S150: Yes), and returns to step S146 when the key in the entry is equal to or less than the maximum key (step S150: No). .
 図8は、本実施形態におけるノード管理部120のノード分割時の動作を示すフローチャートである。まずノード管理部120は、分割の基準となるキー(分割キー)を設定する(ステップS160)。ついでノード管理部120は、最初のエントリを対象に定める(ステップS161)。次いでノード管理部120は、対象となっているエントリに含まれているキーが、分割キー以下であるか否かを判断する(ステップS162)。 FIG. 8 is a flowchart showing an operation at the time of node division of the node management unit 120 in this embodiment. First, the node management unit 120 sets a key (partition key) that serves as a reference for division (step S160). Next, the node management unit 120 determines the first entry as a target (step S161). Next, the node management unit 120 determines whether or not the key included in the target entry is equal to or less than the split key (step S162).
 そのキーが検索キーよりも大きい場合(ステップS162:No)、ノード管理部120は、次のエントリを対象に設定し(ステップS163)、対象となるエントリがあるか否かを判断する(ステップS164)。エントリがある場合(ステップS164:Yes)、ノード管理部120はステップS162に戻る。エントリがない場合(ステップS164:No)、ノード管理部120は、処理を終了する。 When the key is larger than the search key (step S162: No), the node management unit 120 sets the next entry as a target (step S163), and determines whether there is a target entry (step S164). ). If there is an entry (step S164: Yes), the node management unit 120 returns to step S162. When there is no entry (step S164: No), the node management unit 120 ends the process.
 また、ステップS162において、対象となっているエントリに含まれているキーが、検索キー以下である場合(Yes)、ノード管理部120は、現在対象としているエントリを、新たなノードに挿入する(ステップS165)。そしてノード管理部120は、最後尾のエントリを、ステップS165で挿入対象となったエントリがあった位置に移動させ(ステップS166)、エントリ数を一つ減らした(ステップS167)後、ステップS162に戻る。 In step S162, when the key included in the target entry is equal to or lower than the search key (Yes), the node management unit 120 inserts the current target entry into a new node ( Step S165). Then, the node management unit 120 moves the last entry to the position where the entry targeted for insertion in step S165 was present (step S166), and reduced the number of entries by one (step S167), and then proceeds to step S162. Return.
 なお、ノード管理部120は、フラットノードに対しては以下のようにしてエントリを挿入する。まず、ノード管理部120は、挿入対象のエントリがcであれば、このエントリをc番目のエントリの位置に書き込む。そして、ノード管理部120は、そのフラットノードのエントリ数を(c+1)とする。新たなエントリを挿入するスペースがなければ、上記したノードの分割処理を行う。 Note that the node management unit 120 inserts an entry into the flat node as follows. First, if the entry to be inserted is c, the node management unit 120 writes this entry at the position of the c-th entry. Then, the node management unit 120 sets the number of entries of the flat node as (c + 1). If there is no space to insert a new entry, the above node division processing is performed.
 以上、本実施形態によれば、相対的に下に位置する階層に属するノードのサイズを、それよりも上に位置する階層に属するノードのサイズよりも大きくしている。このため、データベースの分割、挿入、及び探索の速度を速くすることができる。 As described above, according to the present embodiment, the size of the node belonging to the hierarchy located relatively lower is made larger than the size of the node belonging to the hierarchy located higher than that. For this reason, the speed of database division, insertion, and search can be increased.
(第4の実施形態)
 第4の実施形態に係るデータベース管理装置100は、ツリーインデックス10を、フラットノードの状態、及びソートされたノード(ソーテッドノード)の双方が含まれている状態で扱う。ソーテッドノードの構成は、図6に示したフラットノードの構成と同様である。ただし、同一の階層に属するノードは、フラットノード及びソーテッドノードのいずれか一方に統一されている。ツリーインデックス10は、例えばある階層より下のノードはフラットノードになっており、それ以外のノードはソーテッドノードになっている。なお、フラットノードとなっている階層において、下の層になるにつれてノードが大きくなっても良い。またソーテッドノードとなっている階層において、上の層になるにつれてノードが大きくなっても良い。
(Fourth embodiment)
The database management apparatus 100 according to the fourth embodiment handles the tree index 10 in a state in which both a flat node state and a sorted node (sorted node) are included. The configuration of the sorted node is the same as that of the flat node shown in FIG. However, the nodes belonging to the same hierarchy are unified as either a flat node or a sorted node. In the tree index 10, for example, nodes below a certain hierarchy are flat nodes, and other nodes are sorted nodes. Note that, in a hierarchy that is a flat node, the node may become larger as the layer becomes lower. Further, in a hierarchy that is a sorted node, the node may become larger as it becomes an upper layer.
 そしてノード管理部120は、フラットノードに対しては、第3の実施形態で示した方法により、分割、挿入、及び探索を行う。またノード管理部120は、ソーテッドノードに対しては、以下の方法により、分割、挿入、及び探索を行う。 Then, the node management unit 120 performs division, insertion, and search on the flat node by the method described in the third embodiment. Further, the node management unit 120 performs division, insertion, and search on the sorted node by the following method.
 図9は、ノード管理部120がソーテッドノードに対して探索を行うときの動作を示すフローチャートである。まずノード管理部120は、最初のエントリ中のキー(すなわちそのノードにおける最小のキー)が検索キー以下であるか否かを判断する(ステップS180)。対象のキーが検索キーよりも大きければ(ステップS180:No)、ノード管理部120は、最小ポインタを読み出す(ステップS181)。 FIG. 9 is a flowchart showing an operation when the node management unit 120 searches the sorted node. First, the node management unit 120 determines whether or not the key in the first entry (that is, the smallest key in the node) is equal to or less than the search key (step S180). If the target key is larger than the search key (step S180: No), the node management unit 120 reads the minimum pointer (step S181).
 対象のキーが検索キー以下である場合(ステップS180:Yes)、ノード管理部120は、二分探索の最初の探索対象のエントリtを、中央に位置するエントリに設定し(t=n/2、ただしnはそのノードに含まれるエントリの数)、最大キーmを、最初のエントリ中のキーに設定する(ステップS182)。次いでノード管理部120は、探索対象のエントリよりもキーが小さい未探索のエントリの数leと探索対象のエントリよりもキーが大きい未探索のエントリの数reそれぞれの初期値を計算する(le=t-1,re=(n-1)/2)(ステップS183)。 When the target key is equal to or less than the search key (step S180: Yes), the node management unit 120 sets the first search target entry t of the binary search to the entry located in the center (t = n / 2, Here, n is the number of entries included in the node), and the maximum key m is set as the key in the first entry (step S182). Next, the node management unit 120 calculates an initial value of the number le of unsearched entries having a key smaller than the entry to be searched and the number re of unsearched entries having a key larger than the entry to be searched (le = t-1, re = (n-1) / 2) (step S183).
 次いでノード管理部120は、t番目のエントリのキーが検索キー以下であるかを調べる(ステップS184)。t番目のエントリのキーが検索キーよりも大きい場合(ステップS184:No)、ノード管理部120は、t番目のエントリのキー以下である未探索のキーがあるかどうか(leが0より大きいかどうか)を調べる(ステップS185)。ない場合(ステップS185:No)、検索キー以下の未探索のキーはないので、ノード管理部120は、現在のmに設定されているエントリを読み出す(ステップS186)。 Next, the node management unit 120 checks whether the key of the t-th entry is equal to or less than the search key (step S184). When the key of the t-th entry is larger than the search key (step S184: No), the node management unit 120 determines whether there is an unsearched key that is equal to or less than the key of the t-th entry (whether le is greater than 0). Whether or not) is checked (step S185). If there is no key (step S185: No), there is no unsearched key equal to or lower than the search key, so the node management unit 120 reads the entry set to the current m (step S186).
 未探索のキーがある場合、すなわちleが0より大きければ(ステップS185:Yes)、ノード管理部120は、未探索のエントリのうち中央に位置するエントリのキーを、次の探索対象のキーとする(ステップS187)。そしてノード管理部120は、t番目のエントリよりもキーが大きい未探索のエントリの数reをle / 2に、探索対象のエントリよりもキーが小さい未探索のエントリの数leを(le - 1) / 2にする(ステップS188)。そして、ステップS184に戻る。 If there is an unsearched key, that is, if le is larger than 0 (step S185: Yes), the node management unit 120 sets the key of the entry located in the center among the unsearched entries as the next search target key. (Step S187). Then, the node management unit 120 sets the number re of unsearched entries having a key larger than the t-th entry to le / 2, and the number le of unsearched entries having a key smaller than the search target entry (le − 1). ) Set to / 2 (step S188). Then, the process returns to step S184.
 t番目のエントリのキーが検索キー以下の場合(ステップS184:Yes)、ノード管理部120は、t番目のエントリのキーが最大キーm以下であるか判断する(ステップS189)。t番目のエントリのキーが最大キーm以下である場合(ステップS189:Yes)、ノード管理部120は、最大キーmを、t番目のエントリのキーとする(ステップS193)。 If the key of the tth entry is equal to or less than the search key (step S184: Yes), the node management unit 120 determines whether the key of the tth entry is equal to or less than the maximum key m (step S189). When the key of the t-th entry is equal to or less than the maximum key m (step S189: Yes), the node management unit 120 sets the maximum key m as the key of the t-th entry (step S193).
 t番目のエントリのキーが最大キーm以下でない場合(ステップS189:No)、または、ステップS193の後、ノード管理部120は、t番目のエントリのキー以下である未探索のキーがあるかどうか(leが0より大きいかどうか)を調べる(ステップS190)。ない場合(ステップS190:No)、検索キー以下の未探索のキーはないので、ノード管理部120は、現在のmに設定されているエントリを読み出す(ステップS186)。 If the key of the t-th entry is not less than or equal to the maximum key m (step S189: No), or after step S193, the node management unit 120 determines whether there is an unsearched key that is less than or equal to the key of the t-th entry. It is checked whether or not le is greater than 0 (step S190). If there is no key (step S190: No), there is no unsearched key equal to or lower than the search key, and the node management unit 120 reads the entry set to the current m (step S186).
 未探索のキーがある場合、すなわちleが0より大きければ(ステップS190:Yes)、ノード管理部120は、未探索のエントリのうち中央に位置するエントリのキーを、次の探索対象のキーとする(ステップS191)。そしてノード管理部120は、t番目のエントリよりもキーが大きい未探索のエントリの数reをre / 2に、探索対象のエントリよりもキーが小さい未探索のエントリの数leを(re - 1) / 2にする(ステップS192)。そして、ステップS184に戻る。 If there is an unsearched key, that is, if le is greater than 0 (step S190: Yes), the node management unit 120 sets the key of the entry located in the center among the unsearched entries as the next search target key. (Step S191). Then, the node management unit 120 sets the number re of unsearched entries having a key larger than the t-th entry to re / 2, and the number le of unsearched entries having a key smaller than the search target entry (re-1). ) Set to / に す る 2 (step S192). Then, the process returns to step S184.
 また、ノード管理部120は、ソーテッドノードに対しては、以下のようにして挿入処理を行う。まずノード管理部120は、挿入するエントリを受け取ると、エントリのキーを検索キーとして、図9に示した探索処理を行う。すると検索キー以下の最大のキーの位置がわかるため、ノード管理部120は、その次の位置を、エントリを挿入すべき位置と判断する。通常はこの位置に別のキーが記録されているため、この位置以降のキーを全て1つ正方向にずらして、エントリ数を1ずつ増加させる。そして、ノード管理部120は、新たなエントリを挿入する。ノード管理部120は、新たなエントリを挿入するスペースがなければ、次に示す分割処理を行う。 Further, the node management unit 120 performs the insertion process for the sorted node as follows. First, upon receiving an entry to be inserted, the node management unit 120 performs the search process shown in FIG. 9 using the entry key as a search key. Then, since the position of the largest key below the search key is known, the node management unit 120 determines that the next position is a position where an entry is to be inserted. Usually, since another key is recorded at this position, all the keys after this position are shifted one by one in the forward direction to increase the number of entries by one. Then, the node management unit 120 inserts a new entry. If there is no space for inserting a new entry, the node management unit 120 performs the following division process.
 ノード管理部120は、ソーテッドノードに対しては、以下のようにして分割処理を行う。まず、ノード管理部120は、ソーテッドノードが格納しているエントリの数をcとすると、c/2番目のエントリから (c-1)番目のエントリを新たなノードに挿入する。そして、エントリ数をcからc/2に減らす。 The node management unit 120 performs division processing on the sorted node as follows. First, the node management unit 120 inserts the (c−1) th entry from the c / 2th entry into a new node, where c is the number of entries stored in the sorted node. Then, the number of entries is reduced from c to c / 2.
 ソーテッドノードは、検索を高速で行うことができる半面、挿入は低速になる。一方、フラットノードは、挿入を高速で行うことができる半面、検索は低速になる。ツリーインデックスでは、下位の階層に位置するノードほど、挿入の頻度が高くなる。従って、本実施形態のように、ある階層より下のノードをフラットノードにして、それ以外のノードをソーテッドノードにすると、データベースの速度を速くすることができる。 Sorted node can search at high speed, but insertion is slow. On the other hand, flat nodes can be inserted at high speed, but search is slow. In the tree index, the frequency of insertion increases as the node is located in a lower hierarchy. Therefore, as in this embodiment, if the nodes below a certain hierarchy are flat nodes and the other nodes are sorted nodes, the database speed can be increased.
(第5の実施形態)
 本実施形態に係るデータベース管理装置100は、ツリーインデックス10を、ソーテッドノードの状態で扱う。そして相対的に下に位置する階層に属するノードのサイズを、それよりも上に位置する階層に属するノードのサイズよりも小さくする。例えば最下層のノード(リーフノード)を128Bとして、ブランチノードを4kBとしてもよい。上記したように、ソーテッドノードでは、ノードのサイズが小さいほど、挿入に必要な時間が短くなる。この理由は、ソーテッドノードの挿入においては、エントリの移動が頻繁に(例えば半数のエントリに対して)発生するためである。
(Fifth embodiment)
The database management apparatus 100 according to the present embodiment handles the tree index 10 in the state of a sorted node. Then, the size of the node belonging to the hierarchy positioned relatively lower is made smaller than the size of the node belonging to the hierarchy positioned higher than that. For example, the lowest layer node (leaf node) may be 128B and the branch node may be 4 kB. As described above, in a sorted node, the smaller the node size, the shorter the time required for insertion. This is because entry insertion frequently occurs (for example, half of the entries) in the insertion of a sorted node.
 本実施形態によっても、データベースの速度を速くすることができる。 Also according to this embodiment, the speed of the database can be increased.
(第6の実施形態)
 図10は、第6の実施形態に係るデータベース管理装置100の構成を、ツリーインデックス10の構造とともに示す図である。本実施形態に係るデータベース管理装置100は、ツリーインデックス10が、少なくとも一つの階層のノードを、ツリー構造を有するツリーノードとしている点を除いて、第2~第5の実施形態に係るデータベース管理装置100のいずれかと同様の構成である。図10に示す例では、第1階層に属するノード(例えばリーフノード)をフラットノードとして、その上に位置するブランチノードをツリーノードとして、最上層に位置するノード(ルートノード)をソーテッドノードとしている。
(Sixth embodiment)
FIG. 10 is a diagram illustrating the configuration of the database management apparatus 100 according to the sixth embodiment, together with the structure of the tree index 10. The database management apparatus 100 according to the present embodiment is the database management apparatus according to the second to fifth embodiments, except that the tree index 10 uses at least one hierarchical node as a tree node having a tree structure. The configuration is the same as any one of 100. In the example shown in FIG. 10, a node (for example, a leaf node) belonging to the first hierarchy is set as a flat node, a branch node positioned above it as a tree node, and a node positioned at the top level (root node) as a sorted node. Yes.
 図11の表は、フラットノード、ソーテッドノード、及びツリーノードのそれぞれにおいて、検索に必要な計算量、挿入に必要な計算量、及び空間効率を示している。 The table in FIG. 11 shows the calculation amount necessary for search, the calculation amount necessary for insertion, and space efficiency in each of the flat node, the sorted node, and the tree node.
 フラットノードにおいては、線形探索を行う必要があるため、検索の計算量はO(n)となっている。一方、フラットノードにおける挿入は追記するだけなので、挿入の計算量はO(1)である。そして、フラットノードでは、ノード内のスペースは、ごく少数のメタデータ(エントリ数と最小ポインタ)を除いて、エントリで占められる。そのため、フラットノードの空間効率はほぼ100%である。 Since a flat node needs to perform a linear search, the computational complexity of the search is O (n). On the other hand, since the insertion at the flat node is only added, the amount of calculation of the insertion is O (1). In a flat node, the space in the node is occupied by entries except for a very small number of metadata (number of entries and minimum pointer). Therefore, the space efficiency of the flat node is almost 100%.
 ソーテッドノードにおいては、二分探索によって検索が行われるため、検索時の計算量はO(log n)になる。ソーテッドノードの挿入時には、ソートされた状態を保つために既存エントリの移動が必要となるため、計算量はO(n)になる。空間効率はフラットノードと同じくほぼ100%である。 In the sorted node, the search is performed by binary search, so the amount of calculation at the time of search is O (log n). When a sorted node is inserted, the existing entry needs to be moved in order to keep the sorted state, so that the calculation amount is O (n). The space efficiency is almost 100% like the flat node.
 ツリーノードにおいては、検索と挿入の計算量がともにO(log n)であるが、空間効率は70%程度になる。典型的なツリーインデックスであるB+-treeを想定すると、内部ノードの使用率が70%程度になるからである。 In the tree node, both search and insertion are both O (log n), but the space efficiency is about 70%. This is because assuming a B + -tree that is a typical tree index, the usage rate of the internal node is about 70%.
 図10に示す例では、上記したように中間層のノードがツリーノードになっている。つまり、x以下y以上の階層のノードをツリーノードとする。ただし、最低一つの階層は、ツリーノードではないとする。別の言い方をすれば、ツリーインデックスの階層が0から(h-1)まである場合、(y-x)は(h-1)よりも小さい。このようにすると、中間層のノードにおいて挿入も発生する場合、検索と挿入をともに十分な速度で行うことができる。そしてこのツリーノードはB+-treeであってもよい。B+-treeにおける挿入と検索は、非特許文献2に示される通りである。 In the example shown in FIG. 10, the nodes in the middle layer are tree nodes as described above. That is, a node having a hierarchy of x or less and y or more is set as a tree node. However, it is assumed that at least one hierarchy is not a tree node. In other words, when the tree index hierarchy is from 0 to (h−1), (y−x) is smaller than (h−1). In this way, when insertion also occurs in the intermediate layer node, both search and insertion can be performed at a sufficient speed. This tree node may be a B + -tree. Insertion and search in the B + -tree are as shown in Non-Patent Document 2.
 また、上位のノードをソーテッドノードにしており、下位のノードをフラットノードにしている。このため、ライト比率が大きい階層(すなわち下位のノード)ほど挿入の計算量を減らし、ライト比率が小さい階層(すなわち上位のノード)ほど検索の計算量を減らすことができる。 Also, the upper node is a sorted node and the lower node is a flat node. For this reason, the calculation amount of insertion can be reduced as the write ratio is higher (that is, the lower node), and the search calculation amount can be reduced as the write ratio is lower (ie, the upper node).
 なお、上位層のノードは高速だが小容量な媒体に記録されることが多いため、空間効率を高くすることが好ましい。一方、中間層以下のノードが記録される媒体の特性を考慮すると、空間効率を犠牲にしても計算量を削減するほうが好ましい。下位の、特に挿入の度にエントリが追加されるリーフノードに関しては、挿入速度を最優先にすることが好ましい。 Note that it is preferable to increase the space efficiency because the upper layer nodes are often recorded on a high-speed but small-capacity medium. On the other hand, considering the characteristics of the medium on which the nodes below the intermediate layer are recorded, it is preferable to reduce the calculation amount even at the expense of space efficiency. For the lower level, especially the leaf node to which an entry is added at every insertion, it is preferable to give the highest priority to the insertion speed.
 なお本実施形態において、上位のノードもツリーノードにしてもよいし、下位のノードもツリーノードにしてもよい。上位の記憶媒体の容量が大きければ、ツリーノードを使うと挿入速度が向上する。検索処理が多ければ、下位のノードをツリーノードにして検索速度を向上させると、全体の処理速度が向上する。 In this embodiment, an upper node may be a tree node, and a lower node may be a tree node. If the capacity of the upper storage medium is large, the insertion speed is improved by using a tree node. If there are many search processes, the overall processing speed will improve if the lower nodes are made tree nodes to improve the search speed.
(第7の実施形態)
 本実施形態は、ツリーインデックス10のツリーノードが、CPUのキャッシュラインサイズを考慮するツリーインデックス(例えば、非特許文献4に記載のCSS-tree、非特許文献5のCSB+-tree、非特許文献6のpB+-tree、非特許文献7のfpB+-tree、及び非特許文献11のFAST)となっている点を除いて、第6の実施形態と同様である。例えばCSS-treeを用いる場合、ノードのサイズは、キャッシュラインのサイズと等しくなっている(例えば64B)。ここで、キャッシュラインのサイズは小さい場合が多いため、ノードにおいて、エントリのポインタは省略されてもよい。
(Seventh embodiment)
In this embodiment, the tree node of the tree index 10 is a tree index in which the cache line size of the CPU is considered (for example, CSS-tree described in Non-Patent Document 4, CSB + -tree described in Non-Patent Document 5, Non-Patent Document 6). PB + -tree, fpB + -tree of Non-Patent Document 7, and FAST of Non-Patent Document 11). For example, when CSS-tree is used, the size of the node is equal to the size of the cache line (for example, 64B). Here, since the size of the cache line is often small, the entry pointer may be omitted in the node.
 B+-treeなどはキャッシュを考慮しないツリーインデックスでは、ノードサイズは、ディスクI/Oのサイズ(ex. 4KB)に合わせて設定されている。一方、CSSノードを用いると、ソーテッドノードと比較して、高速な検索、及び同等の空間効率が可能になる。検索が高速な理由は、キャッシュミスが少ないことと、ポインタ省略によって多くのエントリをノードに詰め込んでいることである。空間効率が同等な理由は、CSS-treeは論理的にはツリーだが、物理的には配列だからである。ただし、CSSノードを用いると、ソーテッドノードと比較して、挿入が低速になる。この理由は、新たなエントリを挿入する度に、CSS-tree全体を再構築しなければならないからである。CSS-treeの検索方法と構築方法については、非特許文献5に示される通りである。 For B + -tree and other tree indexes that do not consider cache, the node size is set according to the disk I / O size (ex. 4KB). On the other hand, when a CSS node is used, a high-speed search and equivalent space efficiency are possible compared to a sorted node. The reason why the search is fast is that there are few cache misses and that many entries are packed into the node by omitting the pointer. The space efficiency is equivalent because CSS-tree is logically a tree but physically an array. However, when a CSS node is used, insertion is slower than a sorted node. This is because the entire CSS-tree must be rebuilt each time a new entry is inserted. The CSS-tree search method and construction method are as shown in Non-Patent Document 5.
 本実施形態では、例えば、ルートノードを、CSSノードなどのキャッシュサイズを考慮するノードとし、リーフノードをフラット/ソーテッド/ツリーのいずれかのノードとする。そして、それ以外の階層のノードは任意に選択される。CSSノードは高速な検索と高い空間効率を提供するため、ライト比率が低く、最も上位の媒体(典型的にはCPUキャッシュ)に記録されがちなルートノードに用いる。 In this embodiment, for example, the root node is a node that considers the cache size, such as a CSS node, and the leaf node is one of flat / sorted / tree nodes. Nodes in other layers are arbitrarily selected. The CSS node is used for the root node, which has a low write ratio and tends to be recorded in the highest media (typically CPU cache) in order to provide high-speed search and high space efficiency.
(第8の実施形態)
 本実施形態に係るデータベース管理装置100が管理するツリーインデックス10は、ある階層よりも下位のノードは、フラッシュメモリ内に設けられている。そして、フラッシュメモリ内のノードは、非特許文献15に示されるLA-treeや非特許文献16および17に示されるFD-treeなど、フラッシュメモリ向けのツリーインデックスを内部に持たせたツリーノードとなっている。
(Eighth embodiment)
In the tree index 10 managed by the database management apparatus 100 according to the present embodiment, nodes lower than a certain hierarchy are provided in the flash memory. The nodes in the flash memory are tree nodes having a tree index for the flash memory such as LA-tree shown in Non-Patent Document 15 and FD-tree shown in Non-Patent Documents 16 and 17. ing.
 フラッシュメモリは、ディスクよりも高速なランダムリードを提供する一方で、ランダムライトは低速である。この非対称性を考慮したツリーインデックスがLA-treeやFD-treeである。これらのツリーノードは、いずれも、同一の階層に属する複数のノードに対する書き込み要求をバッファに一時的に記憶させた上で、このバッファに記憶された複数の書き込み要求をまとめて処理するようになっている。 Flash memory provides faster random reads than disks, while random writes are slower. The tree indexes considering this asymmetry are LA-tree and FD-tree. Each of these tree nodes temporarily stores write requests for a plurality of nodes belonging to the same hierarchy in a buffer and then processes the plurality of write requests stored in the buffer together. ing.
 なお、上記した実施形態によれば、以下の発明が開示されている。
(付記1)
 ツリーインデックス構造のデータベースを管理するデータベース管理装置であって、
 第1の階層に属するノードは第1のサイズとなるように設定されており、第2の階層に属するノードは第2のサイズとなるように設定されており、
 前記第1の階層に属するノード及び前記第2の階層に属するノードそれぞれに対して、分割、挿入、及び探索を行うノード管理手段を備えるデータベース管理装置。
(付記2)
 付記1に記載のデータベース管理装置において、
 前記ノード管理手段は、
  前記第1の階層に属するノードに対して、分割、挿入、及び探索を行う第1ノード管理手段と、
  前記第2の階層に属するノードに対して、前記第1ノード管理手段とは異なる方法で分割、挿入、及び探索を行う第2ノード管理手段と、
を有するデータベース管理装置。
(付記3)
 ツリーインデックス構造のデータベースを管理するデータベース管理装置であって、
 第1の階層に属するノードに対して、分割、挿入、及び探索を行う第1ノード管理手段と、
 第2の階層に属するノードに対して、前記第1ノード管理手段とは異なる方法で分割、挿入、及び探索を行う第2ノード管理手段と、
を有するデータベース管理装置。
(付記4)
 付記2又は3に記載のデータベース管理装置において、
 前記第1の階層は、前記第2の階層よりも下位に位置し、
 前記第1の階層に属するノードは、前記第2の階層に属するノードよりもサイズが大きいデータベース管理装置。
(付記5)
 付記4に記載のデータベース管理装置において、
 前記第1の階層に属するノード、及び前記第2の階層に属するノードは、エントリがソートされていないフラットノードであるデータベース管理装置。
(付記6)
 付記4に記載のデータベース管理装置において、
 前記第1の階層に属するノードは、エントリがソートされていないフラットノードであり、前記第2の階層に属するノードは、エントリがソートされているソーテッドノードであるデータベース管理装置。
(付記7)
 付記2又は3に記載のデータベース管理装置において、
 前記第1の階層は、前記第2の階層よりも下位に位置し、
 前記第1の階層に属するノードは、前記第2の階層に属するノードよりもサイズが小さいデータベース管理装置。
(付記8)
 付記7に記載のデータベース管理装置において、
 前記第1の階層に属するノード、及び前記第2の階層に属するノードは、エントリがソートされているソーテッドノードであるデータベース管理装置。
(付記9)
 付記1~8のいずれか一つに記載のデータベース管理装置において、
 前記第1の階層に属するノード、及び前記第2の階層に属するノードの少なくとも一つは、サイズが、前記データベース管理装置のCPUのキャッシュラインのサイズと同じであるデータベース管理装置。
(付記10)
 付記2又は3に記載のデータベース管理装置において、
 少なくとも前記第1の階層に属するノードは、フラッシュメモリ内に設けられており、
 前記第1ノード管理手段は、前記第1の階層に属するノードに対する書き込み要求をバッファに一時的に記憶させ、前記バッファに記憶された複数の前記書き込み要求をまとめて前記第1の階層に属するノードに書き込むデータベース管理装置。
(付記11)
 コンピュータを用いて、ツリーインデックス構造のデータベースを管理するデータベース管理方法であって、
 第1の階層に属するノードは第1のサイズとなるように設定されており、第2の階層に属するノードは第2のサイズとなるように設定する、データベース管理方法。
(付記12)
 付記11に記載のデータベース管理方法において、
 コンピュータが、
  前記第1の階層に属するノードに対して、分割、挿入、及び探索を行い、
 前記コンピュータが、第2の階層に属するノードに対して、前記第1ノード管理手段とは異なる方法で分割、挿入、及び探索を行うデータベース管理方法。
(付記13)
 ツリーインデックス構造のデータベースを管理するデータベース管理方法であって、
 コンピュータが、第1の階層に属するノードに対して、分割、挿入、及び探索を行い、
 前記コンピュータが、第2の階層に属するノードに対して、前記第1の階層に属するノードとは異なる方法で分割、挿入、及び探索を行うデータベース管理方法。
(付記14)
 付記12又は13に記載のデータベース管理方法において、
 前記第1の階層は、前記第2の階層よりも下位に位置し、
 前記第1の階層に属するノードは、前記第2の階層に属するノードよりもサイズが大きいデータベース管理方法。
(付記15)
 付記14に記載のデータベース管理方法において、
 前記第1の階層に属するノード、及び前記第2の階層に属するノードは、エントリがソートされていないフラットノードであるデータベース管理方法。
(付記16)
 付記14に記載のデータベース管理方法において、
 前記第1の階層に属するノードは、エントリがソートされていないフラットノードであり、前記第2の階層に属するノードは、エントリがソートされているソーテッドノードであるデータベース管理方法。
(付記17)
 付記12又は13に記載のデータベース管理方法において、
 前記第1の階層は、前記第2の階層よりも下位に位置し、
 前記第1の階層に属するノードは、前記第2の階層に属するノードよりもサイズが小さいデータベース管理方法。
(付記18)
 付記17に記載のデータベース管理方法において、
 前記第1の階層に属するノード、及び前記第2の階層に属するノードは、エントリがソートされているソーテッドノードであるデータベース管理方法。
(付記19)
 付記11~18のいずれか一つに記載のデータベース管理方法において、
 前記第1の階層に属するノード、及び前記第2の階層に属するノードの少なくとも一つは、サイズが、前記コンピュータのCPUのキャッシュラインのサイズと同じであるデータベース管理方法。
(付記20)
 付記12又は13に記載のデータベース管理方法において、
 少なくとも前記第1の階層に属するノードは、フラッシュメモリ内に設けられており、
 前記コンピュータは、前記第1の階層に属するノードに対する書き込み要求をバッファに一時的に記憶させ、前記バッファに記憶された複数の前記書き込み要求をまとめて前記第1の階層に属するノードに書き込むデータベース管理方法。
(付記21)
 コンピュータを、ツリーインデックス構造のデータベースを管理するデータベース管理装置として機能させるためのプログラムであって、
 前記コンピュータに、
 第1の階層に属するノードに対して、分割、挿入、及び探索を行う第1ノード管理機能と、
 第2の階層に属するノードに対して、前記第1ノード管理機能とは異なる方法で分割、挿入、及び探索を行う第2ノード管理機能と、
を実現させるプログラム。
(付記22)
 付記21に記載のプログラムにおいて、
 第1の階層に属するノードは第1のサイズとなるように設定されており、第2の階層に属するノードは第2のサイズとなるように設定されているプログラム。
(付記23)
 付記22に記載のプログラムにおいて、
 前記第1の階層は、前記第2の階層よりも下位に位置し、
 前記第1の階層に属するノードは、前記第2の階層に属するノードよりもサイズが大きいプログラム。
(付記24)
 付記23に記載のプログラムにおいて、
 前記第1の階層に属するノード、及び前記第2の階層に属するノードは、エントリがソートされていないフラットノードであるプログラム。
(付記25)
 付記23に記載のプログラムにおいて、
 前記第1の階層に属するノードは、エントリがソートされていないフラットノードであり、前記第2の階層に属するノードは、エントリがソートされているソーテッドノードであるプログラム。
(付記26)
 付記22に記載のプログラムにおいて、
 前記第1の階層は、前記第2の階層よりも下位に位置し、
 前記第1の階層に属するノードは、前記第2の階層に属するノードよりもサイズが小さいプログラム。
(付記27)
 付記26に記載のプログラムにおいて、
 前記第1の階層に属するノード、及び前記第2の階層に属するノードは、エントリがソートされているソーテッドノードであるプログラム。
(付記28)
 付記21~27のいずれか一つに記載のプログラムにおいて、
 前記第1の階層に属するノード、及び前記第2の階層に属するノードの少なくとも一つは、サイズが、前記コンピュータのCPUのキャッシュラインのサイズと同じであるプログラム。
(付記29)
 付記22に記載のプログラムにおいて、
 少なくとも前記第1の階層に属するノードは、フラッシュメモリ内に設けられており、
 前記第1ノード管理機能は、前記第1の階層に属するノードに対する書き込み要求をバッファに一時的に記憶させ、前記バッファに記憶された複数の前記書き込み要求をまとめて前記第1の階層に属するノードに書き込むプログラム。
According to the above-described embodiment, the following invention is disclosed.
(Appendix 1)
A database management device for managing a database having a tree index structure,
Nodes belonging to the first hierarchy are set to be the first size, nodes belonging to the second hierarchy are set to be the second size,
A database management apparatus comprising node management means for performing division, insertion, and search for each of nodes belonging to the first hierarchy and nodes belonging to the second hierarchy.
(Appendix 2)
In the database management device according to attachment 1,
The node management means includes
First node management means for dividing, inserting, and searching for nodes belonging to the first hierarchy;
Second node management means for dividing, inserting, and searching for nodes belonging to the second hierarchy by a method different from the first node management means;
A database management device.
(Appendix 3)
A database management device for managing a database having a tree index structure,
First node management means for dividing, inserting, and searching for nodes belonging to the first hierarchy;
Second node management means for dividing, inserting, and searching for nodes belonging to the second hierarchy by a method different from the first node management means;
A database management device.
(Appendix 4)
In the database management device according to attachment 2 or 3,
The first hierarchy is located lower than the second hierarchy,
A database management apparatus in which a node belonging to the first hierarchy is larger in size than a node belonging to the second hierarchy.
(Appendix 5)
In the database management device described in appendix 4,
The node belonging to the first hierarchy and the node belonging to the second hierarchy are database nodes that are flat nodes whose entries are not sorted.
(Appendix 6)
In the database management device described in appendix 4,
The node belonging to the first hierarchy is a flat node in which entries are not sorted, and the node belonging to the second hierarchy is a sorted node in which entries are sorted.
(Appendix 7)
In the database management device according to attachment 2 or 3,
The first hierarchy is located lower than the second hierarchy,
The node belonging to the first hierarchy is a database management apparatus whose size is smaller than that of the node belonging to the second hierarchy.
(Appendix 8)
In the database management device according to attachment 7,
The node belonging to the first hierarchy and the node belonging to the second hierarchy are database management devices that are sorted nodes in which entries are sorted.
(Appendix 9)
In the database management device according to any one of appendices 1 to 8,
At least one of the nodes belonging to the first hierarchy and the nodes belonging to the second hierarchy is a database management apparatus in which a size is the same as a cache line size of a CPU of the database management apparatus.
(Appendix 10)
In the database management device according to attachment 2 or 3,
At least the nodes belonging to the first hierarchy are provided in the flash memory,
The first node management means temporarily stores a write request for a node belonging to the first hierarchy in a buffer, and collects a plurality of the write requests stored in the buffer to belong to the first hierarchy Database management device to write to.
(Appendix 11)
A database management method for managing a tree index structure database using a computer,
A database management method in which nodes belonging to a first hierarchy are set to have a first size, and nodes belonging to a second hierarchy are set to have a second size.
(Appendix 12)
In the database management method according to attachment 11,
Computer
Split, insert, and search for nodes belonging to the first hierarchy,
A database management method in which the computer divides, inserts, and searches a node belonging to a second hierarchy by a method different from the first node management unit.
(Appendix 13)
A database management method for managing a database with a tree index structure,
The computer performs division, insertion, and search for nodes belonging to the first hierarchy,
A database management method in which the computer divides, inserts, and searches a node belonging to a second hierarchy by a method different from that of a node belonging to the first hierarchy.
(Appendix 14)
In the database management method according to attachment 12 or 13,
The first hierarchy is located lower than the second hierarchy,
A database management method in which a node belonging to the first hierarchy is larger in size than a node belonging to the second hierarchy.
(Appendix 15)
In the database management method according to attachment 14,
The database management method, wherein the nodes belonging to the first hierarchy and the nodes belonging to the second hierarchy are flat nodes whose entries are not sorted.
(Appendix 16)
In the database management method according to attachment 14,
The database management method, wherein the node belonging to the first hierarchy is a flat node in which entries are not sorted, and the node belonging to the second hierarchy is a sorted node in which entries are sorted.
(Appendix 17)
In the database management method according to attachment 12 or 13,
The first hierarchy is located lower than the second hierarchy,
The database management method, wherein a node belonging to the first hierarchy is smaller in size than a node belonging to the second hierarchy.
(Appendix 18)
In the database management method according to attachment 17,
The database management method, wherein the nodes belonging to the first hierarchy and the nodes belonging to the second hierarchy are sorted nodes in which entries are sorted.
(Appendix 19)
In the database management method according to any one of appendices 11 to 18,
The database management method, wherein a size of at least one of the nodes belonging to the first hierarchy and the nodes belonging to the second hierarchy is the same as a cache line size of the CPU of the computer.
(Appendix 20)
In the database management method according to attachment 12 or 13,
At least the nodes belonging to the first hierarchy are provided in the flash memory,
The computer temporarily stores a write request for a node belonging to the first hierarchy in a buffer, and collectively writes the plurality of write requests stored in the buffer to a node belonging to the first hierarchy Method.
(Appendix 21)
A program for causing a computer to function as a database management device for managing a database having a tree index structure,
In the computer,
A first node management function for dividing, inserting, and searching for nodes belonging to the first hierarchy;
A second node management function for dividing, inserting, and searching for nodes belonging to the second hierarchy in a method different from the first node management function;
A program that realizes
(Appendix 22)
In the program described in Appendix 21,
A program in which nodes belonging to the first hierarchy are set to have a first size, and nodes belonging to the second hierarchy are set to have a second size.
(Appendix 23)
In the program described in Appendix 22,
The first hierarchy is located lower than the second hierarchy,
A program in which nodes belonging to the first hierarchy are larger in size than nodes belonging to the second hierarchy.
(Appendix 24)
In the program described in Appendix 23,
The node belonging to the first hierarchy and the node belonging to the second hierarchy are flat nodes whose entries are not sorted.
(Appendix 25)
In the program described in Appendix 23,
The node belonging to the first hierarchy is a flat node in which entries are not sorted, and the node belonging to the second hierarchy is a sorted node in which entries are sorted.
(Appendix 26)
In the program described in Appendix 22,
The first hierarchy is located lower than the second hierarchy,
A program in which a node belonging to the first hierarchy is smaller in size than a node belonging to the second hierarchy.
(Appendix 27)
In the program described in Appendix 26,
A program in which the nodes belonging to the first hierarchy and the nodes belonging to the second hierarchy are sorted nodes in which entries are sorted.
(Appendix 28)
In the program according to any one of appendices 21 to 27,
A program in which at least one of the nodes belonging to the first hierarchy and the nodes belonging to the second hierarchy has the same size as the cache line size of the CPU of the computer.
(Appendix 29)
In the program described in Appendix 22,
At least the nodes belonging to the first hierarchy are provided in the flash memory,
The first node management function temporarily stores a write request for a node belonging to the first hierarchy in a buffer, and collects a plurality of the write requests stored in the buffer to belong to the first hierarchy Program to write to.
 以上、図面を参照して本発明の実施形態について述べたが、これらは本発明の例示であり、上記以外の様々な構成を採用することもできる。 As described above, the embodiments of the present invention have been described with reference to the drawings. However, these are exemplifications of the present invention, and various configurations other than the above can be adopted.
 この出願は、2011年9月8日に出願された日本出願特願2011-195605を基礎とする優先権を主張し、その開示の全てをここに取り込む。 This application claims priority based on Japanese Patent Application No. 2011-195605 filed on September 8, 2011, the entire disclosure of which is incorporated herein.

Claims (10)

  1.  ツリーインデックス構造のデータベースを管理するデータベース管理装置であって、
     第1の階層に属するノードは第1のサイズとなるように設定されており、第2の階層に属するノードは第2のサイズとなるように設定されており、
     前記第1の階層に属するノード及び前記第2の階層に属するノードそれぞれに対して、分割、挿入、及び探索を行うノード管理手段を備えるデータベース管理装置。
    A database management device for managing a database having a tree index structure,
    Nodes belonging to the first hierarchy are set to be the first size, nodes belonging to the second hierarchy are set to be the second size,
    A database management apparatus comprising node management means for performing division, insertion, and search for each of nodes belonging to the first hierarchy and nodes belonging to the second hierarchy.
  2.  請求項1に記載のデータベース管理装置において、
     前記ノード管理手段は、
      前記第1の階層に属するノードに対して、分割、挿入、及び探索を行う第1ノード管理手段と、
      前記第2の階層に属するノードに対して、前記第1ノード管理手段とは異なる方法で分割、挿入、及び探索を行う第2ノード管理手段と、
    を有するデータベース管理装置。
    The database management device according to claim 1,
    The node management means includes
    First node management means for dividing, inserting, and searching for nodes belonging to the first hierarchy;
    Second node management means for dividing, inserting, and searching for nodes belonging to the second hierarchy by a method different from the first node management means;
    A database management device.
  3.  ツリーインデックス構造のデータベースを管理するデータベース管理装置であって、
     第1の階層に属するノードに対して、分割、挿入、及び探索を行う第1ノード管理手段と、
     第2の階層に属するノードに対して、前記第1ノード管理手段とは異なる方法で分割、挿入、及び探索を行う第2ノード管理手段と、
    を有するデータベース管理装置。
    A database management device for managing a database having a tree index structure,
    First node management means for dividing, inserting, and searching for nodes belonging to the first hierarchy;
    Second node management means for dividing, inserting, and searching for nodes belonging to the second hierarchy by a method different from the first node management means;
    A database management device.
  4.  請求項2又は3に記載のデータベース管理装置において、
     前記第1の階層は、前記第2の階層よりも下位に位置し、
     前記第1の階層に属するノードは、前記第2の階層に属するノードよりもサイズが大きいデータベース管理装置。
    In the database management device according to claim 2 or 3,
    The first hierarchy is located lower than the second hierarchy,
    A database management apparatus in which a node belonging to the first hierarchy is larger in size than a node belonging to the second hierarchy.
  5.  請求項4に記載のデータベース管理装置において、
     前記第1の階層に属するノード、及び前記第2の階層に属するノードは、エントリがソートされていないフラットノードであるデータベース管理装置。
    The database management device according to claim 4, wherein
    The node belonging to the first hierarchy and the node belonging to the second hierarchy are database nodes that are flat nodes whose entries are not sorted.
  6.  請求項4に記載のデータベース管理装置において、
     前記第1の階層に属するノードは、エントリがソートされていないフラットノードであり、前記第2の階層に属するノードは、エントリがソートされているソーテッドノードであるデータベース管理装置。
    The database management device according to claim 4, wherein
    The node belonging to the first hierarchy is a flat node in which entries are not sorted, and the node belonging to the second hierarchy is a sorted node in which entries are sorted.
  7.  請求項2又は3に記載のデータベース管理装置において、
     前記第1の階層は、前記第2の階層よりも下位に位置し、
     前記第1の階層に属するノードは、前記第2の階層に属するノードよりもサイズが小さいデータベース管理装置。
    In the database management device according to claim 2 or 3,
    The first hierarchy is located lower than the second hierarchy,
    The node belonging to the first hierarchy is a database management apparatus whose size is smaller than that of the node belonging to the second hierarchy.
  8.  請求項7に記載のデータベース管理装置において、
     前記第1の階層に属するノード、及び前記第2の階層に属するノードは、エントリがソートされているソーテッドノードであるデータベース管理装置。
    The database management device according to claim 7, wherein
    The node belonging to the first hierarchy and the node belonging to the second hierarchy are database management devices that are sorted nodes in which entries are sorted.
  9.  ツリーインデックス構造のデータベースを管理するデータベース管理方法であって、
     コンピュータが、第1の階層に属するノードに対して、分割、挿入、及び探索を行い、
     前記コンピュータが、第2の階層に属するノードに対して、前記第1の階層に属するノードとは異なる方法で分割、挿入、及び探索を行うデータベース管理方法。
    A database management method for managing a database with a tree index structure,
    The computer performs division, insertion, and search for nodes belonging to the first hierarchy,
    A database management method in which the computer divides, inserts, and searches a node belonging to a second hierarchy by a method different from that of a node belonging to the first hierarchy.
  10.  コンピュータを、ツリーインデックス構造のデータベースを管理するデータベース管理装置として機能させるためのプログラムであって、
     前記コンピュータに、
     第1の階層に属するノードに対して、分割、挿入、及び探索を行う第1ノード管理機能と、
     第2の階層に属するノードに対して、前記第1ノード管理機能とは異なる方法で分割、挿入、及び探索を行う第2ノード管理機能と、
    を実現させるプログラム。
    A program for causing a computer to function as a database management device for managing a database having a tree index structure,
    In the computer,
    A first node management function for dividing, inserting, and searching for nodes belonging to the first hierarchy;
    A second node management function for dividing, inserting, and searching for nodes belonging to the second hierarchy in a method different from the first node management function;
    A program that realizes
PCT/JP2012/005519 2011-09-08 2012-08-31 Database management device, database management method, and program WO2013035287A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2011195605 2011-09-08
JP2011-195605 2011-09-08

Publications (1)

Publication Number Publication Date
WO2013035287A1 true WO2013035287A1 (en) 2013-03-14

Family

ID=47831759

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/005519 WO2013035287A1 (en) 2011-09-08 2012-08-31 Database management device, database management method, and program

Country Status (1)

Country Link
WO (1) WO2013035287A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015129109A1 (en) * 2014-02-27 2015-09-03 ウイングアーク1st株式会社 Index management device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07191891A (en) * 1993-10-20 1995-07-28 Microsoft Corp Computer method and storage structure for storage of, and access to, multidimensional data
JP2010086391A (en) * 2008-10-01 2010-04-15 Internatl Business Mach Corp <Ibm> Method for searching tree structure

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07191891A (en) * 1993-10-20 1995-07-28 Microsoft Corp Computer method and storage structure for storage of, and access to, multidimensional data
JP2010086391A (en) * 2008-10-01 2010-04-15 Internatl Business Mach Corp <Ibm> Method for searching tree structure

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015129109A1 (en) * 2014-02-27 2015-09-03 ウイングアーク1st株式会社 Index management device
JP2015162042A (en) * 2014-02-27 2015-09-07 ウイングアーク1st株式会社 index management device

Similar Documents

Publication Publication Date Title
Raju et al. Pebblesdb: Building key-value stores using fragmented log-structured merge trees
US8185551B2 (en) Disk-resident streaming dictionary
Lim et al. SILT: A memory-efficient, high-performance key-value store
US9612955B2 (en) High-performance indexing for data-intensive systems
US9298604B2 (en) Flash memory cache including for use with persistent key-value store
EP2633413B1 (en) Low ram space, high-throughput persistent key-value store using secondary memory
Mei et al. SifrDB: A unified solution for write-optimized key-value stores in large datacenter
Stoica et al. Enabling efficient OS paging for main-memory OLTP databases
Papagiannis et al. An efficient memory-mapped key-value store for flash storage
Ahn et al. ForestDB: A fast key-value storage system for variable-length string keys
Fevgas et al. Indexing in flash storage devices: a survey on challenges, current approaches, and future trends
Lee et al. An efficient index buffer management scheme for implementing a B-tree on NAND flash memory
Jin et al. Read/write-optimized tree indexing for solid-state drives
Kim et al. BoLT: Barrier-optimized lsm-tree
Carniel et al. A generic and efficient framework for flash-aware spatial indexing
Papagiannis et al. Kreon: An efficient memory-mapped key-value store for flash storage
Kim et al. Optimizing key-value stores for flash-based ssds via key reshaping
Lee et al. An efficient buffer management scheme for implementing a B-tree on NAND flash memory
Wang et al. Block-Based Multi-Version B $^+ $-Tree for Flash-Based Embedded Database Systems
WO2013035287A1 (en) Database management device, database management method, and program
He et al. Discovering structure in unstructured i/o
Lee et al. TLSM: Tiered log-structured merge-tree utilizing non-volatile memory
Jin et al. Lazy-split B+-tree: a novel B+-tree index scheme for flash-based database systems
Jiao et al. BetrFS: a compleat file system for commodity SSDs
Jiang et al. Improving Write Performance for LSM-tree-based Key-Value Stores with NV-Cache

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12829375

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12829375

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP