Nothing Special   »   [go: up one dir, main page]

JP5303213B2 - Data management method with data compression processing - Google Patents

Data management method with data compression processing Download PDF

Info

Publication number
JP5303213B2
JP5303213B2 JP2008189277A JP2008189277A JP5303213B2 JP 5303213 B2 JP5303213 B2 JP 5303213B2 JP 2008189277 A JP2008189277 A JP 2008189277A JP 2008189277 A JP2008189277 A JP 2008189277A JP 5303213 B2 JP5303213 B2 JP 5303213B2
Authority
JP
Japan
Prior art keywords
compression
data
compressed
value
item
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2008189277A
Other languages
Japanese (ja)
Other versions
JP2010026884A (en
Inventor
大輔 伊藤
真二 藤原
耕治 木村
秀樹 林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2008189277A priority Critical patent/JP5303213B2/en
Publication of JP2010026884A publication Critical patent/JP2010026884A/en
Application granted granted Critical
Publication of JP5303213B2 publication Critical patent/JP5303213B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

本発明は、冗長要素を多く含む大量なデータを高速に圧縮伸張するデータ管理方法に関するものである。   The present invention relates to a data management method for compressing and expanding a large amount of data including many redundant elements at high speed.

まず以下の文中で用いる用語の定義を行う。   First, terms used in the following sentences are defined.

行、列、フィールド:図2に示すとおり、表201を構成する要素として行203、列204、フィールド202という用語を用いる。   Row, column, field: As shown in FIG. 2, the terms row 203, column 204, and field 202 are used as elements constituting the table 201.

第一正規形:RDBMSの正規化のレベルの1つ。行を構成するフィールドがスカラ値である、すなわち集合や配列を含まないものと定義される。
続いて背景技術の詳細を記す。
First normal form: One of RDBMS normalization levels. The fields that make up a row are defined as scalar values, that is, not including sets or arrays.
Next, I will describe the details of the background art.

携帯機器の高機能化に伴い、扱うデータも大量になり、また検索パターンも多様化しており、機器組込み環境においてもDBMSが用いられるようになってきた。特に従来のサーバシステムで用いられてきたRDBMSは既に問合せ言語が標準化されていることからAPIの習得コストが低いとされ、注目されている。   As mobile devices become more sophisticated, the amount of data handled has increased, and search patterns have diversified, and DBMS has come to be used in embedded environments. In particular, the RDBMS used in the conventional server system is already attracting attention because the query language is low because the query language is already standardized.

機器組込み環境ではハードウエア低コスト化の要求が強く、サーバシステム環境よりもリソースの制約が厳しい。そのためRDBMSに対してもストレージ使用量とメモリ使用量は小さいほど良いという要求がある。しかし一方で機器組込み開発者はDBのライトユーザが多く、また更新不整合など考慮する必要もあまりないため第一正規形スキーマを用いた運用が多く、結果として冗長性が多い。そこでデータベースを圧縮する機能にニーズがある。   In the device embedded environment, there is a strong demand for hardware cost reduction, and resource constraints are more severe than in the server system environment. Therefore, there is a demand for RDBMS that the smaller the storage usage and the memory usage, the better. However, on the other hand, there are many DB embedded users and there is not much need to consider update inconsistencies, so there are many operations using the first normal form schema, resulting in a lot of redundancy. There is a need for a database compression function.

データベース圧縮の従来技術の多くは更新に比べ参照の頻度が高いデータウェアハウス向けの技術である。その中でも、行単位にLZ符号のような圧縮符号を適用するデータ圧縮技術が代表的であり、非特許文献1に開示される。この方式では圧縮伸張処理の際に余計なストレージI/Oが発生しないため高速である反面、元データが小さいため圧縮率も上がりにくい。さらに第一正規形スキーマに限らず、データベースの冗長性は行方向には少なく列方向に多い傾向があるため、行単位圧縮は余計に圧縮率が上がりにくい。   Many of the conventional techniques for database compression are for data warehouses that are referenced more frequently than updates. Among them, a data compression technique that applies a compression code such as an LZ code for each row is representative, and is disclosed in Non-Patent Document 1. This method is fast because no extra storage I / O occurs during compression / decompression processing, but the compression rate is difficult to increase because the original data is small. Furthermore, not only in the first normal form schema, database redundancy tends to be less in the row direction and more in the column direction. Therefore, compression by row unit is less likely to increase the compression rate.

また、データベース圧縮の他の代表的な手法にcolumn-wise圧縮があり、同じく非特許文献1に開示される。これはデータベースの冗長性は列方向に出やすいことを考慮し、列方向にLZ符号のような圧縮手法を適用する技術である。このcolumn-wise圧縮の実装方式として提案されたものに、表全体を列ごとに分割して圧縮するものがあるが、大量のデータからなる表を圧縮する場合には圧縮率が良い半面、圧縮伸張処理の際には辞書を読み込むためのストレージI/Oが発生するため低速である。さらに削除 (delete) や更新 (update) を行う場合のコストが高く非常に低速になるという欠点がある。   Another typical technique for database compression is column-wise compression, which is also disclosed in Non-Patent Document 1. In consideration of the fact that database redundancy tends to occur in the column direction, this is a technique that applies a compression technique such as LZ code in the column direction. One of the proposed implementation methods for column-wise compression is to divide the entire table into columns and compress it, but when compressing a table consisting of a large amount of data, the compression ratio is good. The decompression process is slow because storage I / O for reading the dictionary occurs. In addition, there is a drawback that the cost for deleting and updating is high and very slow.

これに対し非特許文献2に記載されたデータベース圧縮方法では、単一ページ内に含まれるフィールドが重複した場合にポインタで置き換えることによって圧縮を行う。この方法では、圧縮伸張の際に余計なストレージI/Oが発生しないため高速である。その反面、フィールドが完全に一致した場合にしか圧縮の対象とならないため、メモやコメントを保存する自由記述の文字列型に対して圧縮の効果を得にくい。   On the other hand, in the database compression method described in Non-Patent Document 2, when fields included in a single page overlap, compression is performed by replacing with a pointer. This method is fast because no extra storage I / O occurs during compression / decompression. On the other hand, since compression is performed only when the fields completely match, it is difficult to obtain the compression effect for a freely described character string type that stores notes and comments.

”Data Compression Support in Databases”, Balakrishna R. Iyer, VLDB94“Data Compression Support in Databases”, Balakrishna R. Iyer, VLDB94 ”Data Compression in Oracle”, Meikel Poessv, VLDB2003“Data Compression in Oracle”, Meikel Poessv, VLDB2003

そこで、本発明では、冗長性を含む大量なデータを圧縮して扱う場合にも高速に圧縮伸張できる圧縮方法を提供することを課題とする。   Therefore, an object of the present invention is to provide a compression method capable of high-speed compression / decompression even when a large amount of data including redundancy is compressed and handled.

本発明は、特に第一正規形スキーマのデータにおいて列方向に冗長性が多いことに着目し、冗長列をユーザ指定可能とする。   The present invention pays attention to the fact that there is much redundancy in the column direction particularly in the data of the first normal form schema, and makes it possible to designate a redundant column as a user.

本明細書で開示する代表的な実施例におけるデータ管理方法の要点をまとめると、複数項目の値の組が繰り返し現れるデータに対し、ストレージ上の圧縮値管理表にもとづいたデータ圧縮処理を行って管理を行うデータ管理方法であって、前記データ中の項目ごとに、圧縮の有無のユーザによる指定を受け付け、圧縮有りと指定された各項目に関して、該項目の識別子及び該項目を含むデータの識別子を前記圧縮値管理表に保存し、前記データのうち、前記項目の識別子で特定される値にのみ圧縮処理を施して前記ストレージ上で管理するというものである。   To summarize the points of the data management method in the representative embodiment disclosed in this specification, data compression processing based on a compression value management table on the storage is performed on data in which a set of values of a plurality of items repeatedly appears. A data management method for performing management, wherein for each item in the data, designation by a user of whether or not compression is received, and for each item designated as being compressed, an identifier of the item and an identifier of data including the item Is stored in the compressed value management table, and only the value specified by the identifier of the item in the data is subjected to compression processing and managed on the storage.

リレーショナルデータベース分野の用語に言い換えると、管理対象は表であり、上記複数項目の値の組とは表を構成する行であり、その各項目は表を構成する列であり、各項目の値はフィールドである。すなわち、ユーザ表の列ごとに、ユーザによる圧縮の有無の指定を受け付け、圧縮有りと指定された各列に関して、列名、表名、を圧縮値管理表に保存し、前記ユーザ表の各フィールドのデータのうち前記圧縮値管理表に圧縮有りと指定された列のフィールドのデータのみ圧縮処理を施してストレージ上で管理する。   In other words, in the relational database field, the management target is a table, and the above-mentioned value set of multiple items is a row constituting the table, each item is a column constituting the table, and each item value is It is a field. That is, for each column of the user table, the user accepts designation of whether or not compression is performed, and for each column designated as being compressed, the column name and table name are stored in the compressed value management table, and each field of the user table is stored. Only the data in the field of the column designated as being compressed in the compressed value management table is subjected to compression processing and managed on the storage.

開示する別の代表的実施例におけるデータ管理方法では、さらに高速に圧縮伸張可能となるように圧縮単位を導入する。   In the data management method in another representative embodiment to be disclosed, a compression unit is introduced so that compression and expansion can be performed at a higher speed.

本発明のデータ管理方式は、ユーザが指定した列のみ、圧縮単位ごとに列方向圧縮を行うため、演算量とストレージI/O回数が共に少なく、高速かつ高い圧縮率を実現できるという利点がある。   The data management method of the present invention has an advantage that only a column specified by the user is compressed in the column direction for each compression unit, so that both the calculation amount and the number of storage I / O are small, and a high speed and high compression rate can be realized. .

本実施例のコンピュータシステムでは表や構造体の集合といった、複数項目の値の組が繰り返し現れるデータを管理対象としてストレージ上で管理する。とくに、その各組の中でユーザが指定した1つまたは複数の項目の値にのみデータ圧縮処理を施してストレージに保存し、管理する。   In the computer system of this embodiment, data in which a set of values of a plurality of items such as a table and a set of structures repeatedly appear is managed on the storage as a management target. In particular, only the value of one or more items specified by the user in each set is subjected to data compression processing, stored in storage, and managed.

図1は本実施例のコンピュータシステムの構成を示す。コンピュータシステム101はCPU112、主記憶装置113、及びストレージ103を主な構成要素とする。主記憶装置113の上には、図示したストレージ103、もしくは他のストレージ装置から読み出されたオペレーティングシステム111が主記憶装置113の上で展開される。さらにリレーショナルデータベース実行部102、及びAP実行部110が主記憶装置113の上で展開される。オペレーティングシステム111の制御のもとでCPU112がリレーショナルデータベース実行部、AP実行部それぞれの処理を実行し、これによりデータ管理の機能、アプリケーションの機能を果たす。   FIG. 1 shows the configuration of a computer system of this embodiment. The computer system 101 includes a CPU 112, a main storage device 113, and a storage 103 as main components. On the main storage device 113, the operating system 111 read from the illustrated storage 103 or another storage device is expanded on the main storage device 113. Further, a relational database execution unit 102 and an AP execution unit 110 are expanded on the main storage device 113. Under the control of the operating system 111, the CPU 112 executes processes of the relational database execution unit and the AP execution unit, thereby fulfilling a data management function and an application function.

ストレージ103の実現例としてハードディスクドライブ、半導体メモリ、テープドライブなどが挙げられる。ストレージ103にはユーザデータ領域104と管理情報領域105が設けられる。管理情報領域104にはリレーショナルデータベース実行部102によるデータ管理に使用する管理情報が格納、管理される。ここでは管理情報は表形式で管理する。本実施例に特有なのは、管理情報領域104に格納される管理情報に、データ圧縮・伸張処理に用い圧縮地管理表106が含まれる点である。すなわちストレージ上に圧縮値管理表を持つ。圧縮値管理表106の詳細は後述する。ユーザデータ領域104には上記のデータ管理の管理対象であり、またデータ圧縮、伸張の対象である表が格納される。区別のためにこれらの管理対象の表をユーザ表と呼ぶ。
図2に一般的なユーザ表の構成を示す。ユーザ表201は複数の行203及び列204で構成され、ある行とある列で特定される要素をフィールド202と呼ぶ。
Examples of realization of the storage 103 include a hard disk drive, a semiconductor memory, and a tape drive. The storage 103 is provided with a user data area 104 and a management information area 105. Management information used for data management by the relational database execution unit 102 is stored and managed in the management information area 104. Here, the management information is managed in a table format. What is specific to the present embodiment is that the management information stored in the management information area 104 includes a compression location management table 106 used for data compression / decompression processing. That is, it has a compressed value management table on the storage. Details of the compression value management table 106 will be described later. The user data area 104 stores a table that is a management target of the above-described data management and that is a target of data compression and expansion. These tables to be managed are called user tables for distinction.
FIG. 2 shows the structure of a general user table. The user table 201 includes a plurality of rows 203 and columns 204, and an element specified by a certain row and a certain column is referred to as a field 202.

リレーショナルデータベース実行部108には問合せ処理部107と圧縮値定義部108が含まれる。問合せ処理部107はユーザ109からの問合せやデータ定義といった命令を受け付け、命令に従いデータ管理を実行する機能を果たす。また圧縮値定義部108は上記ストレージ104の管理情報領域105にて圧縮値に関する管理情報を管理する。圧縮値定義処理部108の詳細は後述する。   The relational database execution unit 108 includes a query processing unit 107 and a compressed value definition unit 108. The inquiry processing unit 107 has a function of receiving an instruction such as an inquiry or data definition from the user 109 and executing data management according to the instruction. The compressed value definition unit 108 manages management information related to the compressed value in the management information area 105 of the storage 104. Details of the compression value definition processing unit 108 will be described later.

本実施例では、事前の準備としてユーザ表の構造を定義する際に圧縮の有無をユーザ109が列ごとに指定し、問合せ処理部107が解釈した後に圧縮値定義処理部108が受け取り、圧縮値管理表に保存する。すなわちユーザがデータの項目ごとに圧縮の有無を指定し、ユーザが指定した圧縮を行う項目(ここではユーザ表の列名)とその項目を含むデータの識別子(ここではユーザ表名)を圧縮値定義部が受け取り、圧縮値管理表に保存する。   In this embodiment, when defining the structure of the user table as advance preparation, the user 109 designates whether or not compression is performed for each column, and after the query processing unit 107 interprets it, the compressed value definition processing unit 108 receives the compressed value. Save to the management table. That is, the user specifies whether or not compression is performed for each data item, and the compression value is an item to be compressed (here, the column name of the user table) and the identifier of the data including the item (here, the user table name). The definition part receives it and stores it in the compressed value management table.

ユーザ表の構造を定義する際の参考に、例えば、ユーザ表を管理するデータ管理プログラムとして広く用いられているリレーショナルデータベースプログラムにおいては、SQLの表構造定義文であるcreate table文や表構造変更文であるalter table文を用いてデータ構造の定義を行う。そのため本実施例では列ごとの圧縮の有無もcreate table文やalter table文で指定できるように文法を拡張する。図3にユーザ表とそれに対応するcreate table文と圧縮列管理表の例を示す。図3(a)に示すsongs表301はミュージックプレイヤーの楽曲情報を保存するユーザ表であり、通し番号を表すid列、歌手名を表すartist_name列、アルバム名を表すalbum_name列、リリース年を表すrelease列、アルバム内の曲順を表すtrack_num列、楽曲のジャンルを表すgenre列、楽曲名を表すsong_title列からなる。ここで、artist_name列とalbum_name列とrelease列を圧縮列と指定する場合の表構造定義に用いるcreate table文の拡張を図3(b)に示す。このcreate table文の拡張ではartist_name列とalbum_name列とrelease列を定義する際に、データ型定義に続いて圧縮列である事を示す “compress” 指定をしている。図3(c)に示す圧縮値管理表303では、圧縮して管理するユーザ表識別子と列識別子を管理する。すなわち圧縮値管理表ではデータ識別子と圧縮値識別子を管理する。本実施例ではユーザ表識別子として、ユーザ表の名前はユニークであるという前提を置き、ユーザ表の名前を用いる。また列識別子として、ユーザ表ごとに列名はユニークであるという前提を置き、列名を用いる。   For reference when defining the structure of a user table, for example, in a relational database program that is widely used as a data management program for managing user tables, create table statements and table structure change statements that are SQL table structure definition statements Define the data structure using the alter table statement. For this reason, in this embodiment, the grammar is extended so that the presence / absence of compression for each column can also be specified by a create table statement or an alter table statement. FIG. 3 shows an example of a user table, a corresponding create table statement, and a compressed column management table. The songs table 301 shown in FIG. 3 (a) is a user table for storing music player music information, an id column representing a serial number, an artist_name column representing a singer name, an album_name column representing an album name, and a release column representing a release year. , A track_num column representing the order of the songs in the album, a genre column representing the genre of the music, and a song_title column representing the music name. Here, FIG. 3B shows an extension of the create table statement used for the table structure definition when the artist_name column, the album_name column, and the release column are designated as compressed columns. In this create table statement extension, when defining the artist_name column, album_name column, and release column, “compress” is specified to indicate that the column is a compressed column following the data type definition. In the compressed value management table 303 shown in FIG. 3C, user table identifiers and column identifiers managed by compression are managed. That is, the data identifier and the compressed value identifier are managed in the compressed value management table. In this embodiment, the user table name is assumed to be unique, and the user table name is used as the user table identifier. As a column identifier, the column name is used on the assumption that the column name is unique for each user table.

以上のように本実施例では、ストレージ上で表を管理対象とするシステムでは、表を構成する列ごとにユーザが圧縮対象か否かを指定して圧縮値管理表に登録し、表データの保存に際して、圧縮ありと指定された列のフィールドのデータは指定された圧縮方法で圧縮して保存する。この方式は、上記の例のように表を管理対象として管理するシステムだけでなく、構造体の集合や配列、その他の、複数項目の値の組が繰り返し現れるデータを管理するシステムにも適用可能である。図4に、C言語の構造体の配列を拡張した例を示す。構造体宣言および構造体配列変数宣言401では、songs表301に相当する構造体配列変数songs[]およびsongs表の行に相当する構造体songを定義し、1,000個の構造体からなる集合を定義している。ただしsongs表301のid列は構造体配列変数songs[]の添え字に相当する。401で定義された構造体配列変数を管理する場合にも、SQLのcreate table文の拡張302を用いて定義した場合と同様の方法でデータを管理することが可能である。   As described above, in this embodiment, in a system in which a table is managed on the storage, the user designates whether or not to compress for each column constituting the table, registers it in the compressed value management table, and stores the table data. At the time of saving, the data of the field in the column designated as compressed is compressed and saved by the designated compression method. This method can be applied not only to the system that manages the table as the management target as in the above example, but also to the system that manages the data such as a set or array of structures, and other data in which multiple item value pairs appear repeatedly It is. FIG. 4 shows an example of expanding the structure array of C language. In structure declaration and structure array variable declaration 401, structure array variable songs [] corresponding to songs table 301 and structure song corresponding to rows in songs table are defined, and a set of 1,000 structures is defined doing. However, the id column in the songs table 301 corresponds to the subscript of the structure array variable songs []. Even when managing structure array variables defined in 401, it is possible to manage data in the same way as when defining using the extension 302 of the SQL create table statement.

実施例2では、列ごとに圧縮対列か否かを指定し、さらにその圧縮の圧縮単位もユーザが指定する。ストレージ上の管理対象は表に限らず、管理対象が複数項目の値の組の繰り返し現れるデータであるシステムに適用できることは実施例1と全く同様である。   In the second embodiment, it is specified whether or not each column is a compression pair column, and the user also specifies the compression unit of the compression. The management target on the storage is not limited to the table, but the management target can be applied to a system that is data in which a set of values of a plurality of items repeatedly appears as in the first embodiment.

図5に実施例2のデータ管理システムシステム構成を示す。   FIG. 5 shows a data management system system configuration of the second embodiment.

コンピュータシステム501はデータ管理プログラム502と表や表に関連する管理情報を保存するためのストレージ503を有する。AP実行部515とCPU517およびオペレーティングシステム516については実施例1のデータ管理システムにおけるAP実行部(図2の110)とCPU(図2の112)およびオペレーティングシステム(図2の111)とそれぞれ同様である。主記憶装置518の上に展開されるリレーショナルデータベース実行部502には、問合せ処理部507、圧縮値定義処理部508、I/O振分処理部509、非圧縮表向きinsert文処理部510、圧縮列を含む表向けinsert文処理部511、圧縮列を含む表向けselect文処理部519、非圧縮表向けselect文処理部520、圧縮列向けdelete文処理部513、および通常のdelete文処理部514が含まれる。ストレージ503の管理情報領域505に格納する圧縮値管理表506には、圧縮対象の列名に対応して圧縮単位が登録される。   The computer system 501 has a data management program 502 and a storage 503 for storing management information related to tables and tables. The AP execution unit 515, the CPU 517, and the operating system 516 are the same as the AP execution unit (110 in FIG. 2), the CPU (112 in FIG. 2), and the operating system (111 in FIG. 2) in the data management system of the first embodiment. is there. The relational database execution unit 502 expanded on the main storage device 518 includes a query processing unit 507, a compressed value definition processing unit 508, an I / O distribution processing unit 509, an uncompressed table-oriented insert statement processing unit 510, and a compressed string. Insert statement processing unit 511 for a table including a select statement processing unit 519 for a table including a compressed column, a select statement processing unit 520 for an uncompressed table, a delete statement processing unit 513 for a compressed column, and a normal delete statement processing unit 514 included. In the compression value management table 506 stored in the management information area 505 of the storage 503, the compression unit is registered corresponding to the column name to be compressed.

本実施例では、ユーザ512が指定した圧縮対象である列の全フィールドを、ユーザ512が指定した複数の小区分に分けて圧縮する。この小区分のサイズを圧縮単位と呼び、圧縮の有無と圧縮の単位はデータ管理の事前の準備としてユーザ表の構造を定義する際にユーザ512が列ごとに指定する。ユーザ512よって列ごとに指定された圧縮の有無と圧縮単位は、問合せ処理部507が解釈した後に圧縮値定義処理部508が受け取り、圧縮値管理表506に保存する。すなわち、ユーザがデータに含まれる値ごとに圧縮の有無と圧縮単位を指定し、ユーザが指定した圧縮を行う項目(列名)とその項目を含むデータの識別子(表名)と圧縮単位とを圧縮値定義処理部が受け取り、圧縮値管理表に保存する。圧縮の単位の例としてデータのサイズやデータの行数、フィールド数、ストレージ上でのページ数といった単位が上げられる。本実施例ではページ数を用いる。また、圧縮単位がnページであり、あるページAのユーザデータ領域504の先頭ページ番号からのオフセットがaであるとすると、Aと同じ小区分に含まれるページのオフセットはn × (a div n) ≦ x <n × {(a div n) + 1}を満たす自然数xとする。   In this embodiment, all the fields of the column to be compressed designated by the user 512 are divided into a plurality of subsections designated by the user 512 and compressed. The size of this small section is called a compression unit, and the presence / absence of compression and the unit of compression are specified for each column by the user 512 when defining the structure of the user table as preparation for data management. The presence / absence and unit of compression designated for each column by the user 512 are interpreted by the query processing unit 507, received by the compression value definition processing unit 508, and stored in the compression value management table 506. That is, for each value included in the data, the user specifies whether or not compression is performed and the compression unit, and the item (column name) to be compressed specified by the user, the identifier of the data including the item (table name), and the compression unit The compressed value definition processing unit receives it and stores it in the compressed value management table. As an example of the unit of compression, a unit such as the size of data, the number of rows of data, the number of fields, the number of pages on the storage can be raised. In this embodiment, the number of pages is used. If the compression unit is n pages and the offset from the first page number of the user data area 504 of a page A is a, the offset of the page included in the same subsection as A is n × (a div n ) ≦ x <n × {(a div n) +1} is assumed to be a natural number x.

図6にユーザ表とそれに対応するcreate table文と圧縮列管理表の例を示す。図6(a)のsongs表601は図3に示す実施例1のユーザ表と同じミュージックプレイヤーの楽曲情報を保存するユーザ表である。すなわち表 601は通し番号を表すid列、歌手名を表すartist_name列、アルバム名を表すalbum_name列、リリース年を表すrelease列、アルバム内の曲順を表すtrack_num列、楽曲のジャンルを表すgenre列、楽曲名を表すsong_title列からなる。ここで、artist_name列とalbum_name列とrelease列を圧縮列と指定し、さらにartist_name列は2ページずつ、album_name列とrelease列を4ページずつ圧縮する場合の表構造定義に用いるcreate table文の拡張を602に示す。図6(b)に示すcreate table文の拡張ではartist_name列とalbum_name列とrelease列を定義する際に、データ型定義に続いて圧縮列である事を示す“compress”と圧縮単位である“2”および“4”を指定している。図6(c)に示す圧縮値管理表603では、圧縮して管理するユーザ表識別子と列識別子および圧縮単位を管理する。すなわち圧縮値管理表ではデータ識別子と圧縮値識別子と圧縮単位を指定する。本実施例ではユーザ表識別子として、ユーザ表の名前はユニークであるという前提を置き、ユーザ表の名前を用いる。また列識別子として、ユーザ表ごとに列名はユニークであるという前提を置き、列名を用いる。   FIG. 6 shows an example of a user table, a corresponding create table statement, and a compressed column management table. A songs table 601 in FIG. 6A is a user table for storing music information of the same music player as the user table in the first embodiment shown in FIG. That is, the table 601 includes an id column representing a serial number, an artist_name column representing a singer name, an album_name column representing an album name, a release column representing a release year, a track_num column representing the order of songs in the album, a genre column representing a song genre, It consists of a song_title column that represents the name. Here, the artist_name column, the album_name column, and the release column are specified as compression columns, and the artist_name column is expanded by 2 pages, and the album_name column and release column are expanded by 4 pages. 602. In the extension of the create table statement shown in FIG. 6B, when defining the artist_name column, the album_name column, and the release column, “compress” indicating that the column is a compression column following the data type definition and “2” that is a compression unit. "And" 4 "are specified. In the compressed value management table 603 shown in FIG. 6C, the user table identifier, column identifier, and compression unit to be managed by compression are managed. That is, in the compression value management table, a data identifier, a compression value identifier, and a compression unit are designated. In this embodiment, the user table name is assumed to be unique, and the user table name is used as the user table identifier. As a column identifier, the column name is used on the assumption that the column name is unique for each user table.

本実施例において行の挿入を行う際には、SQLにおけるinsert文を用いる。ユーザ512が発行したinsert文は問合せ処理部507が受け取り処理を行う。問合せ処理部からのinsert文処理命令はI/O振分処理部509に渡される。   In this embodiment, when inserting a row, an insert statement in SQL is used. The query processing unit 507 receives and processes the insert statement issued by the user 512. An insert statement processing instruction from the inquiry processing unit is passed to the I / O distribution processing unit 509.

I/O振分処理部509がinsert文処理命令を実行する際の処理フローを図7に示す。処理開始(701)の後、圧縮値定義処理部508を参照し(702)、行の挿入を行う対象の表が圧縮列を含む表か否かを判断する(703)。行の挿入を行う対象の表が圧縮列を含む表である場合は圧縮列を含む表向けinsert文処理部511を呼び出す(704)。一方、挿入対象の表が圧縮列を含まない場合は非圧縮表向けinsert文処理部510を呼び出し(705)、処理を終了する(706)。   FIG. 7 shows a processing flow when the I / O distribution processing unit 509 executes the insert statement processing instruction. After the processing is started (701), the compressed value definition processing unit 508 is referred to (702), and it is determined whether or not the table to be inserted is a table including a compressed column (703). If the table into which the row is to be inserted is a table including a compressed column, the table insert statement processing unit 511 including the compressed column is called (704). On the other hand, if the table to be inserted does not include a compressed column, the insert statement processing unit 510 for uncompressed table is called (705), and the processing is terminated (706).

圧縮列を含む表向けinsert文処理部511は圧縮値定義処理部508を参照し、指定された圧縮単位に基づき要求されたフィールドを圧縮する。すなわち圧縮値管理表506に記録された定義に従い圧縮単位ごとに圧縮する。   The table insert statement processing unit 511 including the compressed column refers to the compression value definition processing unit 508 and compresses the requested field based on the designated compression unit. That is, compression is performed for each compression unit in accordance with the definition recorded in the compression value management table 506.

圧縮方式としてハフマン符号に代表される辞書を別途保存する必要がある方式を用いた場合と、LZ符合に代表される辞書を別途保存する必要がない方式を用いた場合とでは、圧縮列を含む表向けinsert文処理部511の処理手順が異なる。図8は前者の圧縮方式の場合の処理手順を示す。まず行を挿入する表の複数の圧縮単位を順次検索するため注目する圧縮単位番号aを1とし(801)、その1番目の圧縮単位の先頭位置を取得する(802)。次にその圧縮単位の辞書を読み込む(803)。なお、代表的な例では、圧縮単位内のユーザ表のデータを格納するページの更に前の先頭ページを、上記辞書を格納するページとしている。次に、読み込んだ辞書を用いて挿入対象行のデータを圧縮する(804)。次に当該圧縮単位内の第1ページ目から、そのページを取得し(805、806)、取得したページに空エリアがあるかを判定する(807)。空エリアがなければ、圧縮単位内で未確認のページがまだあるかを判定し(809)、ページ数をインクリメントし(810)、空エリアがあるかの判定を繰り返す。空エリアがあれば、そのページに圧縮後のデータ、すなわち圧縮により得た圧縮列に対応するフィールドのデータと、非圧縮列に対応するフィールドの生のデータとを組みあわせた行全体のデータを書き込み(814)、処理を終了する。圧縮単位内の全ページを順次判定しても空エリアがなければ、つまりステップ809で空エリア未確認のページがもうなければ、表に未確認の圧縮単位があるかを判定し(812)、あれば圧縮単位番号aをインクリメントし、次の圧縮単位について上述の先頭位置取得(802)、辞書読み込み(803)、各ページの空エリアの確認(805〜810)を行う。このように、行を挿入可能なページを表データの先頭のページから順に、各圧縮単位にわたり探し、空エリアを発見したページに書き込みを行う。空エリアがあるページを発見しないままステップ812で未確認の圧縮単位がもうないと判定したときには領域不足により行の挿入に失敗したことを報告して処理を終了する。   When using a method that requires a dictionary typified by a Huffman code to be stored separately as a compression method, and when using a method that does not need to store a dictionary typified by an LZ code separately, a compressed string is included. The processing procedure of the insert statement processing unit 511 for the table is different. FIG. 8 shows a processing procedure in the case of the former compression method. First, in order to sequentially search a plurality of compression units in a table into which a row is inserted, the target compression unit number a is set to 1 (801), and the head position of the first compression unit is acquired (802). Next, the dictionary of the compression unit is read (803). In a typical example, the first page before the page storing the user table data in the compression unit is the page storing the dictionary. Next, the data of the insertion target line is compressed using the read dictionary (804). Next, the page is acquired from the first page in the compression unit (805, 806), and it is determined whether the acquired page has an empty area (807). If there is no empty area, it is determined whether there are still unconfirmed pages in the compression unit (809), the number of pages is incremented (810), and the determination of whether there is an empty area is repeated. If there is an empty area, the compressed data, that is, the data of the entire row that combines the data of the field corresponding to the compressed column obtained by compression and the raw data of the field corresponding to the uncompressed column. Write (814), the process ends. If all the pages in the compression unit are sequentially judged and there is no empty area, that is, if there are no more unconfirmed pages in step 809, it is determined whether there is an unconfirmed compression unit in the table (812). The compression unit number a is incremented, and for the next compression unit, the above-mentioned head position acquisition (802), dictionary reading (803), and empty area confirmation of each page (805 to 810) are performed. In this manner, pages in which rows can be inserted are searched in order from the first page of the table data over each compression unit, and writing is performed on the page where the empty area is found. If it is determined in step 812 that there is no unconfirmed compression unit without finding a page with an empty area, it is reported that row insertion has failed due to insufficient area, and the process is terminated.

以上のように図8に示した処理フローでは、insert文処理にあたり挿入可能なページを先頭表の先頭ページから順次探す手順をとるが、書き込み可能なページを別途管理する手段が用意されている場合には図8のループ処理を省くことが可能となる。   As described above, in the processing flow shown in FIG. 8, in the insert statement processing, a procedure for sequentially searching for insertable pages from the first page of the first table is taken, but a means for separately managing writable pages is prepared. It is possible to omit the loop processing of FIG.

図9は辞書を別途保存する必要がない圧縮方式を用いる場合のinsert文処理の手順を示す。図9のフローにおいても、まず圧縮単位番号aを1として(901)、表の先頭の圧縮単位の先頭位置を取得する(902)。つぎに圧縮単位内の注目ページ番号bを1とし(903)、その注目ページを取得する(904)。ぺージ内の第1行のデータから、データ中の圧縮列のデータを伸張し、伸張したことを辞書に反映する(905、906)。注目ページ番号を順次インクリメントして(908)、この伸張、辞書への反映の処理を繰り返す。ステップ907でページ内の行の全ての伸張処理が終了したと判定すると、挿入対象行の圧縮列に対応するデータの圧縮処理を行い(909)、ページ内に圧縮後のデータを格納する空エリアがあるかを判定する(910)。空エリアがあれば、そのページに圧縮後のデータを書き込み(916)、行の挿入の処理を終了する。空エリアがなければ、注目ページ番号bをインクリメントし(912)、次のページについて上記各行の伸長処理、挿入対象行の圧縮処理を行う。ステップ910でページ内に空エリアがあればステップ916の圧縮後のデータの書き込みを行い、処理を終了する。もし圧縮単位内の全ページを順次判定しても空エリアがなければ、表中にまだ未確認の圧縮単位があるかを判定する(913)。表中に、未確認の圧縮単位があれば、圧縮単位番号aをインクリメントして(914)、次の圧縮単位につきステップ902〜912の処理を行う。このように行を挿入可能な空エリアをもつページが見つかるまで各圧縮単位の各ページを確認し、空エリアがあるページを発見しないままステップ913で未確認の圧縮単位がもうないと判定したときは、領域不足により行の挿入に失敗したことを報告して処理を終了する(915)。   FIG. 9 shows the procedure of insert statement processing when using a compression method that does not require a separate dictionary. Also in the flow of FIG. 9, first, the compression unit number a is set to 1 (901), and the head position of the head compression unit in the table is acquired (902). Next, the attention page number b in the compression unit is set to 1 (903), and the attention page is acquired (904). The data of the compressed column in the data is expanded from the data in the first row in the page, and the expansion is reflected in the dictionary (905, 906). The page number of interest is sequentially incremented (908), and the process of expansion and reflection to the dictionary is repeated. If it is determined in step 907 that all the expansion processing has been completed for the rows in the page, data corresponding to the compression column of the insertion target row is compressed (909), and an empty area for storing the compressed data in the page It is determined whether there is (910). If there is an empty area, the compressed data is written to the page (916), and the row insertion process is terminated. If there is no empty area, the page number b of interest is incremented (912), and the decompression process for each line and the compression process for the insertion target line are performed for the next page. If there is an empty area in the page in step 910, the compressed data in step 916 is written, and the process ends. If all the pages in the compression unit are sequentially determined and there is no empty area, it is determined whether there is an unconfirmed compression unit in the table (913). If there is an unconfirmed compression unit in the table, the compression unit number a is incremented (914), and the processing of steps 902 to 912 is performed for the next compression unit. When each page of each compression unit is checked until a page having an empty area into which a row can be inserted is found in this way, and when it is determined in step 913 that there is no more unconfirmed compression unit without finding a page with an empty area. Then, it reports that the insertion of the line has failed due to a lack of area and ends the processing (915).

非圧縮表向けinsert文処理部510は圧縮および伸張処理を行うことなく、挿入対象行のフィールドの挿入を行う。なお、非圧縮表向けinsert文処理部510の処理方式は公知の処理方式であるため、詳細は省く。   The uncompressed table insert statement processing unit 510 inserts the field of the insertion target row without performing compression and expansion processing. Note that the processing method of the uncompressed table insert statement processing unit 510 is a known processing method, and thus the details are omitted.

本実施例において表の全部若しくは一部を読出す際にはSQLにおけるselect文を用いる。ユーザ512が発行したselect文は問合せ処理部507が受け取り処理を行う。問合せ処理部からのselect文処理命令はI/O振分処理部509に渡される。I/O振分処理部509がselect文処理命令を実行する際の動作フローを図10に示す。Select文処理開始(1001)の後、圧縮値定義表508を参照し(1002)、読込み対象の表が圧縮列を含むかを判断する(1003)。圧縮列を含む表である場合は圧縮列を含む表向けselect文処理部519を呼び出し(1004)、処理を完了する(1006)。一方、圧縮列を含まない表が読み出し対象である場合は非圧縮表向けselect文処理部520を呼び出し(1005)、処理を完了する(1006)。   In this embodiment, when reading all or part of the table, a select statement in SQL is used. The select statement issued by the user 512 is received and processed by the query processing unit 507. A select statement processing instruction from the inquiry processing unit is passed to the I / O distribution processing unit 509. FIG. 10 shows an operation flow when the I / O distribution processing unit 509 executes the select statement processing instruction. After the Select statement processing start (1001), the compressed value definition table 508 is referred to (1002), and it is determined whether the table to be read includes a compressed column (1003). If the table includes a compressed column, the table select statement processing unit 519 including the compressed column is called (1004), and the processing is completed (1006). On the other hand, if a table that does not include a compressed column is a read target, the select statement processing unit 520 for uncompressed tables is called (1005), and the processing is completed (1006).

圧縮列を含む表向けselect文処理部519の処理フローを図11、図12に示す。図11は辞書を別途保存する必要がある圧縮方式を用いる場合の圧縮列を含む表向けselect文処理部519の処理フローである。まずユーザ表中の複数の圧縮単位を順次検索するために注目する圧縮単位番号aを1とし(1101)、その1番目の圧縮単位の先頭位置を取得する(1102)。次にその圧縮単位の辞書を読み込む(1103)。当該圧縮単位内の第1ページ目から、そのページを取得する(1104、1105)。取得したページ内の第1行のデータから順に圧縮データを伸張して(1106, 1107)、select 文の条件を満たすか否かを判定し(1108)、条件を満たせばその行の伸縮後のデータを出力する処理1109を行う。この処理後、行番号cをインクリメントして(1111)、各行について順次行う。ステップ1110でページ内に未検索の行がないと判定すると、ステップ1112を経てステップ1114でページ番号bをインクリメントし、次のページについてステップ1105〜1111を繰り返し実施し、以上の処理を、圧縮単位内の未検索ページがなくなるまで各ページについて行う。ステップ1112で圧縮単位内の未検索ページがないと判定すると、ステップ1114を経てステップ1115で圧縮単位番号aをインクリメントし、ユーザ表中の次の圧縮単位の検索を同様に行う。ステップ1114でユーザ表中に未検索の圧縮単位がないと判定するとselect文処理を終了する。図12は辞書を別途保存する必要がない圧縮方式を用いる場合のselect文処理の手順を示す。ユーザ表の複数の圧縮単位について、それぞれが包含する頁ごとに処理が繰り返される点は図11のフローと同様なので、ステップ1213からステップ1214を介してのフローの帰還、及びステップ1211からステップ1212を介してのフローの帰還については説明を略す。各ページについての処理は、まずページを取得し(1204)、頁内の第1行のデータからこの行を伸張し、伸張したことをその伸張時に作成した辞書に反映する(1205、1206)。次に当該行はselect文の条件を満足するかを判定し(1207)。判定がYes ならその行を出力する(1208)。判定がNoならそのままステップ1209に進み、ページ内に未検索の行があれば行番号をインクリメントし(1210)、ページの取得から再び上記の処理を行い、未検索のページがなくなるまで繰り返す。   The processing flow of the table-specific select statement processing unit 519 including a compressed column is shown in FIGS. FIG. 11 is a processing flow of the table-specific select statement processing unit 519 including a compressed string when a compression method that requires a dictionary to be stored separately is used. First, in order to sequentially search a plurality of compression units in the user table, the compression unit number a of interest is set to 1 (1101), and the head position of the first compression unit is acquired (1102). Next, the dictionary of the compression unit is read (1103). The page is acquired from the first page in the compression unit (1104, 1105). The compressed data is decompressed in order from the data of the first line in the acquired page (1106, 1107), and it is determined whether or not the condition of the select statement is satisfied (1108). Processing 1109 for outputting data is performed. After this processing, the line number c is incremented (1111), and the process is sequentially performed for each line. If it is determined in step 1110 that there is no unsearched line in the page, the page number b is incremented in step 1114 through step 1112, and steps 1105 to 1111 are repeatedly performed for the next page. Repeat for each page until there are no more unsearched pages. If it is determined in step 1112 that there is no unsearched page in the compression unit, step 1114 is followed by step 1115 to increment the compression unit number a, and the search for the next compression unit in the user table is similarly performed. If it is determined in step 1114 that there is no unsearched compression unit in the user table, the select statement processing is terminated. FIG. 12 shows the procedure of select statement processing in the case of using a compression method that does not need to store a dictionary separately. Since the processing is repeated for each page included in each of the compression units of the user table in the same manner as the flow of FIG. 11, the flow feedback from step 1213 to step 1214 and the steps 1211 to 1212 are performed. The explanation of the return of the flow through is omitted. In the processing for each page, the page is first acquired (1204), this line is expanded from the data of the first line in the page, and the expansion is reflected in the dictionary created at the time of expansion (1205, 1206). Next, it is determined whether the line satisfies the condition of the select statement (1207). If the judgment is Yes, the line is output (1208). If the determination is No, the process proceeds to step 1209 as it is. If there is an unsearched line in the page, the line number is incremented (1210), the above processing is performed again from the acquisition of the page, and the process is repeated until there is no unsearched page.

非圧縮表向けselect文処理部520の処理方式については、詳細説明を省く。   A detailed description of the processing method of the select statement processing unit 520 for uncompressed tables is omitted.

ユーザ表から行の削除を行う際には、SQLにおけるdelete文を用いる。ユーザ512が発行したdelete文は問合せ処理部507が受け取り処理を行う。問合せ処理部507がdelete文を処理する際の動作フローを図13に示す。delete文処理開始1301の後、圧縮値定義表506を参照し(1302)、delete文の対象となる表が圧縮列を含むか判断する(1303)。すなわち問合せ処理部507が圧縮値定義表506を参照し、削除されるデータに圧縮値が含まれるか判断する。圧縮列を含む場合は圧縮列向けdelete文処理部513を呼び出し(904)、処理を完了する(906)。一方、圧縮列を含まない場合は通常のdelete文処理を呼び出し(1305)、処理を完了する。   When deleting rows from the user table, use the delete statement in SQL. The query processing unit 507 receives and processes the delete statement issued by the user 512. FIG. 13 shows an operation flow when the query processing unit 507 processes the delete statement. After starting the delete statement processing 1301, the compression value definition table 506 is referred to (1302), and it is determined whether the table that is the target of the delete statement includes a compressed column (1303). That is, the query processing unit 507 refers to the compressed value definition table 506 and determines whether the deleted data includes a compressed value. If the compressed string is included, the delete statement processing unit 513 for the compressed string is called (904), and the process is completed (906). On the other hand, if the compressed string is not included, normal delete statement processing is called (1305), and the processing is completed.

ステップ1304で呼び出される圧縮列向けのdelete文処理について図14及び図15を参照して詳述する。図14は、例えばハフマン符号による圧縮に代表される、辞書を別保存する必要がある圧縮方式を用いた場合の、delete文処理部513で実行する圧縮列向けdelete文処理のフローを示す。この場合には、辞書の内容には変更を加えず、実際に行があった箇所を消去し辞書劣化フラグを立てる処理を実行する。図12のフローは、対象となるユーザ表は複数の圧縮単位を含み、その圧縮単位は複数頁を含むことを前提とする。まず、圧縮単位番号aを1とし(1401)、その圧縮単位の先頭位置を取得する(1402)。この例では圧縮単位の先頭位置にその圧縮単位の辞書が格納され、ステップ1403でこの辞書を読み込む。次に圧縮単位内のページ番号bを1とし(1404)、その頁を取得する(1405)。次に取得した頁内の行の番号を1として(1406)、この行を、先の辞書を用いて伸張する(1407)。つぎに当該行がdelete文の対象かどうかを判定し(1408)、yesなら当該行を消去する(1409)とともに、もし圧縮単位内で初の行の消去であれば、上記の辞書に劣化フラグをつける(1410)。当該行がdelete文の対象でなければそのまま1411へ進み、頁内に未処理の行があれば行番号をインクリメントし(1412)、ステップ1407〜1510を繰り返す。さらにステップ1413判定で圧縮単位内に未処理の頁があれば、頁番号をインクリメントし(1414)、その頁を取得して、その頁の各行ごとにステップ1407〜1410を繰り返す。以上の処理により、圧縮単位内のdelete文の対処である行はすべて消去され、その圧縮単位の辞書には劣化フラグがつく。この時の状態は図16(a)に示される。以上の処理は、未処理の圧縮単位があるか否かの判定(1415)および圧縮単位番号aのインクリメント(1416)を経た繰り返しにより、対象となるユーザ表の複数の圧縮単位の全てについて実行される。   The delete statement processing for the compressed string called in step 1304 will be described in detail with reference to FIGS. FIG. 14 shows a flow of the delete statement processing for the compressed string executed by the delete statement processing unit 513 in the case where a compression method that needs to store a dictionary separately, for example, represented by Huffman code compression, is used. In this case, the contents of the dictionary are not changed, and the process of deleting the part where the line actually exists and setting the dictionary deterioration flag is executed. The flow in FIG. 12 is based on the assumption that the target user table includes a plurality of compression units, and the compression units include a plurality of pages. First, the compression unit number a is set to 1 (1401), and the head position of the compression unit is acquired (1402). In this example, the dictionary of the compression unit is stored at the head position of the compression unit, and this dictionary is read in step 1403. Next, the page number b in the compression unit is set to 1 (1404), and the page is acquired (1405). Next, the number of the line in the acquired page is set to 1 (1406), and this line is expanded using the previous dictionary (1407). Next, it is determined whether or not the relevant line is the target of the delete statement (1408). If yes, the relevant line is deleted (1409). If the first line is erased within the compression unit, the deterioration flag is stored in the above dictionary. (1410). If the line is not the object of the delete statement, the process proceeds directly to 1411. If there is an unprocessed line in the page, the line number is incremented (1412), and steps 1407 to 1510 are repeated. If it is determined in step 1413 that there is an unprocessed page in the compression unit, the page number is incremented (1414), the page is acquired, and steps 1407 to 1410 are repeated for each row of the page. As a result of the above processing, all the lines corresponding to the delete statement in the compression unit are deleted, and a deterioration flag is attached to the dictionary of the compression unit. The state at this time is shown in FIG. The above processing is executed for all of the plurality of compression units of the target user table by repeating the determination whether there is an unprocessed compression unit (1415) and the increment of the compression unit number a (1416). The

圧縮方式としてLZ符号に代表される辞書を別保存する必要がない方式を用いた場合、delete文の対象である行に削除フラグを立て、実際には消去を行わない処理を採用できる。この方式は、例えば全ての行の先頭に削除フラグ用の領域を1bit持たせることで実現できる。図15に辞書を別保存する必要がない圧縮方式の場合の圧縮列向けdelete文処理のフローを示す。ユーザ表の複数の圧縮単位について、それぞれが包含する頁ごとに処理が繰り返される点は図14のフローと全く同様なので、ステップ1513からステップ1514を介してのフローの帰還、及びステップ1511からステップ1512を介してのフローの帰還については説明を略す。各頁についての処理は、まず頁を取得し(1504)、頁内の行の番号を1として(1505)、この行を伸張し、伸張したことをその伸張時に作成した辞書に反映する(1506)。次に当該行はdelete文の対象の行か否かを判定する(1507)。判定がYes ならその行が削除された行であることを示す削除フラグを付け(1508)、実際にはページから消去しないでステップ1509へ進む。判定がNoならそのままステップ1509に進み、ページ内に未処理の行があれば行番号をインクリメントし(1510)、ページの取得から再び上記の処理を行い、未処理のページがなくなるまで繰り返す。このdelete文処理を何回か行った後の状態は図17(a)に示される。   When a method that does not need to store a dictionary typified by an LZ code as a compression method is used, it is possible to employ a process in which a deletion flag is set in a row that is a target of a delete statement and no deletion is actually performed. This method can be realized, for example, by providing a 1-bit deletion flag area at the beginning of all lines. FIG. 15 shows a flow of delete statement processing for a compressed string in the case of a compression method that does not require another dictionary to be stored. Since the processing is repeated for each of the pages included in each of the plurality of compression units of the user table, it is exactly the same as the flow in FIG. 14, so the flow is returned from step 1513 to step 1514, and step 1511 to step 1512. The explanation of the flow feedback through the is omitted. In the processing for each page, first, the page is acquired (1504), the number of the line in the page is set to 1 (1505), this line is expanded, and the expansion is reflected in the dictionary created at the time of expansion (1506). ). Next, it is determined whether or not the line is a target line of a delete statement (1507). If the determination is Yes, a deletion flag indicating that the line has been deleted is attached (1508), and the process proceeds to step 1509 without actually erasing the page. If the determination is No, the process proceeds to step 1509 as it is. If there is an unprocessed line in the page, the line number is incremented (1510), the above process is performed again from the acquisition of the page, and the process is repeated until there is no unprocessed page. FIG. 17A shows the state after this delete statement process is performed several times.

