JPH0772898B2 - Index creation method - Google Patents

Index creation method

Info

Publication number
JPH0772898B2
JPH0772898B2 JP56100142A JP10014281A JPH0772898B2 JP H0772898 B2 JPH0772898 B2 JP H0772898B2 JP 56100142 A JP56100142 A JP 56100142A JP 10014281 A JP10014281 A JP 10014281A JP H0772898 B2 JPH0772898 B2 JP H0772898B2
Authority
JP
Japan
Prior art keywords
data
key
index
database
binary
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 - Lifetime
Application number
JP56100142A
Other languages
Japanese (ja)
Other versions
JPS582938A (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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP56100142A priority Critical patent/JPH0772898B2/en
Publication of JPS582938A publication Critical patent/JPS582938A/en
Publication of JPH0772898B2 publication Critical patent/JPH0772898B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

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/9017Indexing; Data structures therefor; Storage structures using directory or table look-up

Landscapes

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

Description

【発明の詳細な説明】 本発明は、インデックスのキーを所定の記号化方式によ
って創成することによって、データ項目長の変更の際に
もインデックスを再作成せずに実行できるインデックス
の作成方式に関するものである。本発明によれば、デー
タベースの論理構造上のデータ構造の変更が発生して
も、インデックスをそのままの状態で運用を継続するこ
とができる。
The present invention relates to a method of creating an index that can be executed without recreating the index even when the data item length is changed by creating a key of the index by a predetermined encoding method. Is. According to the present invention, even if the data structure of the logical structure of the database is changed, it is possible to continue the operation without changing the index.

複数の利用者からデータを同時に共用するデータベース
処理装置において、データベース管理システムが高度化
する傾向の中で、拡張性,柔軟性に富むデータベース運
用形態を実現する技術が必要とされている。
In a database processing device that shares data from a plurality of users at the same time, there is a need for a technology that realizes a database operation mode that is highly expandable and flexible in the trend of sophisticated database management systems.

例えば、データベース導入時に行われるデータベース設
計では上流設計として位置づけられている実在データの
情報分析・整理・統合によって、完全なデータの論理関
係を明らかにする必要がある。しかしながら、実際のデ
ータ分析は膨大かつ常に変化する環境の中でデータを扱
わなければならないため、分析が終了する時点にはな何
らかの影響により、データ設計の手直しをすることが常
である。このような問題はデータベース導入期間や運用
時にも、データベースの手直しは必要となる。したがっ
て、柔軟で拡張性に飛んだデータベース管理システムが
求められている。特に、リレーショナル・データベース
の商用化に伴い、利用者が扱う応用プログラムとデータ
ベースの独立性が強く求められるようになり、利用者の
立場からのデータベース(論理データベース)とデータ
ベース管理システム側のデータベースの独立性が重要な
課題となってきている。
For example, in the database design performed at the time of introducing the database, it is necessary to clarify the logical relationship of complete data by analyzing, organizing, and integrating existing data, which is positioned as an upstream design. However, in actual data analysis, data must be handled in an enormous and constantly changing environment, and it is usual to redesign the data due to some influence at the time when the analysis ends. Such problems require reworking of the database even during database introduction period and operation. Therefore, a flexible and scalable database management system is required. In particular, with the commercialization of relational databases, independence between application programs handled by users and databases is strongly required, and the independence of databases (logical databases) from the user's standpoint and databases on the database management system side. Sex is becoming an important issue.

このような要請の中で、データベース物理構造である論
理構造上のデータに対する格納構造以外にも、高速にデ
ータを検索する手段としてのインデックス構造について
も柔軟なインデックス構造が求められている。
In such a demand, in addition to a storage structure for data on a logical structure which is a physical structure of a database, a flexible index structure is required for an index structure as a means for searching data at high speed.

データを同時に共用するデータベースでは大きく論理構
造と物理構造に分類できる。これは、下記の文献1の3,
4章からも明らかである。
Databases that share data at the same time can be roughly classified into logical structures and physical structures. This is described in Reference 1-3,
It is clear from Chapter 4.

文献1 「Computer Data−Base Organization」2ed,JAMES MART
IN,PRENTICE−HALL,INC,1977 データベース管理システムは、利用者の応用プログラム
から見える論理的なファイルやテーブル(これを論理デ
ータベースと呼ぶことにする)と物理データベースのデ
ータ・アクセスの変換処理を実現している。ここでは、
本発明に関連しない論理データベースの説明は行わな
い。物理データベースでは、文献1の20章にあるような
周知のインデックス順構造(Indexed Sequential Organ
ization),ハッシュ(Hashing),22章や23章にあるよ
うなポインタ構成(Pointers)やチェーン・リング構造
(Chains AND Ring Structures)がある。これらのデー
タ構造は、主に論理データベースのデータをマッピング
するために利用する。ここでマッピングとは、論理デー
タベース上のレコード(ロー)が論理データベースの複
数の構造に分割して配置したり、複数の論理データベー
スのレコードを一つの物理データベースの構造に配置、
またはそれらの組合せを言う。
Reference 1 "Computer Data-Base Organization" 2ed, JAMES MART
IN, PRENTICE-HALL, INC, 1977 The database management system realizes the conversion process of the data access of the logical file or table (this is called the logical database) and the physical database that can be seen from the application program of the user. is doing. here,
A description of logical databases not relevant to the present invention will not be given. In the physical database, the well-known indexed sequential structure (Indexed Sequential Organ) as described in Chapter 20 of Reference 1 is used.
ization), Hashing, Pointers and Chains AND Ring Structures as described in Chapters 22 and 23. These data structures are mainly used for mapping the data of the logical database. Here, mapping means that records (rows) in a logical database are divided and arranged in multiple structures in the logical database, or records in multiple logical databases are arranged in one physical database structure.
Or say a combination thereof.

