Database management method of invoking a function retrieving index type definition, cataloging particular index which has not yet been supported by a database system6556986Abstract A method and a system for executing a general database processing independent of a specific user-defined function are provided. In an implementation method, index definition information for setting a specific user-defined function in correspondence to a specific index which is used to carry out an index access to data in a database region is created, and module definition information for setting the specific index which is used to carry out the index access to the data in the database region in correspondence to an implementation module for subjecting the data in the database region to a specific processing is created. When it is determined in response to a processing request for the database issued from an end user, that the user-defined function contained therein is set in correspondence to the specific index on the basis of the index definition information, a specific implementation module for carrying out an access using the specific index is selected from the module definition information, and a database processing is performed using the implementation module thus selected. Claims What is claimed is: Description BACKGROUND OF THE INVENTION
CREATE INDEX TYPE: index-type-name
[FOR {data-type-name [, data-type-name, ...]
.vertline.ADT-name
.vertline.ADT-name WITH attribute-name
[, attribute-name, ...]}
]
In the above-mentioned example of the syntax, both the data type of the index key of the item (B) and the number of data items thereof (the number of enumerated data types) are specified in the FOR phrase. In addition, it is indicated that the index key is utilized as the input when updating the data which is of the following types (a) One or more legacy (basic) data types. (b) The ADT shown by the ADT-name. (c) The data of one or more attributes out of the ADT data represented by the ADT-name. The number of data items of the index key of interest is represented by the number of data types or attribute names after the WITH phrase in the above-mentioned example of description of the syntax. In "CREATE INDEX TYPE statement" shown in FIG. 3, the index type is defined in which the index type name is DOC-INDEX and the index key is only of a VARCHAR type. Next to procedure 301 for the definition of an index type, the module definition information 54 of the module to implement the above-mentioned index is registered in procedure 302. Hereinbelow, there is given one example of the user interface when registering the module definition information 54 of the index implementation module based on the index type shown in FIG. 3.
udimodule {
index-type-name : DOC-INDEX
_p_doc_insert {
module calling trigger: AS_INDEX_INSERT
}
_p_doc_delete {
module calling trigger: AS_INDEX_DELETE
}
_p_doc_update
module calling trigger: AS_INDEX_UPDATE
}
_p_doc_scan {
module calling trigger: AS_INDEX_SCAN
}
}
First of all, udimodule shows that the module definition information which has been inputted by a registering user is the definition information of the module to implement the user-defined index 41. Then, as for the name of the user-defined index type associated therewith, DOC-INDEX is shown in "index-type-name". Subsequently, the information relating to the individual modules is indicated. The module "_p_doc_insert" shows that it is the module which is executed at a trigger of the index maintenance when inserting the table data, on the basis of the module calling trigger "AS_INDEX_INSERT". Likewise, the module "_p_doc_delete" shows that it is the module which is executed at a trigger of the index maintenance when deleting the table data, on the basis of the module calling trigger "AS_INDEX_DELETE". Also, the module "_p_doc_update" shows that it is the module which is executed at a trigger of the index maintenance when updating the table data, on the basis of the module calling trigger "AS_INDEX_UPDATE". In addition, the module "_p_doc_scan" shows that it is the module which when the retrieval instruction employing the index of the present index type is issued thereto, is executed in order to implement that retrieval. By completing both the definition of an index type (procedure 301) and the registration of index implementation module definition information (procedure 302) as described above, it becomes possible that the database management system 1 recognizes the module used to implement the index, and also the index of the defined index type is created and used. Next, the definition of the data type including the ADT function as the interface through which the index of the defined index type is used is carried out (procedure 303). In this connection, the definition of the data type is carried out in "CREATE TYPE statement" of the SQL. In the example of "CREATE TYPE statement" shown in FIG. 3, there is defined the ADT of a "TEXT" type having both the attributes of the data, i.e., text_no, text_name, author and contents which are respectively of INT, CHAR, CHAR and VARCHA types, and the ADT function CONTAINS which returns the BOOLEAN type. With respect to the ADT which was defined in procedure 303 of the definition of a data type, the module definition information 54 of the module to implement the ADT is registered in procedure 304. Hereinbelow, there is given an example of the user interface when registering the definition information of the ADT implementation module on the basis of the definition of a data type shown in FIG. 3.
adtmodule {
ADT name: TEXT
_p_text_contains {
module calling trigger: AS_FUNCTION,
ADT function name: CONTAINS
}
_p_text_insert {
module calling trigger: AS_INSERT_TRIGGER
ADT function name: NULL
}
_p_text_delete {
module calling trigger: AS_DELETE_TRIGGER
ADT function name: NULL
}
_p_text_key_create {
module calling trigger: AS_KEY_CREATION
ADT function name: NULL
index type name: DOC-INDEX
}
}
First of all, adtmodule shows that the module definition information 3 which has been inputted by a registering user is the definition information of the ADT implementation module. Then, as for the name of the ADT associated therewith, TEXT is shown in "ADT name". The module "_p_text_contains" shows that it is executed in order to implement the ADT function "CONTAINS". "AS_FUNCTION" is specified as a module calling trigger to the module used to implement the ADT function. The module "_p_text_insert" shows that it is executed when inserting the data of a TEXT type ("AS_INSERT_TRIGGER" shows that a time point of insertion corresponds to a module calling trigger). In addition, the module "_p_text_delete" shows that it is executed when deleting the table data including the data of a TEXT type ("AS_DELETE_TRIGGER" shows that a time point of deletion corresponds to a module calling trigger). In addition, the module "_p_text_key create" represented by "AS_KEY_CREATION" shows that it is the module which is executed in order to create an index key during the maintenance of the index of a DOC-INDEX type represented by the index type name. From the foregoing, the interface which is used to use and maintain the index of the index type of interest is established, and also the decision of use of the index from a user query has been made. Under the definition of the above-mentioned index type and ADT, a table which will be stored in the database region 4 is defined in the subsequent procedures 305 and 306, and also the user-defined index 41 which is previously defined is created for the table. The definition of the table is, in the SQL as in the example of procedure 305 of FIG. 3, carried out in "CREATE TABLE statement". In this example, there is defined a movies_lib table which is constituted by columns of the data, i.e., title, country, produce_year, guide, and movie_contents which are respectively of CHAR, INT, DATE, TEXT, and BLOB types. In the definition of an index (procedure 306) in which the creation of the user-defined index 41 is carried out, information relating to the index which is intended to be created is registered. In the definition of an index, the following three items are specified in addition to the index name which is used to recognize an index to be created. (A) An index type name of an index to be created. (B) A table name, an attribute name or an ADT function name used to decide the data for use in creation of an input key for index maintenance. (C) An ADT function name which will be an interface through which the defined index is used. As for the interface during the above-mentioned creation of an index, there is considered the syntax coming close to the SQL format such as "CREATE INDEX statement" shown in the example of FIG. 3. Hereinbelow, an example of description of the syntax of "CREATE INDEX statement" will be shown in the extended version of the BNF form.
CREATE INDEX table-name
ON {column-name
.vertline.column-name.. attribute-name
[, column-name.. attribute-name ...]
.vertline.column-name (ADT function-name
IN ADT-name)}
FOR function-name [, function-name]
TYPE index-type-name
In the TYPE phrase, an index of which type of the item (A) we should create is specified. In the ON phrase, which column and attribute of the specified table name of the item (B) we should use in the data for index maintenance is specified. Then, in the FOR phrase, the ADT function is specified which will become the interface through which the user-defined index 41 of the item (C) is used. In the information of the item (B), it is possible to specify a plurality of table data. In "CREATE INDEX statement" shown in FIG. 3, there is made the definition of an index in which the added index type is DOC-INDEX, the index name is DOC-SEARCH, and the table data 42 for maintenance is contents attribute in guide column of movies_lib table. In addition, in "CREATE INDEX statement", by using the index type definition information of the dictionary 5, it is also possible to check whether or not the index of the specified index type can be properly created for the data type of the table column which is specified below the ON phrase in which the creation of the index is designated. By executing the above-mentioned procedures, the definition of an index type and the definition (creation) of an index are carried out. In this connection, in the case where the index key constituting the index to which a certain index type is applied specifies certain ADT data, i.e., in the case where both a certain index type and a certain data type are simultaneously registered in the database management system 1, the creation procedures such as the procedure example of FIG. 3 are not carried out, but alternatively (3) the definition of a data type and (4) the registration of ADT implementation module definition information may be carried out before (1) the definition of an index type and (2) the registration of index implementation module definition information. Next, the description will hereinbelow be given with respect to an example of a structure of the dictionary 5, in which the various kinds of definition information previously shown is stored, in the database processing method of the present embodiment with reference to FIGS. 4, 5 and 6. FIG. 4 shows an example of a structure of the index type definition information 51 which is stored in the dictionary 5. As shown in FIG. 4, the index type definition information 51 which is stored in the dictionary 5 of the present embodiment contains therein both index type information 51a and index key information 51b. The index type information 51a includes index type information entries 511 for the number of user-defined index types, and each of the index type information entries 511 contains therein an index type name, an index type identifier (id) and data relating to the number of index keys. The index type name shows the name of the index type which is specified by a user on the basis the definition of an index type, and the index type identifier (id) is the identifier which the database management system 1 assigns to the index type name when defining an index type. Also, the index type identifier (id) is used, instead of the index type name, as the identifier of the index type within the database management system 1. The number of index keys is the number of index keys which are required for maintaining the index of the index type of interest, and it represents the number of index key data types which are specified in "CREATE INDEX TYPE statement". The index key information 51b includes index key information entries 512 for the total sum of the numbers of index keys of the individual index types. Each of the index key information entries 512 contains therein an index type id showing which index type the index key information 51b relates to, a data type of the index key of interest, a definition length of the index key of interest, and a specified number of the index key of interest. In this connection, the above-mentioned specified number shows the order which is specified in "CREATE INDEX TYPE statement". The index type information entries 511 and the index key information entries 512 have a relation of the ratio of one to n (n is the number of index keys) by the index type id. FIG. 5 diagrammatically shows an example of a structure of the index definition information 52 which is stored in the dictionary 5 of the present embodiment. In FIG. 5, reference numeral 52a designates index definition information, reference numeral 521 designates an index definition information entry, reference numeral 52b designates data information for index key creation, reference numeral 522 designates a data information entry for index key creation, reference numeral 52c designates ADT function information for an index access, and reference numeral 523 designates an ADT function information entry for an index access. As shown in FIG. 5, as for the index definition information 52 which is stored in the dictionary 5 of the present embodiment, there are three kinds of information, i.e., the index definition information 52a, the data information 52b for index key creation, and the ADT function information 52c for index access. The index definition information 52a includes index definition information entries 521 for the number of created indexes, and each of the index definition information entries 521 contains therein an index name, an index id, data relating to the number of data for key creation, and an index type id. Now, the index name represents the name of the index which is specified from a user on the basis of the definition of an index, and the index id represents the identifier which the database management system 1 assigns to the index name when defining the index. The index id is used, instead of the index name, as the identifier of the index within the database management system 1. By the number of data for key creation is meant the number of items of the table data 42 which is required for maintaining the index which is specified in "CREATE INDEX statement". Then, the index type id shows the type of the index of interest. The data information 52b for index key creation is the information relating to the table data 42 used to create an index key. In accordance with this information, the required table data 42 is obtained. The data information 52b for index key creation includes data information entries 522 for index key creation for the total sum of the numbers of data used to create the keys of the individual indexes. Each of the data information entries 522 for index key creation contains therein an index id showing which index the data information 52b for index key creation relates to, a specified number, a table name, a column name, and an attribute name or a function name. In this connection, the specified number represents the order which is specified in "CREATE INDEX statement". The ADT function information 52c for an index access is the information relating to the ADT function which will become the interface through which the index is used, and it includes ADT function information entries 523 for an index access for the number of created indexes. Each of the ADT function information entries 523 for an index access contains therein an index (id) showing which index the ADT function information 52c for an index access relates to, and an ADT function name which will be an interface. Now, by setting a plurality of different ADT function names in correspondence to the index id showing the specific index. a plurality of different ADT definition functions can hold both the specific user definition index 41 and the specific implementation module of the various kinds of modules 100a to 100d in common. FIG. 6 shows an example of a structure of the module definition information 54 which is stored in the dictionary 5. As shown in FIG. 6, the module definition information 54 which is stored in the dictionary 5 according to the present embodiment contains therein two kinds of information, i.e., index module definition information 54a and ADT module definition information 54b. The index module definition information 54a is definition information relating to the module used to implement the user-defined index 41, and ADT module definition information 54b is definition information relating to the module used to implement the user-defined data type (ADT). The index module definition information 54a includes index module definition information entries 541 for the number of modules used to implement the user-defined index 41. Each of the index module definition information entries 541 contains therein a module name relating to the specified module used to implement an access to the user-defined index 41, an index type id, and a module calling trigger. The index type id is an index type id showing which index type we should implement. The module calling trigger represents a trigger when the relational module is executed in order to implement the user-defined index 41. The ADT module definition information 54b includes ADT module definition information entries 542 for the number of modules used to implement the ADT. Each of the ADT module definition information entries 542 contains therein a module name relating to the specified module used to implement the behaviour of the ADT, an ADT name, a module calling trigger, an executed ADT function name, and an index type id. The ADT name represents a behaviour of which ADT the relational module (recognized in the module name) is executed in order to implement, or the operation for which ADT that relational module is executed when have carried out. The module calling trigger represents a trigger when the relational module is executed in order to implement the user-defined index 41. If a module calling trigger is provided for implementing the behaviour of the ADT by the relational module, i.e., if the module calling trigger is provided for implementing the ADT function, which is clearly described in the query request (SQL statement) issued from an end user, by the relational module then "AS_FUNCTION" is set in the module calling trigger along with the specification by an end user. When "AS_FUNCTION" is set in the module calling trigger, the name of the ADT function for executing the module of interest is shown in the executed ADT function name. When "AS.sub.--KEY _CREATION" is specified as the module calling trigger to the module definition information 3 from a registering user, "AS_KEY_CREATION" is set in the module calling trigger of the ADT module definition information 54b, and also the index type id showing an index of which index type the index key creation module is provided for is set in the index type id. In addition, by modifying not only the index type names and the indexes id of the index type definition information 51 and the index definition information 52, but also the module name and the index id of the module definition information 54, the module which is executed for the specific ADT function name can be modified to modify the contents of the database processing. Next, the description will hereinbelow be given with respect to the processing for the procedures to add and to create a new index shown in FIG. 3 with reference to flow charts shown in FIGS. 7 to 9. FIG. 7 is a flow chart of a typical flow showing the processing procedure of processing the definition of an index type in the present embodiment. As shown in FIG. 7, in the processing of the definition of an index type according to the present embodiment, there is shown an example of a typical flow of the processing of procedure 301 of the definition of an index type, which processing is executed by the definition processing unit 80. First of all, in Step 811, the index type id for recognizing the index type is determined for the index type name which has been inputted from a registering user to be assigned thereto. Then, the index type information entries 511 (refer to FIG. 4) are created on the basis of the index type id thus determined and the user input information, and then they are registered in the dictionary 5 (Step 812). In response to a request issued from the definition processing unit 80, the dictionary management unit 90 carries out the registration of the index type information entries 511 in the dictionary 5. Next, likewise, the index key information entries 512 are created using the index type id to be registered in the dictionary 5 (Step 813). In the example shown in FIG. 3, the index type "890" is, for example, assigned to the index type DOC-INDEX which has been specified by a registering user. In addition, since it is specified that the data type of the index key is VARCHAR alone, first of all, the index type information entry 511 as shown hereinbelow is created to be registered in the dictionary 5 as shown in FIG. 4. Index name: DOC-INDEX Index type id: 890 The number of index keys: 1 Since with respect to the index key information 51b, the specified length of the VARCHAR is 32,000 and the number of specifications of the index keys is one, the following index key information entry 512 in which the specified number is also one is created to be registered in the dictionary 5 as shown in FIG. 4. Index type id: 890 Data type: VARCHAR Defined length: 32,000 Specified number: 1 FIG. 8 is a flow chart of a typical flow showing the processing procedure of processing the registration of module definition information in the present embodiment. As shown in FIG. 8, in the processing of the registration of a module definition information of the present embodiment, there is shown a typical flow of the processing in the module definition information registration unit 70 for implementing both procedure 302 of the registration of index implementation module definition information and procedure 304 of the registration of ADT implementation module definition information which procedures 302 and 304 were previously described with reference to FIG. 3. First of all, in Step 71, it is judged whether the module definition information 3 which has been inputted from a registering user who adds the user-defined index 41 is definition information of the index module or definition information of the ADT module. Then, when it is judged in Step 71 that the inputted module definition information 3 is definition information of the index module, the processing proceeds to Step 72. Then, reference is made of the index type information 51a which is stored in the dictionary 5, and the index type id is obtained from the index type name which a registering user has specified on the basis of the module definition information 3. Thereafter, the index module definition information entries 541 are created on the basis of that index type id and the user input information and then they are registered in the dictionary 5 (Step 73), thereby completing the processing (Step 78). On the other hand, when it is judged in Step 71 that the inputted module definition information 3 is the definition information of the ADT module, the processing proceeds to the module calling trigger judgement processing in Step 74. Then, it is judged whether the module trigger specification from a registering user is "AS_FUNCTION" specification, "AS_KEY_CREATION" specification or other specification. When it is judged in Step 74 that the module trigger specification from a registering user is "AS_FUNCTION" specification, the name of the ADT function which is implemented by the module of interest is held in order to create the module definition information entries (Step 76), and then the processing proceeds to Step 77. When it is judged in Step 74 that the module trigger specification from a registering user is "AS_KEY_CREATION" specification, reference is made of the index type information 51a which is stored in the dictionary 6, and the index type id is obtained from the index type name which a registering user has specified on the basis of the module definition information 3 to be held (Step 75), and then the processing proceeds to Step 77. On the other hand, when it is judged in Step 74 that the module trigger specification from a registering user is a specification other than "AS_FUNCTION" specification and "AS_KEY_CREATION" specification, the processing proceeds directly to Step 77. In Step 77, the ADT module definition information entries 542 are created on the basis of the information which is previously held in Step 75 or Step 76, and then they are registered in the dictionary 5, thereby completing the processing (Step 78). The ADT function name which is previously held in the executed ADT function name is set in the entry in which the module calling trigger is "AS_FUNCTION". In addition, the index type id which is previously held in the index type id is set in the entry in which the module calling trigger is "AS_KEY_CREATION". Then, the dictionary management unit 90 carries out a registration in the dictionary 5 for another. FIG. 9 is a flow chart of a typical flow showing the processing procedure of processing the definition of an index according to the present embodiment. As shown in FIG. 9, in the processing of the definition of an index in the present embodiment, there is shown an example of a typical flow of the processing of the definition of an index (procedure 306) in the definition processing unit 80. First of all, in Step 821, the index id used to recognize the index is determined to be assigned to the index name which has been inputted from a registering user. Then, the index definition information entries 521 are created on the basis of the index id of interest and the user input information and then they are registered in the dictionary 5 (Step 822). In response to a request issued from the definition processing unit 80, the dictionary management unit 90 carries out the registration of the index definition information entries 521 in the dictionary 5. Likewise, the data information entries 522 for index key creation are created on the basis of the information (user input information) for use in access to the table data 42 which is required for creating the index id and the index, and then they are registered in the dictionary 5 (Step 823). The data information entries 522 for index key creation are created for the number of data for key creation within each of the index definition information entries 521. Then, the order number of the data for index key creation which is described with "CREATE INDEX statement" is set in the specified number within each of the entries. Next, the ADT function information entries 523 for an index access are created using the specified ADT function name as the interface through which the index id and the index are used and then they are registered in the dictionary 5 (Step 824), thereby completing the processing (Step 825). The ADT function information entries 523 for an index access are also created for the number thereof which has been specified in "CREATE INDEX statement". Incidentally, in the example shown in FIG. 3, the number of entries relating to the index DOC-INDEX is only one containing the ADT function name "CONTAINS". FIG. 10 is a flow chart of a typical flow showing the processing procedure of the ADT function analysis processing according to the present embodiment. As shown in FIG. 10, in the ADT function analysis processing of the present embodiment, there is shown an example of a typical flow of the analysis processing relating to the ADT function when the ADT function comes out in the user requests (SQL statement) in the query analysis processing unit 10. First of all, in Step 12, by using the ADT function name as an object of analysis, and the table name and the column name to which the ADT function of interest is applied, the ADT function information entries 523 for an index access, the index definition information entries 521 and the data information entries 522 for creating the relational index key which entries 523, 521 and 522 are stored in the dictionary 5 are obtained. Next, it is judged whether or not the relational entry is present in the dictionary 5, i.e., the obtained entry was present therein (Step 13). Then, when it is judged in Step 13 that the relational index definition information 52 is present in the dictionary 5, by using the index which is recognized on the basis of the index id of the obtained information, it is determined to use the access path used to implement the required ADT function (Step 14). Next, in Step 15, the module execution information for an index retrieval is obtained, as the information used to access to the index the use of which has been determined, from the index module definition information 54a stored in the dictionary 5 using the index type id (in the associated index definition information entry 521). Then, in Step 18, by using the index id of the index the use of which has been determined and the module information (module name) for use in implementation of the access to the index of interest, the internal processing code for an index access is created, thereby completing the processing (Step 19). On the other hand, when it is judged in the judgement processing of Step 13 that the corresponding index definition information 52 is absent, no index is used, but the access path is determined through which the ADT function implementation module is executed for one table data to implement the ADT function (Step 16). Then, in Step 17, the ADT function implementation module information is obtained using the ADT function name, and the internal processing code for the database processing is created using the information of interest (module name)(Step 18). In accordance with the instruction of the created internal processing code for the database processing, in the database calculation processing unit 20, the user definition index management unit 30 executes the database processing in cooperation with the table data management unit 40. FIG. 11 is a flow chart of a typical flow showing the processing procedure of the index processing according to the present embodiment. As shown in FIG. 11, in the index processing of the present embodiment, there is shown the processing in the user definition index management unit 30. More specifically, there is shown an example of the index processing in the user-defined index management unit 30 when receiving the request issued from the database calculation processing unit 20. First of all, in Step 301, it is judged whether the processing request issued from an end user is the index retrieval request or the index update request. When it is judged in Step 301 that the processing request is the index retrieval request, the processing proceeds to Step 310, and then information for executing the module used to implement the index retrieval is obtained. Thereafter, the index retrieval module is executed on the basis of that information to carry out the index retrieval (Step 311). The result of retrieving the index is returned back to the database calculation processing unit 20 (Step 312), thereby completing the processing (Step 309). On the other hand, when it is judged in Step 301 that the processing request is the update processing, the preparation of the data used to update the index is carried out as the preliminary preparation for the processing of updating the index. As for the input data for the processing of updating the index, there are the input data which is created using the key creation module which is specified in the ADT module definition information 54b by a registering user, and the input data to which the data, which has been obtained by making reference to the table data 42, is directly applied. Then, in Step 302, the judgement between the two kinds of input data is determined on the basis of whether or not the module definition information 54 for executing the key creation module is present in the dictionary 5. When it is determined in Step 302 that the relational key creation module execution information is present in the dictionary 5, that information is obtained (Step 303), and then the key creation module is executed using that information thus obtained to create the key (Step 304). Then, the key thus created is specified as the input key for the index update (Step 305). On the other hand, when it is determined in Step 302 that the relational key creation module execution information is absent in the dictionary 5, the data of the update table data is specified as the key for index update (Step 306). Next, in Step 307, the information used to execute the index update module is obtained. Then, by using the above-mentioned specified key for index update, the index update module is executed to update the index (Step 308). Next, under the structure previously described with reference to FIG. 1 and the definition of the database of FIG. 3 (adding of the user-defined index 41), the description will hereinbelow be given with respect to the database processing employing a user-defined index by using a concrete command example. First of all, the description will now be given by taking the following update request (SQL statement) issued from an end user as an example.
INSERT INTO movies_lib
VALUES ("independence day", 12, 1996,
TEXT (8734, "ID4", "Mr. X", text_v),
contents_v)
In this connection, the ADT function TEXT is the function for creating the ADT data (instance), i.e., the constructor function and creates the TEXT type data with a text number (8734), a text name ("ID4"), an author ("Mr. X"), and the contents of the text (VARCHAR type data represented by a variable text_v) as arguments. In the above-mentioned example of the SQL statement, there is shown the request of inserting into movies_lib table, the data having, as values, the BLOB type data which is represented in the form of title (title): "independence day", country (production country code): 12, produce_year (production year): 1996, guide (explanation): TEXT type data (created by the constructor function), movie_contents (picture): variable contens_v. In addition, the code 12 which is specified in the country column is a code representing the production country U.S.A. The maintenance of the user-defined index is carried out in the user-defined index management unit 30 in conjunction with insertion of the table data 42 in accordance with the flow chart shown in FIG. 11. As shown in FIG. 5, since the index DOC-SEARCH is created in the index definition information 52a of movies_lib table, a processing of updating the index DOC-SEARCH is executed. First of all, the contents attribute data in the guide column is prepared as the data for index key creation on the basis of the data information 52b for index key creation. Then, the p_text_key_create module which is represented by the ADT module definition information 54b (refer to FIG. 6) is executed with the prepared data as an input to create the index key for use in update of DOC-SEARCH index. The index key thus created is the VARCHAR type data which is 32,000 in definition length. Next, the module _p_doc_insert which is represented by the module calling trigger of AS_INDEX_INSERT in the index module definition information 54a is executed with the created index key as an input, thereby executing the index update processing (refer to FIG. 6). Next, the description will hereinbelow be given by taking the retrieval request (SQ statement) issued from an end user as an example. "SELECT title, movie_contents FROM movies_lib WHERE CONTAINS (guide, "independence")". Now, the function CONTAINS is the function of returning TRUE (BOOLEAN type) in the case where the word which is specified by a second parameter is contained in the specified ADT data as a first parameter. In the above-mentioned example of the SQL statement, there is shown the retrieval request of fetching title (title) and movie_contents (picture) of the table data in which "independence" is contained in the guide column (explanation) of movies_lib table. In the query analysis processing unit 10, the implementation of the ADT function is determined by using the index DOC-SEARCH which is of a DOC-INDEX user-defined index type in accordance with the flow of the flow chart shown in FIG. 10. Then, the index retrieval module _p_text_contents is executed so that the table data 42 is established as the retrieval result, and the values of title and movie_contents as the fetching column specified by the table data management unit 40 are returned as the query result back to an end user. The processing of the flow chart which has hereinabove been shown is executed in the form of a program in the computer system 1000 which is given as an example. However, such a program is not limited to the program stored in only the external memory 1003 which is physically, directly connected to the computer system 1000 as shown in FIG. 2. That is, such a program may be stored in the storage medium, from/to which it can be read out/written, such as a hard disk device, a floppy disk device, a cassette streamer, or a DAT which is not physically, directly connected to the computer system 1000. Of course, the form of a program which is stored from the external in the memory of the computer for implementing the present invention is also included in the present invention. As set forth hereinabove, according to the database processing method and the system of the present invention, in the case where the user-defined function in processing request is the function which is defined in the index definition information, since the implementation module corresponding to the above-mentioned user-defined function is executed to carry out the index access, the general database processing can be executed independent of a specific user-defined function. In addition, according to the database processing of the present embodiment, a plurality of different user definition functions are set in correspondence to the specific index by using the index definition information, whereby a plurality of different user-defined functions hold in common the implementation module by which the data of the database region is subjected to the specific processing. As a result, it is possible to make the implementation module for use in a specific index access independent of the user-defined function. In addition, according to the database processing of the present embodiment, both the index definition and the module definition information are modified, whereby the implementation module which is set in correspondence to the specific user-defined function is modified. Therefore, it is possible to self-contain only the required implementation module. Although the present invention has been specifically described with reference to the above-mentioned embodiments, it is to be understood that the present invention is not limited to the above-mentioned embodiments, and hence the various changes and modifications will occur to those skilled in the art without departing from the scope and true spirit of the present invention. The scope of the invention is therefore to be determined solely by the appended claims.
|
Same subclass Same class Consider this |
||||||||||