いずれの方式においてもdelete文実行に伴い適宜メンテナンス処理を行う必要がある。辞書を別保存する必要がある圧縮方式の場合の図11で説明したdelete文処理では、各圧縮単位内で行の消去が実行されと、図16(a)に示すよう各ページ内に空エリア1601ができ、表に新たな行の挿入要求があった場合に空エリアを使用可能となる。しかし圧縮単位内の圧縮データに関連して辞書保存ページ1602に保存する辞書には消去した行の圧縮に関するもう使用されることのない辞書データが残り、すなわち辞書が劣化することになる。そこで、例えばdelete文処理を特定回数だけ実行したとき、メンテナンス処理を起動する。メンテナンス処理では、各圧縮単位の辞書に劣化フラグ1603が付されているかを検索し、劣化フラグが付された圧縮単位の各ページに含まれる行を伸張するとともに劣化した辞書を破棄し、図16(b)に示すように各行のデータを前詰めに再整列し、再圧縮して各ページに書き込む。再圧縮の処理で生成したで辞書は辞書格納ページ1602にあらためて格納する。   In either method, it is necessary to appropriately perform maintenance processing with the execution of the delete statement. In the delete statement processing described with reference to FIG. 11 in the case of a compression method in which a dictionary needs to be stored separately, when a line is erased within each compression unit, an empty area is included in each page as shown in FIG. 1601 is created, and an empty area can be used when there is a request to insert a new row in the table. However, in the dictionary stored in the dictionary storage page 1602 in relation to the compressed data in the compression unit, dictionary data that is no longer used for compression of the deleted line remains, that is, the dictionary deteriorates. Therefore, for example, when the delete statement process is executed a specific number of times, the maintenance process is started. In the maintenance process, it is searched whether the deterioration flag 1603 is attached to the dictionary of each compression unit, the line included in each page of the compression unit to which the deterioration flag is attached is expanded and the deteriorated dictionary is discarded. As shown in (b), the data in each row is rearranged to the left, recompressed, and written to each page. The dictionary generated by the recompression process is stored again in the dictionary storage page 1602.