それぞれの物理データベース格納構造へのアクセスに
は、挿入・削除・検索・更新といった周知の構成が含ま
れている。例えば、文献1の20章の順処理,乱処理には
検索系の構成や挿入・削除といった構成が示されてい
る。更新の構成は挿入・削除で代行可能であるが、一般
的に更新の構成を独立させることが多い。
Access to each physical database storage structure includes well-known configurations such as insert / delete / search / update. For example, the forward processing and the irregular processing in Chapter 20 of Document 1 show the configuration of the search system and the configuration of insertion / deletion. The configuration of update can be done by inserting / deleting, but in general, the configuration of update is often independent.

論理データベースでは、一つのキーによってレコードを
検索することは稀で、別の項目をキーとして検索するこ
とが通常行われている。物理データベース構造では、通
常は2次インデックス構造で実現されている。2次イン
デックス構造に関しても文献1の26章,29章に記載のよ
うに周知であるため、詳細な仕組みは省略する。
In a logical database, a record is rarely searched by one key, and another item is usually searched as a key. In the physical database structure, it is usually realized by a secondary index structure. The secondary index structure is also well-known as described in Chapters 26 and 29 of Document 1, and thus the detailed mechanism is omitted.

通常は論理データベースか,マッピングされる物理デー
タベースの格納構造(ベースデータ構造と呼ぶことにす
る)をアクセスする前にインデックスをアクセスする。
インデックスは、目的のベースデータ構造内のデータを
高速に検索する手段を提供するものである。一方、デー
タを同時に共用するようなデータベースでは、ベースデ
ータ構造のデータ更新が入ることが一般的なため、イン
デックス・キーのアップグレード(更新)が必要にな
る。現在では、文献1の30章や,下記の文献2にあるよ
うにバランス木構造のインデックスが主流になってきて
いる。
Usually, the index is accessed before accessing the storage structure of the logical database or the physical database to be mapped (referred to as base data structure).
Indexes provide a fast way to search for data in a target base data structure. On the other hand, in a database in which data is shared at the same time, it is common to update the data of the base data structure, so the index key must be upgraded (updated). At present, as shown in Chapter 30 of Document 1 and Document 2 below, the index of balanced tree structure is becoming mainstream.

文献2 「The Ubiquitous B−Tree」,D.Comer,ACM Computing S
urveys,VoI11,No2,PP 121−138,ACM,1979 インデックス構造のアクセスは、キーによる検索,順処
理検索,キー挿入,キー削除から構成されていることは
周知である。本発明では、その内でキーの検索方式と挿
入方式を例にして、インデックス部の構成を説明してい
る。
Reference 2 “The Ubiquitous B-Tree”, D.Comer, ACM Computing S
urveys, VoI11, No2, PP 121-138, ACM, 1979 It is well known that the access of the index structure consists of search by key, forward search, key insertion, and key deletion. In the present invention, the structure of the index section is described by taking the key search method and the key insertion method as examples.

また、下記の文献3には、文字項目に対する複数キーの
記号化に対する構成が記述されている。これによって、
文字項目の空白部分の圧縮が可能となる構成を利用し
て、文字項目の長さ変更に対してインデックスの再編成
を回避することが可能となる。文献3には、数値項目に
関する構成は記述されていない。文字項目の記号化・展
開技法の構成は、周知の文字項目によるマルチ・キー・
フィールドの連結技法として本明細書中に後述されてい
る。
Further, Document 3 below describes a configuration for symbolizing a plurality of keys for a character item. by this,
It is possible to avoid the reorganization of the index when the length of the character item is changed by utilizing the configuration that enables compression of the blank part of the character item. Document 3 does not describe the configuration related to numerical items. The composition of the symbolization / expansion technique for character items is the multi-key
This is described later in this specification as a field concatenation technique.