辞書を別保存する必要のない圧縮方式の場合の図12で説明したdelete文処理では、行の削除を行ってもその行に図17(a)に示す削除フラグ1701がつくだけで行データは残される。したがって、そのままではdelete文処理を進めても空エリアができないので、空エリアの確保のためにはメンテナンス処理を行うのが良い。この場合のメンテナンス処理として、削除フラグ1701がついた行を含む圧縮単位を検索し、その圧縮単位内の各ページの削除フラグがついた行を消去し、図18(b)に示すように、各行のデータを前詰めに再整列し、再圧縮して書き込む、という手順を採用できる。   In the delete statement processing described with reference to FIG. 12 in the case of a compression method that does not require another dictionary to be stored, even if a row is deleted, only the deletion flag 1701 shown in FIG. Left behind. Therefore, since the empty area cannot be created even if the delete statement process is advanced as it is, it is preferable to perform the maintenance process in order to secure the empty area. As a maintenance process in this case, the compression unit including the line with the deletion flag 1701 is searched, the line with the deletion flag of each page in the compression unit is deleted, and as shown in FIG. The procedure of rearranging the data in each row to the left, recompressing and writing can be employed.

なお、本実施例で扱うデータ管理方式を更に拡張し、ユーザがデータに含まれる値ごとに圧縮の有無と圧縮単位と圧縮方式を指定し、圧縮値管理表ではデータ識別子と圧縮識別子と圧縮単位と圧縮方式を管理することで、列ごとに最適な圧縮方式を指定することも可能である。   Note that the data management method handled in this embodiment is further expanded, and the user specifies the presence / absence of compression, the compression unit, and the compression method for each value included in the data. In the compression value management table, the data identifier, the compression identifier, and the compression unit are specified. By managing the compression method, it is possible to specify the optimum compression method for each column.