文献3 「An Encoding Method For Multifield Sorting and In
dexing」,Michal W Blasgen,Richard G.Gasey,and Kapa
li P Eswaran,Communications of the ACM,Vo120,No11,
ACM,1977 従来技術の問題点は、データベースの導入時または導入
後に数値項目のデータの変更を行った場合には、必ず物
理データベースの再編成が必要であることである。
Reference 3 "An Encoding Method For Multifield Sorting and In
dexing '', Michal W Blasgen, Richard G. Gasey, and Kapa
li P Eswaran, Communications of the ACM, Vo120, No11,
ACM, 1977 The problem with the prior art is that the physical database must be reorganized whenever the data of a numerical item is changed during or after the introduction of the database.

ところが、インデックスが関連するデータベースの属性
変更やデータ長の変更は、従来技術では禁止項目である
ことが多い。この場合、いったんインデックスの削除
し、インデックスを再創成する必要があった。再作成の
ためにベースデータ構造の全データを検索しなければな
らないため、システム・サービスを一時的に停止する必
要がある。
However, changing the attribute or the data length of the database associated with the index is often a prohibited item in the related art. In this case, it was necessary to delete the index once and recreate it. System data needs to be temporarily stopped because all data in the base data structure must be retrieved for re-creation.

したがって、データベースの導入後に、データの変更を
行う際には必ずデータベースをサービスを停止する必要
があった。
Therefore, after the introduction of the database, it was necessary to stop the service of the database when changing the data.

本発明は、応用プログラムのトランザクション処理やジ
ョブの切れ目と言った短時間にスキーマや物理構造定義
体の変更のためにサービスは中断するが、インデックス
構造には影響せずに、データベース・サービスを続行で
きるようにするものである。
According to the present invention, the service is interrupted due to the change of the schema and the physical structure definition in a short time such as the transaction processing of the application program or the break of the job, but the database service is continued without affecting the index structure. It enables you to do it.

これらは、特に大規模なトランザクション処理用データ
ベース,部門データベース,個人向けのパーソナルなデ
ータベースには必要なサービスである。大規模なトラク
ザクション処理用データベースでは、予めデータベース
設計を行って、導入テストを行いサービスに入る。デー
タベース設計の上流工程では実在するデータの情報分析
を完全に行ってから導入,サービスに入ることになる
が、外部環境は常に変化しているため、実際にはデータ
ベースの導入やサービス時期に変更が発生する。部門デ
ータベースや個人データベースでは、大規模システムと
比較してデータベース設計に掛ける時間が少ない。この
ようなデータベースで頻繁にデータベースの変更が発生
する。
These are necessary services especially for large-scale transaction processing databases, department databases, and personal databases for individuals. For a large-scale transaction processing database, the database is designed in advance, an introduction test is conducted, and the service is entered. In the upstream process of database design, information analysis of existing data will be performed completely before the introduction and service will be entered, but since the external environment is constantly changing, in reality the changes in the database installation and service period may occur. Occur. Department databases and personal databases require less time to design databases than large-scale systems. Database changes frequently occur in such databases.

本発明は、上記の考察に基づくものであって、リレーシ
ョナル・データベース・システムにおいて、データ項目
の長さや属性などの変更に行ってもインデックスの再創
成を必要としないようにしたインデックスの作成方式を
提供することを目的としている。そしてそのため、本発
明のインデックスの作成方式は、 圧縮キーを持つ複数のインデックスからなるインデック
ス部(1)と、 インデックス部(1)から取り出された圧縮キーの展開
およびインデックス部(1)に書き込むべきキーの圧縮
を行う圧縮・展開手段(2)と、 記号化手段(3)と を具備するリレーショナル・データベース・システムに
おけるインデックスの作成方式であって、 記号化手段(3)は、入力項目データの中に数値項目デ
ータが存在する場合には、数値項目データを所定バイト
長の2進データに変換し、 変換の結果得られる2進データを、正のときには正であ
ること及び削除された‘00“(16進)を除いた有効バイ
ト数を示す制御バイト並びに‘00'(16進)が除かれた
データ部から成る記号化2進データに変換し、負のとき
には負であること及び‘FF'(16進)の削減バイト数を
示す制御バイト並びに‘FF'(16進)が削除されたデー
タ部からなる記号化2進データに変換し、 入力項目データの中に他のデータ項目がある場合には、
変換の結果得られた記号化2進データと他のデータ項目
とを連結し、連結したものをキーとして出力するように
構成されている。
The present invention is based on the above consideration, and provides a method of creating an index in a relational database system that does not require re-creation of the index even when the length and attributes of data items are changed. It is intended to be provided. Therefore, according to the index creating method of the present invention, the index part (1) composed of a plurality of indexes having the compression key, the expansion of the compression key extracted from the index part (1), and the writing to the index part (1) should be performed. A method of creating an index in a relational database system comprising a compression / decompression means (2) for compressing a key and a symbolization means (3), wherein the symbolization means (3) If there is numeric item data in it, the numeric item data is converted to binary data of a specified byte length, and the binary data obtained as a result of the conversion is positive when it is positive and has been deleted. Converted to symbolized binary data consisting of a control byte indicating the number of valid bytes excluding "(hexadecimal) and a data part excluding" 00 "(hexadecimal), and a negative Sometimes it is negative and it is converted to symbolic binary data consisting of a control byte that indicates the number of reduced bytes of'FF '(hexadecimal) and a data part in which'FF' (hexadecimal) is deleted. If there are other data items inside,
The symbolic binary data obtained as a result of the conversion is concatenated with another data item, and the concatenated data is output as a key.

ことを特徴とするものである。It is characterized by that.

要約すると、本発明は内部10進項目や外部10進項目を2
進項目に変更し、2進項目を文字項目と同様な特性を有
する記号化2進項目に変換し、記号化2進項目を含む複
数のデータ項目を従来から知られているマルチ・キー・
フィールドの連結技法を利用して連結したものである。
In summary, the present invention defines two internal decimal items and two external decimal items.
Converting a binary item into a symbolic binary item having the same characteristics as a character item, and converting a plurality of data items including the symbolic binary item into a conventionally known multi-key item.
They are connected using the field connection technique.

いま Key={A,B} A char (10) B char (10) であるとする。上式は、キーはデータ項目A,Bから構成
されていること、Aは文字形式で10バイトであること、
及びBも文字形式で10バイトであることを示している。
任意の項目データa1,b1に第1図(イ)のような文字が
入っていると仮定する。項目データを或は値nで分割す
る。文字項目は先頭からの比較バイト数で大小が決定さ
れる性質をもっている。従って、分割部分に制御バイト
の重みを付けることによって、ブランクを省略すること
が出来る。例えば、継続結合部分は‘FF'X、その他は有
効文字数とする。上記の技法を用いて、第1図(イ)の
項目データa1とb1と連結すると、第1図(ロ)のように
なる。また、第2図(イ)の項目データa2とb2とを連結
すると、マルチキーは第2図(ロ)のようになる。な
お、‖は結合を表している。第1図(ロ)のキーをk1
し、第2図(ロ)のキーをk2とすると、k1<k2となる。
nの値を例えば4バイトに固定すれば、文字項目の長さ
の変更に対応することが出来る。なお、第2図(ロ)の
‘03'Xは、直前の4バイトの文字領域における有効文字
数が3文字であることを示している。
It is now assumed that Key = {A, B} A char (10) B char (10). The above formula shows that the key consists of data items A and B, A is 10 bytes in character format,
Also, B and B indicate that the character format is 10 bytes.
It is assumed that the arbitrary item data a 1 and b 1 include characters as shown in FIG. Item data is divided by a value n. Character items have the property that their size is determined by the number of comparison bytes from the beginning. Therefore, the blank can be omitted by assigning the weight of the control byte to the divided portion. For example, the continuous connection part is'FF'X, and the others are valid characters. Using the above technique, when coupled with the item data a 1 and b 1 in FIG. 1 (b), so that the first view (b). Further, when connecting the item data a 2 and b 2 of FIG. 2 (b), the multi-key is as FIG. 2 (b). In addition, ‖ represents a bond. If the key in FIG. 1 (b) is k 1 and the key in FIG. 2 (b) is k 2 , then k 1 <k 2 .
By fixing the value of n to, for example, 4 bytes, it is possible to cope with the change in the length of the character item. In addition, '03'X in FIG. 2B indicates that the number of effective characters in the immediately preceding 4-byte character area is three.

次に2進項目の記号化について説明する。先ず入力され
た2進項目を8バイト長に展開する。第3図に示すよう
に、制御バイトを付加し、その1ビット目を空き、2ビ
ット目を符号ビットとし正の時は“1"、負の時は“0"と
する。そして、制御バイトの5ないし8ビット目で以
て、負数のとき‘FF'Xの削除バイト数、正数のとき‘0
0'Xを除いた有効バイト数を表す。‘FF'と‘00'のバイ
ト数を省略することは、絶対数の小さい数ほど省略され
やすいことを示している。
Next, the coding of binary items will be described. First, the input binary item is expanded to a length of 8 bytes. As shown in FIG. 3, a control byte is added, and the first bit is empty and the second bit is a sign bit, which is "1" when positive and "0" when negative. Then, depending on the 5th to 8th bits of the control byte, when the number is negative, the number of deleted bytes of "FF" X, and when the number is positive, it is set to "0".
Indicates the number of valid bytes excluding 0'X. Omitting the number of bytes of'FF 'and' 00 'indicates that the smaller the absolute number, the easier the omission.