図18に圧縮方式も指定する場合のユーザ表とそれに対応するcreate table文の拡張および圧縮列管理表の例を示す。図18(a)に示すsongs表1801はミュージックプレイヤーの楽曲情報を保存するユーザ表であり、通し番号を表すid列、歌手名を表すartist_name列、アルバム名を表すalbum_name列、リリース年を表すrelease列、アルバム内の曲順を表すtrack_num列、楽曲のジャンルを表すgenre列、楽曲名を表すsong_title列からなる。ここで、artist_name列とalbum_name列とrelease列を圧縮列と指定し、さらにartist_name列は2ページずつLZ符号で、album_name列とrelease列を4ページずつハフマン符号で圧縮する場合の表構造定義に用いるcreate table文の拡張を図18(b)に示す。このcreate table文の拡張ではartist_name列とalbum_name列とrelease列を定義する際に、データ型定義に続いて圧縮列である事を示す“compress”と圧縮単位である”2”および”4”と圧縮方式である”LZ”および”Huffman”を指定している。さらに図18(c)の圧縮列管理表1803ではデータ識別子と圧縮列識別子と圧縮単位と圧縮方式を管理する。すなわちユーザが指定した圧縮を行う値とその値を含むデータの識別子と圧縮単位と圧縮方式を圧縮値定義処理部が受け取り、圧縮値管理表に保存する。さらに図7の手順704における圧縮列を含む表向けinsert文処理の際に、insert文処理部511は圧縮値管理表を参照してそこに指定された圧縮単位と圧縮方式にしたがって要求されたフィールドの挿入のための伸張処理、圧縮処理をおこなう。同様に図10の手順1004における圧縮列を含む表向けselect文処理の際にも、select文処理部520は圧縮値管理表508を参照し、指定された圧縮単位と圧縮方式に基づき伸張処理をして要求されたフィールドを出力する。   FIG. 18 shows an example of the user table and the corresponding create table statement expansion and compression column management table when the compression method is also specified. A songs table 1801 shown in FIG. 18A is a user table for storing music player music information, an id column representing a serial number, an artist_name column representing a singer name, an album_name column representing an album name, and a release column representing a release year. , A track_num column representing the order of the songs in the album, a genre column representing the genre of the music, and a song_title column representing the music name. Here, the artist_name column, the album_name column, and the release column are designated as compressed columns, and the artist_name column is used for LZ code compression for two pages, and the album_name column and release column are used for table structure definition when compressing four pages for Huffman code. The extension of the create table statement is shown in FIG. In this create table statement extension, when defining the artist_name column, album_name column, and release column, the data type definition is followed by “compress” indicating that it is a compressed column, and compression units “2” and “4”. The compression method “LZ” and “Huffman” are specified. Further, a compressed column management table 1803 in FIG. 18C manages a data identifier, a compressed column identifier, a compression unit, and a compression method. In other words, the compression value definition processing unit receives the compression value specified by the user, the identifier of the data including the value, the compression unit, and the compression method, and stores them in the compression value management table. Further, when processing the insert statement for a table including a compressed column in the procedure 704 of FIG. 7, the insert statement processing unit 511 refers to the compression value management table and requests the field requested in accordance with the compression unit and compression method specified there. Perform decompression processing and compression processing for insertion. Similarly, in the case of the select statement processing for a table including a compressed column in the procedure 1004 of FIG. 10, the select statement processing unit 520 refers to the compression value management table 508 and performs the expansion processing based on the designated compression unit and compression method. To output the requested field.