こうしてできた記号化キーの大小比較は文字と同等の比
較が可能である。すなわち、制御バイトの符号ビットで
データの正負の文字比較が可能となる。制御バイト中の
5ないし8ビットは負数については‘FF'Xの省略値数
が、正数については‘00'Xを除いた有効バイト数が設定
してあるため、データの桁数による文字比較が可能とな
る。同一桁については負数は補数表現であり、正数はそ
のものを設定してあるため、文字比較が可能である。
The comparison of the size of the symbolized keys made in this way is equivalent to that of characters. That is, the sign bit of the control byte enables positive / negative character comparison of data. Since 5 to 8 bits in the control byte are set to the default value of'FF'X for negative numbers and the number of valid bytes excluding '00'X for positive numbers, character comparison based on the number of digits of data Is possible. For the same digit, the negative number is the complement expression and the positive number itself is set, so that character comparison is possible.

第4図は2進項目の記号化の具体例を示している。第4
図(イ)は入力データ、第4図(ロ)は計算機内部の表
現データ、第4図(ハ)はサプレス後の記号化2進デー
タを示している。
FIG. 4 shows a concrete example of symbolization of binary items. Fourth
FIG. 4A shows input data, FIG. 4B shows representation data inside the computer, and FIG. 4C shows symbolized binary data after suppression.

例えば、入力データが−8888(16進)の場合、計算機内
部の表現データはFFFFFFFFFFFF7778(16進)となる。上
述のように、制御バイトの1ビット目は0(空きを示
す)であり、負数のときは制御バイトの2ビット目が0
であり、制御バイトの5ないし8ビット目で以てFF(16
進)の削除バイト数を表すので、計算機内部の表現デー
タ=FFFFFFFFFFFF7778(16進)に対する制御バイトは00
000110(2進)となる。これを16進で表すと06となる。
For example, when the input data is -8888 (hexadecimal), the expression data inside the computer is FFFFFFFFFFFF7778 (hexadecimal). As described above, the first bit of the control byte is 0 (indicating an empty space), and when the number is negative, the second bit of the control byte is 0.
And the FF (16
Since the number of deleted bytes is 0, the control byte for the expression data in the computer = FFFFFFFFFFFF7778 (hexadecimal) is 00.
It becomes 000110 (binary). This is 06 when expressed in hexadecimal.

例えば、入力データが+8888(16進)の場合、計算機内
部の表現データは0000000000008888(16進)となる。上
述のように、制御バイトの1ビット目は0(空きを示
す)であり、正数のときは制御バイトの2ビット目が1
であり、制御バイトの5ないし8ビット目で以て00(16
進)を除いた有効バイト数を表すので、計算機内部の表
現データ=0000000000008888(16進)に対する制御バイ
トは01000010(2進)となる。これを16進で表すと42と
なる。
For example, when the input data is +8888 (hexadecimal), the expression data inside the computer is 0000000000008888 (hexadecimal). As described above, the first bit of the control byte is 0 (indicating an empty space), and when the number is positive, the second bit of the control byte is 1.
And is 00 (16) depending on the 5th to 8th bits of the control byte.
Since the number of valid bytes excluding the hexadecimal) is represented, the control byte for the expression data in the computer = 0000000000008888 (hexadecimal) is 01000010 (binary). This is 42 when expressed in hexadecimal.

2進数を倍語長で表現し、もう一度記号化する。これに
よれば、記号化前の2進数は1ないし8バイトまでのデ
ータ定義のデータ長に依存しないため、データ属性が変
更されても、記号化手段によりキーの大小関係を保障で
きる。また、もう一度記号化(圧縮)することにより、
倍語長表現のデータ域を制御バイトのみの増加に押さえ
こむことが可能となる。属性変更についても、内部10進
や外部10進を2進倍語長に変換し、2進記号化手段を使
用すれば属性から独立できる。
Represent a binary number in doubleword length and encode it again. According to this, since the binary number before symbolization does not depend on the data length of the data definition of 1 to 8 bytes, even if the data attribute is changed, the symbol size can ensure the magnitude relation of the keys. In addition, by symbolizing (compressing) again,
It is possible to suppress the double word length data area to an increase of only control bytes. The attribute change can also be made independent of the attribute by converting the internal decimal or the external decimal into a binary double word length and using a binary symbolization means.

第5図はデータベースの検索シーケンスを説明するもの
である。インデックス部1のインデックスは、数値デー
タを記号化し、この結果得られた記号化2進データと他
のデータをマルチ・キー・フィールド連結技法により連
結し、連結して得らたキーを前方圧縮/後方圧縮した圧
縮キーを含んでいるものである。前方/後方圧縮・展開
ルーチン2は、キーを前方/後方圧縮する機能と、圧縮
されたキーを元の形に展開する機能を有しているもので
ある。記号化ルーチンは、入力データ項目i1,i2,i3を記
号化し、これらをマルチ・キー・フィールド連結技法で
連結するものである。次に検索シーケンスについて説明
する。
FIG. 5 illustrates a database search sequence. The index of the index part 1 encodes numerical data, connects the resulting encoded binary data and other data by a multi-key field concatenation technique, and forward-compresses the resulting key. It contains a compression key that is backward compressed. The front / rear compression / expansion routine 2 has a function of compressing the key in the front / rear direction and a function of expanding the compressed key in the original form. The symbolization routine is to symbolize the input data items i 1 , i 2 , i 3 and concatenate them with the multi-key field concatenation technique. Next, the search sequence will be described.

イ 入力データ項目i1,i2,i3をそれぞれ記号化する。B. Input data items i 1 , i 2 , i 3 are symbolized respectively.

ロ 連結キーkを出力する(ただし、比較のため最大値
とする)。
(B) Output the concatenation key k (however, the maximum value is used for comparison)

ハ インデックス部1内のインデックスのキーを展開す
る。
C Expands the index key in index section 1.

ニ ハのキーを入力連結キーkと比較し、ハ、ニを繰り
返す。
The key of Niha is compared with the input link key k, and Ha and Ni are repeated.

ホ キーが一致したら、一致を示したインデックスでポ
イントされているデータ項目を出力する。
If the key matches, it outputs the data item pointed to by the matching index.

インデックス部1のインデックスの挿入は、下記のよう
なシーケンスで行われる。
The insertion of the index of the index part 1 is performed in the following sequence.

(イ) 入力データ項目i1,i2,i3を記号化する。(B) Symbolize the input data items i 1 , i 2 , i 3 .

(ロ) 連結キーを出力する。(B) Output the concatenation key.

(ハ) インデックス部1のインデックスのキーを展開
する。
(C) Expand the index key of the index section 1.

(ニ) (ハ)のキーを入力連結キーkと比較する。(D) The key of (c) is compared with the input link key k.

(ハ)、(ニ)を繰り返す。Repeat (c) and (d).

(ホ) インデックスの挿入位置が決まったら、入力連
結キーを前方/後方圧縮ルーチンで圧縮し、圧縮キーと
ポインタによりなるインデックスをその位置に挿入す
る。
(E) When the insertion position of the index is determined, the input concatenated key is compressed by the forward / backward compression routine, and the index formed by the compression key and the pointer is inserted at that position.

上記インデックスについて、インデッスク・キー長が変
更になった場合、第5図に記号化ルーチンの動きを具体
的に説明する。インデックス・キーが単一の2進項目で
ある場合に、インデックス定義がsmall integer(2バ
イトの2進項目と定義する)からlong integer(8バイ
トの2進項目と定義する)に定義変更したい場合を第4
図を例にして説明する。small integerの時に+8888,−
8888(16進)を入力すると、記号化ルーチン3によって
428888と067778と言うキーを作成され、インデックス・
キーとしてインデックス1に登録する。インデックス・
キーはそのまま比較可能であり、キー展開もsmall inte
gerに変換可能である。次にlong integerに変更する。
+888888888888,−888888888888(16進)を入力する
と、記号化ルーチン3によって46888888888888と027777
77777778と言うキーが作成されてインデックス1に登録
する。この時は第4図(ハ)に示すような順になり、sm
all integerの時に作成したキーに影響を与えない。更
に、+0が入力されても40と言うキーになり、インデッ
クスへは067778と428888の間に挿入される。これらのキ
ーはlong integer定義に従って、それぞれ展開すること
可能である。
With respect to the index, when the index key length is changed, the operation of the symbolization routine will be specifically described in FIG. You want to change the index definition from a small integer (defined as a 2-byte binary item) to a long integer (defined as an 8-byte binary item) when the index key is a single binary item. The fourth
A description will be given using the figure as an example. + 8888, -for small integer
If you enter 8888 (hexadecimal), the symbolization routine 3
Created keys called 428888 and 067778, indexed
Register in index 1 as a key. index·
Keys can be compared as they are, and key expansion is also small inte
It can be converted to ger. Then change to long integer.
If you enter +888888888888, -888888888888 (hexadecimal), 46888888888888 and 027777 are generated by symbolization routine 3.
A key called 77777778 is created and registered in index 1. At this time, the order is as shown in Fig. 4 (c), and sm
Does not affect the key created when all is integer. Furthermore, even if +0 is input, it becomes a key called 40, and it is inserted into the index between 067778 and 428888. Each of these keys can be expanded according to the long integer definition.