データを圧縮することにより、ストレージ容量の制約の厳しい機器で利用できる。また、圧縮を行う列をユーザ指定とすることで演算量も削減でき、演算能力やメモリ制約の厳しい機器で利用できる。特に、演算能力とメモリ制約共に扱うデータ量とシステム規模の相対的な関係であり、ポータブル機器のみならず、大規模サーバにおいても適用可能である。   By compressing data, it can be used on devices with severe storage capacity constraints. In addition, the amount of calculation can be reduced by specifying the column to be compressed by the user, and it can be used in a device with severe calculation capacity and memory restrictions. In particular, it is a relative relationship between the amount of data to be handled and the system scale for both computing capacity and memory constraints, and can be applied not only to portable devices but also to large-scale servers.

本発明のデータ圧縮処理を伴うデータ管理方法を実施する実施例1のコンピュータシステムのシステム構成図である。(実施例1)1 is a system configuration diagram of a computer system according to a first embodiment that implements a data management method involving data compression processing according to the present invention. Example 1 本発明の実施例の管理対象である表の構成要素を示した説明図である。It is explanatory drawing which showed the component of the table | surface which is the management object of the Example of this invention. 上記実施例1におけるユーザ表とそれに対応するデータ定義文および圧縮列管理表を示した説明図である。It is explanatory drawing which showed the user table in the said Example 1, the data definition sentence corresponding to it, and a compression column management table. 上記実施例1における構造体の配列を拡張した例を示した説明図である。It is explanatory drawing which showed the example which expanded the arrangement | sequence of the structure in the said Example 1. FIG. 本発明のデータ圧縮処理を伴うデータ管理方法を実施する実施例2のコンピュータシステムのシステムである。It is a system of the computer system of Example 2 which implements the data management method accompanied by the data compression process of this invention. 上記実施例2におけるユーザ表とそれに対応するデータ定義文および圧縮列管理表を示した説明図である。It is explanatory drawing which showed the user table in the said Example 2, the data definition sentence corresponding to it, and a compression column management table. 上記実施例2のI/O振分処理部がinsert文処理命令を実行する際の処理フローを示すフローチャートである。It is a flowchart which shows the processing flow at the time of the I / O distribution process part of the said Example 2 executing an insert statement processing command. 上記実施例2の圧縮列を含む表向けinsert文処理部が実行するinsert文処理の一例の手順を示すフローチャートである。It is a flowchart which shows the procedure of an example of the insert statement process which the insert statement processing part for tables containing the compression column of the said Example 2 performs. 上記圧縮列を含む表向けinsert文処理部が実行するinsert文処理の他の例の手順を示すフローチャートである。It is a flowchart which shows the procedure of the other example of the insert sentence process which the insert sentence process part for tables containing the said compression column performs. 上記I/O振分処理部がselect文処理命令を実行する際の処理フローを示したフローチャートである。It is the flowchart which showed the processing flow at the time of the said I / O distribution processing part performing a select sentence processing command. 上記実施例2の圧縮列を含む表向けselect文処理部が実行するselect文処理の一例の手順を示すフローチャートである。It is a flowchart which shows the procedure of an example of the select sentence process which the select sentence process part for tables containing the compression sequence of the said Example 2 performs. 上記圧縮列を含む表向けselect文処理部が実行するselect文処理の他の例の手順を示すフローチャートである。It is a flowchart which shows the procedure of the other example of the select sentence process which the select sentence process part for tables containing the said compression string performs. 上記実施例の問合せ処理部がdelete文を処理する際の処理フローを示したフローチャートである。It is the flowchart which showed the processing flow at the time of the inquiry process part of the said Example processing a delete sentence. 上記実施例2の圧縮列向けdelete文処理部が実行するdelete文処理の一例の手順を示すフローチャートである。It is a flowchart which shows the procedure of an example of the delete sentence process which the delete sentence process part for compression strings of the said Example 2 performs. 上記圧縮列向けdelete文処理部が実行するdelete文処理の他の例の手順を示すフローチャートである。It is a flowchart which shows the procedure of the other example of the delete sentence process which the said delete sentence process part for compressed strings performs. 上記図14のdelete文処理部を行う場合に採用するメンテナンス処理の前および後の表データの状態を示す概念図である。It is a conceptual diagram which shows the state of the table data before and after the maintenance process employ | adopted when performing the delete sentence process part of the said FIG. 上記図15のdelete文処理部を行う場合に採用するメンテナンス処理の前および後の表データの状態を示す概念図である。It is a conceptual diagram which shows the state of the table data before and after the maintenance process employ | adopted when performing the delete sentence process part of the said FIG. 実施例2の変形例におけるユーザ表とそれに対応するデータ定義文および圧縮列管理表を示した説明図である。It is explanatory drawing which showed the user table in the modification of Example 2, the data definition sentence corresponding to it, and a compression column management table.

符号の説明Explanation of symbols

101、501…コンピュータシステム、
102、502…リレーショナルデータベース実行部、
103、503…ストレージ、
104、504…ユーザデータ領域、
105、505…管理情報領域、
106、506、603、1803…圧縮値管理表、
107、507…問合せ処理部、
108、508…圧縮値定義処理部、
109、512…ユーザ、
110、515…AP実行部、
111、516…オペレ−ティングシステム、
112、517…CPU、
509…IO振り分け処理部、
510…非圧縮表向けinsert文処理部、
511…圧縮列を含む表向けinsert文処理部、
513…圧縮列向けdelete文処理部、
514…通常のdelete文処理部、
519…圧縮列を含む表向けselect文処理部、
520…非圧縮表向けselect文処理部。
101, 501 ... computer system,
102, 502 ... relational database execution unit,
103, 503 ... Storage,
104, 504 ... user data area,
105, 505 ... management information area,
106, 506, 603, 1803 ... compression value management table,
107, 507 ... inquiry processing unit,
108, 508 ... compression value definition processing unit,
109, 512 ... user,
110, 515 ... AP execution unit,
111, 516 ... operating system,
112, 517 ... CPU,
509 ... IO distribution processing unit,
510 ... insert statement processing unit for uncompressed table,
511 ... insert statement processing unit for a table including a compressed column,
513 ... delete statement processing unit for compressed columns,
514: Normal delete statement processing unit,
519 ... select statement processing unit for tables including compressed columns,
520: Select statement processing unit for uncompressed table.