第6図は在庫テーブルの例を示す図である。このテーブ
ルは四個の項目を有している。PRODUCTは製品名、PNOは
製品番号、QOHは数量、WHNOは倉庫番号をそれぞれ示し
ている。例えば在庫テーブルから在庫数が50以下の製品
名を知りたい場合、SELECT PRODUCT FROM STOCK WHERE
QOH≦50と言う文をリレーショナル・データベースに入
力する。
FIG. 6 is a diagram showing an example of an inventory table. This table has four items. PRODUCT is the product name, PNO is the product number, QOH is the quantity, and WHNO is the warehouse number. For example, if you want to know the names of products whose inventory quantity is 50 or less from the inventory table, select PRODUCT FROM STOCK WHERE
Enter the statement QOH ≤ 50 into a relational database.

第7図は格納構造の例を示す図である。図示の例ではデ
ンス(セカンダリ)・インデッスクをPRODUCTとPNOのマ
ルチ・キーで作成している。
FIG. 7 is a diagram showing an example of the storage structure. In the example shown in the figure, the dense (secondary) index is created with the PRODUCT and PNO multi-keys.

第8図は記号化ルーチン変換および前方/後方圧縮の例
を示す図である。例えば3000と言う数字は、記号化2進
データで表現すると、‘42'X‖‘0BB8'Xとなる。この記
号化2進データとステレオと言う文字データとをマルチ
・キーフィールド連結技法で連結すると、‘ステレオ’
‖‘04'X‖‘42'X‖‘0BB8'Xとなる。実際のインデック
ス上では、第9図に示すように、前方/後方圧縮・展開
ルーチンから出力される圧縮キーを結合して並べて、イ
ンデックスのブロック内へ格納する。
FIG. 8 is a diagram showing an example of symbolic routine conversion and forward / backward compression. For example, the number 3000 is represented as'42'X'0BB8'X when expressed in symbolic binary data. When this symbolic binary data and character data called stereo are concatenated by the multi-key field concatenation technique, 'stereo'
It becomes ‖'04'X ‖'42'X ‖'0BB8'X. On the actual index, as shown in FIG. 9, the compression keys output from the forward / backward compression / expansion routines are combined and arranged, and stored in the index block.

以上の説明から明らかなように、本発明によれば、キー
となる数値データを所定バイト長の2進データにし、所
定バイト長の2進データを記号化し、記号化2進データ
と他のデータを連結し、連結されたものを圧縮技法によ
り圧縮し、このようにして作成された圧縮キーをインデ
ックスのキーとしているので、数値データ項目の長さや
属性などの変更を行っても、インデックス部の再編成を
必要としないと言う効果が得られる。
As is clear from the above description, according to the present invention, the numerical data to be a key is converted into binary data having a predetermined byte length, the binary data having a predetermined byte length is symbolized, and the symbolized binary data and other data are obtained. Are concatenated and the concatenated ones are compressed by the compression technique, and the compression key created in this way is used as the index key, so even if you change the length or attributes of numeric data items, the index part The effect is that no reorganization is required.

【図面の簡単な説明】[Brief description of drawings]

第1図および第2図は従来のマルチ・キー・フィールド
連結技法を説明する図、第3図は本発明による記号化2
進データ項目の構成を示す図、第4図は記号化2進デー
タ項目の具体例を示す図、第5図はデータベース検索シ
ーケンスを説明する図、第6図は在庫テーブルの例を示
す図、第7図は格納構造の例を示す図、第8図は記号化
ルーチン変換および前方/後方圧縮の例を示す図、第9
図は実際のインデックス上での圧縮キーの配置を示す図
である。 2……インデックス部、2……前方/後方圧縮・展開ル
ーチン、3……記号化ルーチン。
1 and 2 are diagrams for explaining a conventional multi-key field concatenation technique, and FIG. 3 is a symbolization 2 according to the present invention.
FIG. 4 is a diagram showing the structure of a binary data item, FIG. 4 is a diagram showing a specific example of a symbolic binary data item, FIG. 5 is a diagram explaining a database search sequence, FIG. 6 is a diagram showing an example of an inventory table, FIG. 7 is a diagram showing an example of a storage structure, FIG. 8 is a diagram showing an example of symbolic routine conversion and forward / backward compression, and FIG.
The figure is a diagram showing the arrangement of compressed keys on an actual index. 2 ... Index part, 2 ... Forward / backward compression / expansion routine, 3 ... Symbolization routine.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】圧縮キーを持つ複数のインデックスからな
るインデックス部(1)と、 インデッスク部(1)から取り出された圧縮キーの展開
およびインデックス部(1)に書き込むべきキーの圧縮
を行う圧縮・展開手段(2)と、 記号化手段(3)と、 を具備するリレーショナル・データベース・システムに
おけるインデックスの作成方式であって、 記号化手段(3)は、入力項目データの中に数値項目デ
ータが存在する場合には、数値項目データを所定バイト
長の2進データに変換し、 変換の結果得られる2進データを、正のときには正であ
ること及び削除された‘00'(16進)を除いた有効バイ
ト数を示す制御バイト並び‘00'(16進)が除かれたデ
ータ部から成る記号化2進データに変換し、負のときに
は負であること及び‘FF'(16進)の削除バイト数を示
す制御バイト並びに‘FF'(16進)が削除されたデータ
部からなる記号化2進データに変換し、 入力項目データの中に他のデータ項目がある場合には、
変換の結果得られた記号化2進データと他のデータ項目
とを連結し、連結したものをキーとして出力するように
構成されている ことを特徴とするインデックスの作成方式。
1. An index part (1) consisting of a plurality of indexes having a compressed key, a compression key for expanding a compressed key extracted from the index part (1) and compressing a key to be written in the index part (1). A method of creating an index in a relational database system, comprising: an expanding means (2); a symbolizing means (3), wherein the symbolizing means (3) includes numerical item data in input item data. If it exists, the numeric item data is converted to binary data of a specified byte length, and the binary data obtained as a result of conversion is positive when it is positive and the deleted '00' (hexadecimal). Converted to symbolic binary data consisting of the data part from which the control byte sequence "00" (hexadecimal) that indicates the number of valid bytes removed is removed, and when it is negative, it is negative and "FF" (hexadecimal) Shaving Control byte and indicates the number of bytes 'FF' (16 decimal) is converted into a symbol of binary data consisting of deleted data unit, if there is other data items in the input item data is
A method of creating an index, characterized in that the symbolic binary data obtained as a result of conversion is concatenated with other data items and the concatenated data is output as a key.
JP56100142A 1981-06-27 1981-06-27 Index creation method Expired - Lifetime JPH0772898B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP56100142A JPH0772898B2 (en) 1981-06-27 1981-06-27 Index creation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP56100142A JPH0772898B2 (en) 1981-06-27 1981-06-27 Index creation method

Publications (2)

Publication Number Publication Date
JPS582938A JPS582938A (en) 1983-01-08
JPH0772898B2 true JPH0772898B2 (en) 1995-08-02

Family

ID=14266056

Family Applications (1)

Application Number Title Priority Date Filing Date
JP56100142A Expired - Lifetime JPH0772898B2 (en) 1981-06-27 1981-06-27 Index creation method

Country Status (1)

Country Link
JP (1) JPH0772898B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4260221B2 (en) * 1996-02-06 2009-04-30 フィッシャー−ローズマウント システムズ, インコーポレイテッド System and method for managing a transaction database of records of changes to field device configurations
GB2369695B (en) * 2000-11-30 2005-03-16 Indigo One Technologies Ltd Database
US10671586B2 (en) * 2017-07-25 2020-06-02 Sap Se Optimal sort key compression and index rebuilding

Also Published As

Publication number Publication date
JPS582938A (en) 1983-01-08

Similar Documents

Publication Publication Date Title
US11899641B2 (en) Trie-based indices for databases
US7178100B2 (en) Methods and apparatus for storing and manipulating variable length and fixed length data elements as a sequence of fixed length integers
Bassiouni Data compression in scientific and statistical databases
US7565349B2 (en) Method for computing frequency distribution for many fields in one pass in parallel
US7783855B2 (en) Keymap order compression
EP3435256B1 (en) Optimal sort key compression and index rebuilding
US20030212694A1 (en) Method and mechanism of improving performance of database query language statements
US5678043A (en) Data compression and encryption system and method representing records as differences between sorted domain ordinals that represent field values
US20040133581A1 (en) Database management system, data structure generating method for database management system, and storage medium therefor
US20030135495A1 (en) Database indexing method and apparatus
EP1504377B1 (en) Storing and querying relational data in compressed storage format
US11803336B2 (en) Efficiently accessing, storing and transmitting data elements
WO1995032477A1 (en) Compressed database with selection of compaction methods
US5301315A (en) Indexing/compression scheme for supporting graphics and data selection
US10146817B2 (en) Inverted index and inverted list process for storing and retrieving information
US5481704A (en) Indexing/compression scheme for supporting graphics and data selection
JP2005018672A (en) Method for compressing structured document
US6279004B1 (en) Database index key versioning
JPH0772898B2 (en) Index creation method
US20080133562A1 (en) Coding compressible variable length database fields
US7133885B2 (en) Database management system using offsets in entries with at least one varying-length column
US6279003B1 (en) Self-describing multiple key format database index
JP3563823B2 (en) Document management device
JP3565840B2 (en) Document management method and document management device
JP2990312B2 (en) Data access method and device