Claims (8)

複数項目の値の組が繰り返し現れるデータに対し、ストレージ上の圧縮値管理表にもとづいたデータ圧縮処理を行って管理を行うデータ管理方法であって  A data management method for managing data by repeatedly performing data compression processing based on a compression value management table on a storage for data in which a set of multiple item values repeatedly appears.
前記データ中の項目ごとに、圧縮の有無及び圧縮単位のユーザによる指定を受け付け、  For each item in the data, accept the designation by the user of the presence or absence of compression and the compression unit,
圧縮有りと指定された各項目に関して、該項目の識別子、該項目を含むデータの識別子、及び圧縮単位を前記圧縮値管理表に保存し、  For each item designated as being compressed, the identifier of the item, the identifier of the data including the item, and the compression unit are stored in the compressed value management table,
前記データのうち、前記項目の識別子で特定されるデータのみ指定された圧縮単位の範囲内で圧縮処理を施して前記ストレージ上で管理するデータ圧縮処理を伴うデータ管理方法。  A data management method involving a data compression process in which only the data specified by the identifier of the item among the data is compressed and managed on the storage within a compression unit range designated.
前記データに値の組を挿入する要求を受けた際に、前記圧縮値管理表を参照して前記値の組の各項目について圧縮有りの項目か否かを判定し、圧縮有りの場合は前記圧縮値管理表に保存された該項目の圧縮単位の範囲内の値を前記ストレージから読み込んでデータ圧縮処理を実行してその結果を挿入し、否の場合は要求された値のまま挿入することを特徴とする請求項1記載のデータ圧縮処理を伴うデータ管理方法。  When receiving a request to insert a set of values into the data, it is determined whether or not each item of the set of values is a compressed item with reference to the compressed value management table. A value within the compression unit range of the item stored in the compression value management table is read from the storage, the data compression process is executed, and the result is inserted. If not, the requested value is inserted as it is. The data management method with data compression processing according to claim 1. 前記データの全部若しくは一部を読み出す要求を受けた場合に、前記圧縮値管理表を参照して読み出し対象の値が圧縮有りの項目か否かを判定し、圧縮有りの場合は前記圧縮値管理表に保存された該項目の圧縮単位の範囲内の値を前記ストレージから読み込んでデータ伸張処理を行うことを特徴とする請求項1記載のデータ圧縮処理を伴うデータ管理方法。  When a request to read all or part of the data is received, it is determined whether or not the value to be read is an item with compression by referring to the compression value management table. 2. The data management method with data compression processing according to claim 1, wherein a value within the range of the compression unit of the item stored in the table is read from the storage and data decompression processing is performed. 前記データの全部若しくは一部を削除する要求を受けた場合に、前記圧縮値管理表を参照して削除が要求されたデータに圧縮対象項目の値が含まれるか否かを判定する手順、及び、圧縮対象項目の値が含まれる場合は、圧縮値に特有のデータ削除処理を行う手順を更に有する請求項1記載のデータ管理方法。  A procedure for determining whether the value of the item to be compressed is included in the data requested to be deleted with reference to the compression value management table when receiving a request to delete all or part of the data; and The data management method according to claim 1, further comprising a procedure of performing data deletion processing specific to the compressed value when the value of the item to be compressed is included. 前記圧縮処理は圧縮時に圧縮単位ごとの辞書を作成して圧縮単位の先頭に該辞書を保存する圧縮方式であり、前記圧縮値に特有のデータ削除処理は、圧縮単位の先頭から、圧縮値を伸張し、削除対象データであれば消去する処理を繰り返す手順、当該圧縮単位の辞書に劣化フラグを付す手順を含むことを特徴とする請求項4記載のデータ管理方法。  The compression process is a compression method in which a dictionary for each compression unit is created at the time of compression and the dictionary is stored at the beginning of the compression unit, and the data deletion process specific to the compression value is performed by calculating the compression value from the beginning of the compression unit. 5. The data management method according to claim 4, further comprising: a procedure of repeating a process of decompressing and deleting data to be deleted; and a procedure of attaching a deterioration flag to the dictionary of the compression unit. 前記圧縮処理は圧縮時に作成した辞書の保存の処理を伴わない圧縮方式であり、前記圧縮値に特有のデータ削除処理は、圧縮単位の先頭から、圧縮値を伸張し、削除対象データであれば当該データを前記ストレージから消去する代わりに当該データ削除フラグを付すことを繰り返す手順を含むことを特徴とする請求項4記載のデータ管理方法。  The compression process is a compression method that does not involve the process of saving the dictionary created at the time of compression, and the data deletion process specific to the compression value is the data to be deleted if the compression value is expanded from the beginning of the compression unit. 5. The data management method according to claim 4, further comprising a step of repeatedly attaching the data deletion flag instead of deleting the data from the storage. 前記圧縮値管理表には圧縮有りと指定された各項目に関して該項目の識別子、該項目を含むデータの識別子、及び圧縮単位に加えて圧縮方法の指定を保存し、前記データのうち、前記項目の識別子で特定されるデータのみ指定された圧縮単位の範囲内で指定された圧縮方法で圧縮処理を施して前記ストレージ上で管理する請求項1記載のデータ圧縮処理を伴うデータ管理方法。  In the compressed value management table, in addition to the item identifier, the identifier of the data including the item, and the compression unit designation for each item designated as compressed, a compression method designation is stored, and the item of the data 2. A data management method involving data compression processing according to claim 1, wherein only the data specified by the identifier is managed on the storage by performing compression processing using a compression method specified within a specified compression unit range. 前記圧縮単位は、前記データの圧縮処理が施される区分のサイズであり、前記データのサイズ、行数、フィールド数、又は、前記ストレージ上でのページ数であることを特徴とする請求項1に記載のデータ管理方法。  2. The compression unit is a size of a partition to which the data is subjected to compression processing, and is the size of the data, the number of rows, the number of fields, or the number of pages on the storage. Data management method described in 1.
JP2008189277A 2008-07-23 2008-07-23 Data management method with data compression processing Expired - Fee Related JP5303213B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008189277A JP5303213B2 (en) 2008-07-23 2008-07-23 Data management method with data compression processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008189277A JP5303213B2 (en) 2008-07-23 2008-07-23 Data management method with data compression processing

Publications (2)

Publication Number Publication Date
JP2010026884A JP2010026884A (en) 2010-02-04
JP5303213B2 true JP5303213B2 (en) 2013-10-02

Family

ID=41732644

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008189277A Expired - Fee Related JP5303213B2 (en) 2008-07-23 2008-07-23 Data management method with data compression processing

Country Status (1)

Country Link
JP (1) JP5303213B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013101470A (en) * 2011-11-08 2013-05-23 Toshiba Corp Database compression apparatus
US8639672B2 (en) * 2012-03-27 2014-01-28 International Business Machines Corporation Multiplex classification for tabular data compression
US10866941B2 (en) 2016-03-07 2020-12-15 Hitachi, Ltd. Computer and database management method
JP6336524B2 (en) 2016-07-25 2018-06-06 株式会社高速屋 Data compression encoding method, apparatus thereof, and program thereof
JP6336636B2 (en) * 2017-01-20 2018-06-06 株式会社高速屋 Data compression encoding method, apparatus thereof, and program thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08314957A (en) * 1995-05-18 1996-11-29 Mitsubishi Electric Corp Database system
JP2000305822A (en) * 1999-04-26 2000-11-02 Denso Corp Device for database management and device for database extraction, and method for database management and method for database extraction

Also Published As

Publication number Publication date
JP2010026884A (en) 2010-02-04

Similar Documents

Publication Publication Date Title
US7370068B1 (en) Sorting of records with duplicate removal in a database system
EP3327588B1 (en) Value-id-based sorting in column-store databases
US11169978B2 (en) Distributed pipeline optimization for data preparation
US11461304B2 (en) Signature-based cache optimization for data preparation
US7454403B2 (en) Method and mechanism of improving performance of database query language statements using data duplication information
WO2005086003A1 (en) Database system
Polyzotis et al. Selectivity estimation for XML twigs
US8108431B1 (en) Two-dimensional data storage system
WO2017151194A1 (en) Atomic updating of graph database index structures
KR20190134115A (en) Method and apparatus for providing efficient indexing and computer program included in computer readable medium therefor
JP5303213B2 (en) Data management method with data compression processing
US10642815B2 (en) Step editor for data preparation
US6745198B1 (en) Parallel spatial join index
EP3362808B1 (en) Cache optimization for data preparation
JP2004524632A (en) System and method for reorganizing stored data
CN1018032B (en) System and method for efficient analysis of relational database objects
Nørvåg Supporting temporal text-containment queries in temporal document databases
Carter et al. Nanosecond indexing of graph data with hash maps and VLists
US6925630B1 (en) Method for generating code for processing a database
US20210056090A1 (en) Cache optimization for data preparation
US11288447B2 (en) Step editor for data preparation
US20220335030A1 (en) Cache optimization for data preparation
CN108959308A (en) A kind of reply can supplemental data indexing means
CN111694847A (en) Updating access method with high concurrency and low delay for extra-large LOB data
Riegger Multi-version indexing for large datasets with high-rate continuous insertions

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110523

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121204

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130128

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130528

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130624

R151 Written notification of patent or utility model registration

Ref document number: 5303213

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees