KR20000038104A - Method for generating subquery for global query in multi-database system - Google Patents

Method for generating subquery for global query in multi-database system Download PDF

Info

Publication number
KR20000038104A
KR20000038104A KR1019980052966A KR19980052966A KR20000038104A KR 20000038104 A KR20000038104 A KR 20000038104A KR 1019980052966 A KR1019980052966 A KR 1019980052966A KR 19980052966 A KR19980052966 A KR 19980052966A KR 20000038104 A KR20000038104 A KR 20000038104A
Authority
KR
South Korea
Prior art keywords
global
list
information
query
clause
Prior art date
Application number
KR1019980052966A
Other languages
Korean (ko)
Other versions
KR100283614B1 (en
Inventor
정승욱
문희철
우훈식
주경준
박상봉
Original Assignee
정선종
한국전자통신연구원
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 정선종, 한국전자통신연구원 filed Critical 정선종
Priority to KR1019980052966A priority Critical patent/KR100283614B1/en
Publication of KR20000038104A publication Critical patent/KR20000038104A/en
Application granted granted Critical
Publication of KR100283614B1 publication Critical patent/KR100283614B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

PURPOSE: A method for generating a subquery for a global query in a multi-database system, is provided to obtain data of desired through a query result transmitted from a subquery hereafter, by perfectly reflecting data demanded by the global query on every subquery without loss. CONSTITUTION: A method for generating a subquery for a global query in a multi-database system, connected through many local databases and networks, comprises the steps as follows. In a first step, table information in a from-passage from a parsing result of the global query is added to a global table list, projection information in a select-passage of the global query is added to a projection list, and then whether a where-passage exists in the global query is confirmed. In a second step, when a where-passage exists in the first step, table information having the where-passage is added to the global table list, and then join-field is added to a selection list. In a third step, when a where-passage doesn't exist in the first step, join field is added to the selection list. In a fourth step, whether an alias in the selection is coinciding with an alias in the global table is confirmed. In a fifth step, local data information corresponding to an alias and field information in the projection list is searched in mapping information only in case of coincidence in the fourth step, and the alias and field information in the projection list are added to a select and from-passage corresponding to the searched area database.

Description

멀티데이타베이스 시스템에서의 글로벌 질의에 대한 부질의 생성방법(The subquery generation method in a Multidatabase System)The subquery generation method in a multidatabase system

본 발명은 멀티데이타베이스(multidatabase) 시스템에서의 글로벌 질의로부터 부질의를 생성하는 방법에 관한 것으로, 더욱 자세하게는 멀티데이타베이스 시스템에서 글로벌 질의에서 요구한 데이타가 손실됨이 없이 각 부질의에 충실히 반영되도록 하여, 차후 부질의로부터 전달된 질의 결과를 통해 원하는 데이타를 얻을 수 있는 글로벌 질의로부터의 부질의 생성방법에 관한 것이다.The present invention relates to a method for generating a subquery from a global query in a multidatabase system. More particularly, the present invention faithfully reflects each subquery without losing data required by a global query in a multidatabase system. Preferably, the present invention relates to a method of generating a subquery from a global query that can obtain desired data through a query result transmitted from a subquery later.

멀티데이타베이스 시스템은 이미 존재하는 여러 개의 이질적인 데이타베이스 시스템을 논리적으로 통합하여 사용자에게 단일한 뷰(view)를 제공하는 분산 데이타베이스 시스템의 일종이다. 이때, 멀티데이타베이스에 참여하는 데이타베이스를 지역(local) 데이타베이스라고 한다. 사용자는 글로벌 질의를 통해 멀티데이타베이스 시스템에 저장된 자료를 검색하며, 멀티데이타베이스 시스템은 제출된 글로벌 질의를 분해하여 실제 데이타를 가지고 있는 지역 데이타베이스로 전달한다. 지역 데이타베이스는 질의에 대한 수행 결과를 멀티데이타베이스 시스템으로 반환하고, 멀티데이타베이스는 질의 결과를 통합하여 사용자에게 출력한다. 글로벌 질의를 부질의로 분해하는 과정에서 분해된 부질의가 글로벌 질의가 요구하는 데이타를 나타낼 수 없게 되는, 즉 데이타 손실이 발생될 수 있다.Multidatabase systems are a type of distributed database system that provides a single view to a user by logically integrating several heterogeneous database systems that already exist. At this time, the database participating in the multidatabase is called a local database. The user retrieves the data stored in the multidatabase system through the global query, and the multidatabase system decomposes the submitted global query and delivers it to the local database with the actual data. The local database returns the execution result of the query to the multidatabase system, and the multidatabase integrates the query result and outputs it to the user. In the process of decomposing a global query into a subquery, the decomposed subquery may not represent the data required by the global query, that is, data loss may occur.

따라서, 본 발명은 멀티데이타베이스 시스템에서 표준 글로벌 질의(global query)를 각 지역 데이타베이스로 전달할 부질의(subquery)로 변환함에 있어, 글로벌 질의에서 요구한 데이타가 손실됨이 없이 각 부질의에 충실히 반영되도록 하여, 차후 부질의에 대한 응답으로 전달된 질의 결과로부터 원하는 데이타를 얻을 수 있도록 하기 위한 글로벌 질의에 대한 부질의 생성방법을 제공하는데 그 목적이 있다.Therefore, in the present invention, in converting a standard global query into a subquery to be delivered to each local database in a multidatabase system, the present invention faithfully adheres to each subquery without losing data required by the global query. The purpose of the present invention is to provide a method for generating a subquery for a global query so that desired data can be obtained from a query result delivered in response to a subquery in the future.

도1은 멀티데이타베이스 시스템의 일반적인 구조를 나타낸 도면.1 shows a general structure of a multidatabase system.

도2는 본 발명에 따른 글로벌 질의로부터 부질의를 생성하는 흐름도.2 is a flow chart for generating a subquery from a global query in accordance with the present invention.

상기 목적을 달성하기 위한 본 발명에 따른 방법은, 다수개의 지역 데이타베이스와 네트워크를 통해 연결된 멀티데이타베이스 시스템에서의 글로벌 질의에 대한 부질의 생성방법에 있어서, 글로벌 질의의 파싱 결과로부터 글로벌 질의의 from절에 있는 테이블 정보를 글로벌 테이블 리스트에 추가하고, 글로벌 질의의 select절에 있는 프로젝션(projection) 정보를 프로젝션 리스트에 추가한 다음, 글로벌 질의에 where절이 존재하는지 확인하는 제1단계; 상기 제1단계에서 where절이 존재하면 where 절에 있는 테이블 정보를 글로벌 테이블 리스트에 추가한 다음, join 필드를 실렉션(selection) 리스트에 추가하는 제2단계; 상기 제1단계에서 where절이 존재하지 않으면 join 필드를 실렉션(selection) 리스트에 추가하는 제3단계; 상기 제3단계 수행 후, 프로젝션 리스트에 있는 엘리어스(alias)가 글로벌 테이블에 있는 테이블의 엘리어스와 일치하는지 확인하는 제4단계; 및 상기 제4단계에서 일치하는 경우에 대해서만 프로젝션 리스트에 있는 엘리어스와 프로젝션 리스트에 있는 필드정보에 해당되는 지역 데이타베이스 정보를 매핑 정보에서 검색하여, 찾은 지역 데이타베이스에 해당되는 부질의의 select와 from절에 프로젝션 리스트에 있는 엘리어스와 필드정보를 추가하는 제5단계를 포함한 것을 특징으로 한다.The method according to the present invention for achieving the above object is a method for generating a subquery for a global query in a multi-database system connected through a plurality of local databases and a network, the global query from the result of parsing the global query from Adding table information in the clause to the global table list, adding projection information in the select clause of the global query to the projection list, and then checking whether the where clause exists in the global query; A second step of adding table information in the where clause to the global table list and then adding a join field to the selection list if the where clause exists in the first step; A third step of adding a join field to a selection list if the where clause does not exist in the first step; A fourth step of checking whether an alias in a projection list matches an alias of a table in a global table after performing the third step; And searching the mapping information for local database information corresponding to the alias information in the projection list and the field information in the projection list only in the case of matching in the fourth step, and selecting and from the subquery corresponding to the found local database. Clause includes a fifth step of adding aliases and field information in the projection list.

또한, 본 발명에 따른 기록매체는, 다수개의 지역 데이타베이스와 네트워크를 통해 연결된 멀티데이타베이스 시스템에서의 글로벌 질의로부터 부질의를 생성하는 기능을 수행하기 위한 컴퓨터로 읽을 수 있는 기록매체에 있어서, 글로벌 질의의 파싱 결과로부터 글로벌 질의의 from절에 있는 테이블 정보를 글로벌 테이블 리스트에 추가하고, 글로벌 질의의 select절에 있는 프로젝션(projection) 정보를 프로젝션 리스트에 추가한 다음, 글로벌 질의에 where절이 존재하는지 확인하는 제1단계; 상기 제1단계에서 where절이 존재하면 where 절에 있는 테이블 정보를 글로벌 테이블 리스트에 추가한 다음, join 필드를 실렉션(selection) 리스트에 추가하는 제2단계; 상기 제1단계에서 where절이 존재하지 않으면 join 필드를 실렉션(selection) 리스트에 추가하는 제3단계; 상기 제3단계 수행 후, 프로젝션 리스트에 있는 엘리어스(alias)가 글로벌 테이블에 있는 테이블의 엘리어스와 일치하는지 확인하는 제4단계; 및 상기 제4단계에서 일치하는 경우에 대해서만 프로젝션 리스트에 있는 엘리어스와 프로젝션 리스트에 있는 필드정보에 해당되는 지역 데이타베이스 정보를 매핑 정보에서 검색하여, 찾은 지역 데이타베이스에 해당되는 부질의의 select와 from절에 프로젝션 리스트에 있는 엘리어스와 필드정보를 추가하는 제5단계를 실행시키기 위한 프로그램이 기록된 것을 특징으로 한다.In addition, the recording medium according to the present invention is a computer-readable recording medium for performing a function of generating a subquery from a global query in a multi-database system connected through a plurality of local databases and a network. From the parsing result of the query, add the table information in the from clause of the global query to the global table list, add the projection information in the select clause of the global query to the projection list, and then check if the where clause exists in the global query. The first step to do; A second step of adding table information in the where clause to the global table list and then adding a join field to the selection list if the where clause exists in the first step; A third step of adding a join field to a selection list if the where clause does not exist in the first step; A fourth step of checking whether an alias in a projection list matches an alias of a table in a global table after performing the third step; And searching the mapping information for local database information corresponding to the alias information in the projection list and the field information in the projection list only in the case of matching in the fourth step, and selecting and from the subquery corresponding to the found local database. The program is recorded in the section for executing the fifth step of adding aliases and field information in the projection list.

이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 실시예를 상세히 설명한다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도1은 멀티데이타베이스 시스템의 일반적인 구조를 나타낸 것으로, 멀티데이타베이스 시스템은 다수개의 지역 데이타베이스와 네트워크를 통해 연결되어 데이타를 억세스한다. 그리고, 멀티데이타베이스 시스템은 상기 네트워크에 연결되어 다수개의 지역 데이타베이스에 부질의를 송출하여 그에 대한 질의 결과를 입력받는다. 그리고, 각 지역 데이타베이스로부터 입력된 질의 결과를 통합하여 사용자나 관리자에게 제공한다.1 illustrates a general structure of a multidatabase system. A multidatabase system is connected to a plurality of local databases and a network to access data. In addition, the multi-database system is connected to the network and sends a subquery to a plurality of local databases and receives a query result therefor. Then, the query results input from each local database are integrated and provided to the user or administrator.

도2는 본 발명에 따른 글로벌 질의로부터 부질의를 생성하는 흐름도를 나타낸다.2 shows a flowchart for generating a subquery from a global query according to the present invention.

본 발명에 따른 글로벌 질의로부터 부질의를 생성하는 방법은 파싱 결과로부터 글로벌 질의의 from절에 있는 테이블 정보를 글로벌 테이블 리스트에 추가한다(101). 그리고 글로벌 질의의 select절에 있는 프로젝션(projection) 정보를 프로젝션 리스트에 추가한다(102). 그런 다음, 글로벌 질의에 where절이 존재하면(103) where 절에 있는 테이블 정보를 글로벌 테이블 리스트에 추가한 다음(104), join 필드를 실렉션(selection) 리스트에 추가한다(105). 한편, where 절이 존재하지 않으면(103), join 필드를 실렉션(selection) 리스트에 추가하는(105) 과정만 수행한다.The method for generating a subquery from the global query according to the present invention adds the table information in the from clause of the global query to the global table list from the parsing result. The projection information in the select clause of the global query is added to the projection list (102). Then, if there is a where clause in the global query (103), the table information in the where clause is added to the global table list (104), and then the join field is added to the selection list (105). On the other hand, if the where clause does not exist (103), only the process of adding the join field to the selection list (105) is performed.

이러한 과정을 통해 글로벌 테이블을 구성한 다음에, 글로벌 테이블에 있는 각 테이블에 다음과 같은 과정을 수행한다.After constructing a global table through this process, the following process is performed on each table in the global table.

프로젝션 리스트에 있는 엘리어스(alias)(A)가 글로벌 테이블에 있는 테이블(T)의 엘리어스와 일치하는지 확인한다(106). 확인 결과, 일치하는 경우에 대해서만 프로젝션 리스트에 있는 엘리어스(A)와 프로젝션 리스트에 있는 필드정보(F)에 해당되는 지역 데이타베이스 정보를 매핑 정보에서 검색한다(107). 그리고, 찾은 지역 데이타베이스에 해당되는 부질의의 select와 from절에 프로젝션 리스트에 있는 엘리어스(A)와 필드정보(F)를 추가한다(108). 한편, 프로젝션 리스트에 있는 엘리어스(alias)(A)가 글로벌 테이블에 있는 테이블(T)의 엘리어스와 일치하지 않으면 바로 부질의로서 송출한다. 이러한 과정을 통해 글로벌 질의로부터 부질의를 생성하여 각 지역 데이타베이스로 송출하게 된다.Check that the alias A in the projection list matches the alias of table T in the global table (106). As a result of the check, only the case where there is a match, the local database information corresponding to the alias A in the projection list and the field information F in the projection list is searched in the mapping information (107). Then, add aliases (A) and field information (F) in the projection list to the select and from clauses of the subquery corresponding to the found local database (108). On the other hand, if the alias A in the projection list does not match the alias of the table T in the global table, it is sent as a subquery. Through this process, subqueries are generated from global queries and sent to each local database.

상기와 같은 본 발명의 동작을 구체적인 예를 들어 설명하면 다음과 같다.Referring to the operation of the present invention as a specific example as follows.

글로벌 질의가 제출되면 먼저 제출된 글로벌 질의를 파싱(parsing)해야 하며, 파싱된 글로벌 질의를 매핑정보와 함께 분석하여 해당 지역 데이타베이스에 전달할 부질의를 생성해야 한다. 매핑정보란 어떤 테이블의 어떤 필드가 지역 데이타베이스에서 어떤 테이블의 어떤 필드에 대응하는지를 알려주는 정보이다.When a global query is submitted, the submitted global query must be parsed first, and the parsed global query must be analyzed along with the mapping information to create a subquery to be delivered to the local database. Mapping information is information that indicates which field of a table corresponds to which field of a table in the local database.

하나의 글로벌 질의가 여러 개의 부질의로 나뉘어 각각의 지역 데이타베이스로 전달되어야 함은 명확하다. 그러나, 각각의 지역 데이타베이스에 하나씩만의 부질의로 글로벌 질의의 목적을 달성 할 수 있는 것은 아니다.It is clear that a global query must be broken up into several subqueries and sent to each local database. However, only one subquery in each local database can achieve the purpose of a global query.

다음의 예를 생각해 보자.Consider the following example.

두 개의 데이타베이스 중 DB1은 표1 및 표2에 나타낸 바와 같은 임의의 두개의 테이블을 가지고 있고, DB2는 표3 및 표4에 나타낸 바와 같은 임의의 두개의 테이블을 가지고 있다고 가정한다.Assume that DB1 of any two databases has any two tables as shown in Tables 1 and 2, and DB2 has any two tables as shown in Tables 3 and 4.

Empolyee TableEmpolyee table IDID namename AgeAge 1One JamesJames 3030 22 JohnJohn 4444

Professor TableProfessor Table IDID namename AgeAge 33 TomTom 3535 44 KimKim 5555

Empolyee TableEmpolyee table IDID namename AgeAge 1111 ParkPark 6060 1212 BillBill 1010

Professor TableProfessor Table IDID namename AgeAge 33 TomTom 3535 1414 LillyLilly 2020

그리고, 하나의 글로벌 질의문이 다음과 같이 제출되었다고 하자.And suppose a global query is submitted as follows:

Select p.name, e.nameSelect p.name, e.name

From Professor p, Empolyee eFrom Professor p, Empolyee e

Where p.age < e.ageWhere p.age <e.age

양쪽의 데이타베이스(DB)의 테이블이 똑같으므로 특별히 분절화 할 것이 없어서, 만약 이 문장을 각각의 DB에 똑같이 보낸다면, 데이타베이스 A로부터는 (Tom,John)의 결과가, 데이타베이스 B로부터는 (Tom,Park), (Lilly,Park)의 결과가 나올 것이다.Since the tables in both databases are identical, there is no special fragmentation, so if you send this statement equally to each DB, the result of (Tom, John) from database A will be (from database B) Tom, Park) and (Lilly, Park).

하지만, 이 결과에서는 뜻하지 않은 데이타 손실이 생겼다. 즉, (Lilly,James), (Lilly,John), (Kim,Park)이라는 결과는 얻을 수가 없다. 그러나, 이 양쪽의 데이타베이스들은 통합되었으므로, 이러한 결과를 생성하여야 한다. 그런데 결과를 살펴보면, 두 개의 테이블에 걸쳐져 있는 질의문의 경우 각기 다른 DB에 위치한 테이블들의 내용이 모아지지 않았음을 알 수 있다.However, this resulted in unexpected data loss. That is, (Lilly, James), (Lilly, John), (Kim, Park) results are not obtained. However, since both databases are integrated, you should generate these results. However, looking at the results, it can be seen that the contents of tables located in different DBs were not collected in the case of a query that spans two tables.

이와 같은 데이타 손실은 지역 데이타베이스에서는 처리할 수 없다. 왜냐하면, 다른 DB에 어떤 내용이 저장되어 있는지 알 수 없기 때문이다. 따라서, 이러한 경우에는 멀티 데이타베이스에서 결과를 수집하여 가능한 조합을 시험해 보는 게 가장 타당한 방법이다.Such data loss cannot be handled by local databases. Because you can't know what is stored in other DB. Therefore, in this case, it is best to collect the results from multiple databases and test the possible combinations.

결국 멀티 데이타베이스는 우선 각 지역 데이타베이스로부터 각각의 테이블들을 하나로 모은 글로벌 테이블들을 만들어야 한다. 그리고, 이 글로벌 테이블들로부터 질의를 만족하는 모든 가능한 결과를 추출하여야 한다.After all, multi-databases must first create global tables that aggregate the tables from each local database. And we need to extract all possible results that satisfy the query from these global tables.

표5 및 표6은 위의 예제 테이블을 이용하여 글로벌 테이블를 작성한 것이다.Tables 5 and 6 create a global table using the example table above.

Empolyee TableEmpolyee table IDID namename AgeAge 1One JamesJames 3030 22 JohnJohn 4444 1111 ParkPark 6060 1212 BillBill 1010

Professor TableProfessor Table IDID namename AgeAge 33 TomTom 3535 44 KimKim 5555 1414 LillyLilly 2020

이와 같이 글로벌 테이블을 작성한 후, 가능한 한 모든 조합을 만들어 글로벌 질의의 Where절의 조건과 비교한다. 이러한 비교를 통해 위의 예에서 발생한 데이타의 손실을 방지할 수 있다. 이러한 방법의 단점은 모든 작업을 지역 데이타베이스에게 수행할 때보다 멀티 데이타베이스의 작업 부담이 늘어난다는 것이다.After creating a global table like this, all possible combinations are created and compared with the conditions in the Where clause of the global query. This comparison prevents the loss of data in the example above. The disadvantage of this approach is that the work load on the multi-database is higher than when all the work is done to the local database.

결론적으로 글로벌 질의를 분할하는 과정에서는 From절에 나타난 모든 테이블들을 각각의 지역 데이타베이스로부터 통합하는 작업을 해야 한다. 이렇게 만들어진 테이블들로부터 결과를 추출해 내는 일은 후술하는 부분 결과의 통합에서 행해져야 한다.In conclusion, the process of partitioning a global query requires merging all the tables in the From clause from each local database. Extracting results from these tables should be done in the integration of the partial results described below.

이 예에서처럼 중간단계의 글로벌 테이블을 만들기 위해 글로벌 질의는 다음과 같이 분할되어야 한다.To create an intermediate global table, as in this example, the global query must be partitioned as follows:

DBA DB A

- 1. Select p.id, p.name, p.age From Professor p-1.Select p.id, p.name, p.age From Professor p

- 2. Select e.id, e.name, e.age From Employee e-2.Select e.id, e.name, e.age From Employee e

DBB DB B

- 1. Select p.id, p.name, p.age From Professor p-1.Select p.id, p.name, p.age From Professor p

- 2. Select e.id, e.name, e.age From Employee e-2.Select e.id, e.name, e.age From Employee e

각각의 DB로 위에서 생성된 부질의가 보내진다. DBA의 첫 번째 부질의의 결과는 DBB의 첫 번째 부질의의 결과와 통합되어야 하고, DBA의 두 번째 부질의의 결과는 DBB의 두 번째 부질의와 통합되어야 한다. 그리고, 이렇게 통합된 결과들은 최종적으로 'Where e.age > p.age'의 조건으로 비교되어야 한다.The subquery created above is sent to each DB. The first results of the second DB A subquery is the result of two of the first subquery of the first to be integrated with the results of the first subquery, and the DB A DB B should be integrated with the second-vain of the DB B. Finally, these integrated results should be compared on the condition of 'Where e.age>p.age'.

위의 예제의 경우를 좀더 일반적인 경우로 확장시키면 다음과 같다.The above example can be extended to the more general case as follows.

DB1에서 DBm까지 m개의 지역 데이타베이스가 있다고 가정하자. 또, 글로벌 테이블 이름 Ti에 대해서 DBk에서의 지역 테이블 이름을 Ak(Ti)라고 하자. 마찬가지로, 어떤 글로벌 테이블 Ti의 글로벌 필드명 fj의 DBk에서의 지역 필드 이름을 Ak(fj)라고 하자. 위에서 설명한 분할 규칙은 다음과 같이 쓰일 수 있다.Suppose there are m local databases from DB 1 to DB m . Also, suppose that the local table name in DB k is A k (T i ) for the global table name T i . Similarly, suppose the local field name in DB k of the global field name f j of a global table T i is A k (f j ). The division rule described above can be written as follows.

Global QueryGlobal Query

- Select t1.f1, t1.f2, ... tn.fk -Select t 1 .f 1 , t 1 .f 2 , ... t n .f k

From T1t1, T2t2, ... Tntn From T 1 t 1 , T 2 t 2 , ... T n t n

Where ...Where ...

SubQueriesSubQueries

DB1 DB 1

- Q1: Select t1'.A1(f1), t1'.A1(f2), ... From A1(T1) t1'-Q 1 : Select t 1 '.A 1 (f 1 ), t 1 ' .A 1 (f 2 ), ... From A 1 (T 1 ) t 1 '

- Q2: Select t2'.A1(f1), t2'.A1(f2), ... From A1(T2) t2'-Q 2 : Select t 2 '.A 1 (f 1 ), t 2 ' .A 1 (f 2 ), ... From A 1 (T 2 ) t 2 '

- Q3: ...-Q 3 : ...

DB2 DB 2

- Q1: Select t1'.A2(f1), t1'.A2(f2), ... From A2(T1) t1'-Q 1 : Select t 1 '.A 2 (f 1 ), t 1 ' .A 2 (f 2 ), ... From A 2 (T 1 ) t 1 '

- Q2: Select t2'.A2(f1), t2'.A2(f2), ... From A1(T2) t2'-Q 2 : Select t 2 '.A 2 (f 1 ), t 2 ' .A 2 (f 2 ), ... From A 1 (T 2 ) t 2 '

- Q3: ...-Q 3 : ...

DBm DB m

- Q1: Select t1'.Am(f1), t1'.Am(f2), ... From Am(T1) t1'-Q 1 : Select t 1 '.A m (f 1 ), t 1 ' .A m (f 2 ), ... From A m (T 1 ) t 1 '

- Q2: Select t2'.Am(f1), t2'.Am(f2), ... From Am(T2) t2'-Q 2 : Select t 2 '.A m (f 1 ), t 2 ' .A m (f 2 ), ... From A m (T 2 ) t 2 '

- Q3: ...-Q 3 : ...

그런데, 원래의 글로벌 질의의 Where절에 tj.fl이 들어가 있고, 이것이 글로벌 질의의 Select절에는 포함이 안되어 있다고 한다면, 각 DBkQj의 Select절에다가 tj'.Ak(fl)을 추가해 주어야 한다.By the way, there are in the Where clause of a query in the original global .f t j l into, if this is included in that afterwards the Select section in the global query, each DB k Q j of the Select section edaga t j '.A k (f l ) Should be added.

또한, 글로벌 테이블 작성을 위해 결과들을 합칠 때는 각 튜플의 값이 일치하는 가를 나타내기 위해 기준이 되는 키필드가 있어야 한다. 이를 위해 키필드에 해당되는 값은 반드시 부질의의 Select절에 포함되어야 한다. 결국 최종적인 부질의는 다음과 같은 형태가 된다.In addition, when merging the results to create a global table, there must be a key field as a reference to indicate whether the values of each tuple match. For this purpose, the value corresponding to the key field must be included in the select clause of the subquery. In the end, the final subquery looks like this:

DBk DB k

- Qi= Select ti'.Ak(fs) (ti.fsis in Select Clause of Global Query)Q i = Select t i '.A k (f s ) (t i .f s is in Select Clause of Global Query)

∪ ti'.Ak(fr) (ti.fris in Where Clause of Global Query)T i '.A k (f r ) (t i .f r is in Where Clause of Global Query)

∪ ti'.Ak(fy) (ti.fyis key of Global Table Ti)T i '.A k (f y ) (t i .f y is key of Global Table T i )

From Ak(Ti) ti'From A k (T i ) t i '

글로벌 테이블을 작성하는 방법은 다음과 같다.How to create a global table is as follows.

- Ti= ∪ Result Qiof DBk, 여기서 k = 1 ... mT i = ∪ Result Q i of DB k , where k = 1 ... m

다음은 위에서 설명한 알고리즘을 위해 사전에 준비해야 할 데이타를 나타낸 것이다. 글로벌 질의가 다음과 같이 제출되었다고 가정하자.The following shows the data to be prepared in advance for the algorithm described above. Suppose a global query is submitted as follows.

Select p.name From Person p, Child c Where c.father = p.nameSelect p.name From Person p, Child c Where c.father = p.name

① 우선 입력으로 들어오는 매핑 정보는 다음과 같이 구성된다. 이 매핑 정보는 위에서 설명한 Ak(fi)를 구현하기 위한 것이다. 하나의 글로벌 테이블의 글로벌 필드는 각각의 지역 데이타베이스에서 지역 테이블 이름과, 지역 필드 이름이 다를 수 있으므로, 동일한 글로벌 테이블, 필드를 가지고 여러 개의 튜플(Tuple)을 만들어 낼 수 있다. 이러한 매핑의 예는 다음의 표7과 같다.① Mapping information coming in first is composed as follows. This mapping information is for implementing A k (f i ) described above. Since a global field of one global table may have a different local table name and a local field name in each local database, multiple tuples can be generated with the same global table and field. Examples of such mappings are shown in Table 7 below.

글로벌 테이블 이름Global table name 글로벌 필드 이름Global field names 위치location 지역 테이블 이름Local table name 지역 필드 이름Region field name PersonPerson namename DB ADB A PERSONPERSON NMNM personperson namename DB BDB B PEOPLEPEOPLE P_NAMEP_NAME ...... ...... ...... ...... ......

또한 조인(join)할 때 필요한 키 필드들도 입력으로 주어져야 한다. 키 필드들은 각각의 글로벌 테이블별로 주어진다. 한 테이블의 키 필드는 여러 개일 수 있으며 표8과 같이 구성된다.Also, the key fields needed for joining should be given as input. Key fields are given for each global table. There can be several key fields in a table and they are organized as shown in Table 8.

글로벌 테이블 이름Global table name 키 필드Key field PersonPerson name,agename, age ...... ......

마지막 준비 작업으로 입력된 글로벌 질의를 파싱한다.Parse the global query entered as the final preparation.

② 알고리즘의 첫 번째 단계는 어떤 글로벌 테이블들이 사용되고 있는지를 알아내는 것이다. 글로벌 테이블의 From절로부터 표9와 같은 테이블을 쉽게 만들어 낼 수 있다.The first step in the algorithm is to find out which global tables are being used. You can easily create a table like Table 9 from the From clause of a global table.

글로벌 클래스Global class 글로벌 테이블 이름Global table name 글로벌 엘리어스Global Elias PersonPerson pp ...... ......

③ 글로벌 프로젝션 테이블를 만들어 낸다.③ Create a global projection table.

- 우선 Select절에서부터 들어있는 모든 프로젝션을 얻는다.First we get all the projections from the Select clause.

- 다음으로 where절에 등장하는 모든 필요한 프로젝션들을 얻어 낸다.Next, we get all the necessary projections that appear in the where clause.

- 키필드 들을 프로젝션에 추가시킨다.Add keyfields to the projection.

- 생성된 프로젝션 리스트는 표10과 같다. 프로젝션이 요구되는 것이 오퍼레이션일 수 있으므로, 표에 오퍼레이션인지의 여부와 인자 리스트가 추가되어 있다. 오퍼레이션 값은 오퍼레이션이 아닌 경우 1, 인자가 없는 경우 2, 인자가 있는 경우 3이 된다.-The created projection list is shown in Table 10. Since it may be an operation that requires a projection, it is added to the table whether it is an operation and a list of arguments. The operation value is 1 for no operation, 2 for no argument and 3 for argument.

글로벌 프로젝션Global projection AliasAlias Field NameField name OperationOperation ArgumentArgument pp namename 1One __ cc fatherfather 1One __ pp ageage 1One __

상기와 같이 이루어지는 본 발명에 의하면 멀티 데이타베이스에 제출된 글로벌 질의를 각 지역 데이타베이스에 제출하기 위한 부질의로 생성함에 있어서, 데이타의 손실이 발생하지 않고, 알고리즘이 간단하여 용이하게 실현할 수 있는 효과가 있다.According to the present invention as described above, when generating a global query submitted to a multi-database as a subquery for submitting to each local database, no loss of data occurs, the algorithm is simple and can be easily realized. There is.

Claims (2)

다수개의 지역 데이타베이스와 네트워크를 통해 연결된 멀티데이타베이스 시스템에서의 글로벌 질의에 대한 부질의 생성방법에 있어서,In the method of generating subqueries for global queries in multi-database systems connected via multiple local databases and networks, 글로벌 질의의 파싱 결과로부터 글로벌 질의의 from절에 있는 테이블 정보를 글로벌 테이블 리스트에 추가하고, 글로벌 질의의 select절에 있는 프로젝션(projection) 정보를 프로젝션 리스트에 추가한 다음, 글로벌 질의에 where절이 존재하는지 확인하는 제1단계;From the parsing result of the global query, add the table information in the from clause of the global query to the global table list, add the projection information in the select clause of the global query to the projection list, and then check if the where clause exists in the global query. Confirming the first step; 상기 제1단계에서 where절이 존재하면 where 절에 있는 테이블 정보를 글로벌 테이블 리스트에 추가한 다음, join 필드를 실렉션(selection) 리스트에 추가하는 제2단계;A second step of adding table information in the where clause to the global table list and then adding a join field to the selection list if the where clause exists in the first step; 상기 제1단계에서 where절이 존재하지 않으면 join 필드를 실렉션(selection) 리스트에 추가하는 제3단계;A third step of adding a join field to a selection list if the where clause does not exist in the first step; 상기 제3단계 수행 후, 프로젝션 리스트에 있는 엘리어스(alias)가 글로벌 테이블에 있는 테이블의 엘리어스와 일치하는지 확인하는 제4단계; 및A fourth step of checking whether an alias in a projection list matches an alias of a table in a global table after performing the third step; And 상기 제4단계에서 일치하는 경우에 대해서만 프로젝션 리스트에 있는 엘리어스와 프로젝션 리스트에 있는 필드정보에 해당되는 지역 데이타베이스 정보를 매핑 정보에서 검색하여, 찾은 지역 데이타베이스에 해당되는 부질의의 select와 from절에 프로젝션 리스트에 있는 엘리어스와 필드정보를 추가하는 제5단계Only in the case of matching in step 4, local database information corresponding to the alias information in the projection list and field information in the projection list is searched in the mapping information, and the select and from clauses of the subquery corresponding to the found local database are searched. Step 5 of adding aliases and field information in the projection list to the 를 포함한 것을 특징으로 하는 글로벌 질의에 대한 부질의 생성방법.Subqueries generation method for a global query comprising a. 다수개의 지역 데이타베이스와 네트워크를 통해 연결된 멀티데이타베이스 시스템에서의 글로벌 질의로부터 부질의를 생성하는 기능을 수행하기 위한 컴퓨터로 읽을 수 있는 기록매체에 있어서,A computer-readable recording medium for performing a function for generating a subquery from a global query in a multidatabase system connected through multiple local databases and networks. 글로벌 질의의 파싱 결과로부터 글로벌 질의의 from절에 있는 테이블 정보를 글로벌 테이블 리스트에 추가하고, 글로벌 질의의 select절에 있는 프로젝션(projection) 정보를 프로젝션 리스트에 추가한 다음, 글로벌 질의에 where절이 존재하는지 확인하는 제1단계;From the parsing result of the global query, add the table information in the from clause of the global query to the global table list, add the projection information in the select clause of the global query to the projection list, and then check if the where clause exists in the global query. Confirming the first step; 상기 제1단계에서 where절이 존재하면 where 절에 있는 테이블 정보를 글로벌 테이블 리스트에 추가한 다음, join 필드를 실렉션(selection) 리스트에 추가하는 제2단계;A second step of adding table information in the where clause to the global table list and then adding a join field to the selection list if the where clause exists in the first step; 상기 제1단계에서 where절이 존재하지 않으면 join 필드를 실렉션(selection) 리스트에 추가하는 제3단계;A third step of adding a join field to a selection list if the where clause does not exist in the first step; 상기 제3단계 수행 후, 프로젝션 리스트에 있는 엘리어스(alias)가 글로벌 테이블에 있는 테이블의 엘리어스와 일치하는지 확인하는 제4단계; 및A fourth step of checking whether an alias in a projection list matches an alias of a table in a global table after performing the third step; And 상기 제4단계에서 일치하는 경우에 대해서만 프로젝션 리스트에 있는 엘리어스와 프로젝션 리스트에 있는 필드정보에 해당되는 지역 데이타베이스 정보를 매핑 정보에서 검색하여, 찾은 지역 데이타베이스에 해당되는 부질의의 select와 from절에 프로젝션 리스트에 있는 엘리어스와 필드정보를 추가하는 제5단계Only in the case of matching in step 4, local database information corresponding to the alias information in the projection list and field information in the projection list is searched in the mapping information, and the select and from clauses of the subquery corresponding to the found local database are searched. Step 5 of adding aliases and field information in the projection list to the 를 실행시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체.A computer-readable recording medium having recorded thereon a program for executing the program.
KR1019980052966A 1998-12-03 1998-12-03 How to Generate Subqueries for Global Queries in Multidatabase Systems KR100283614B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019980052966A KR100283614B1 (en) 1998-12-03 1998-12-03 How to Generate Subqueries for Global Queries in Multidatabase Systems

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019980052966A KR100283614B1 (en) 1998-12-03 1998-12-03 How to Generate Subqueries for Global Queries in Multidatabase Systems

Publications (2)

Publication Number Publication Date
KR20000038104A true KR20000038104A (en) 2000-07-05
KR100283614B1 KR100283614B1 (en) 2001-03-02

Family

ID=19561305

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019980052966A KR100283614B1 (en) 1998-12-03 1998-12-03 How to Generate Subqueries for Global Queries in Multidatabase Systems

Country Status (1)

Country Link
KR (1) KR100283614B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100625422B1 (en) * 1999-12-07 2006-09-18 주식회사 케이티 Method for integrating schema using multidatabase query language

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100625422B1 (en) * 1999-12-07 2006-09-18 주식회사 케이티 Method for integrating schema using multidatabase query language

Also Published As

Publication number Publication date
KR100283614B1 (en) 2001-03-02

Similar Documents

Publication Publication Date Title
Simitsis et al. State-space optimization of ETL workflows
Litwin et al. MSQL: A multidatabase language
US6748374B1 (en) Method for generating a relational database query statement using one or more templates corresponding to search conditions in an expression tree
US7318058B2 (en) System and method of processing queries
US6092061A (en) Data partitioning by co-locating referenced and referencing records
US5590319A (en) Query processor for parallel processing in homogenous and heterogenous databases
Andersson Extracting an entity relationship schema from a relational database through reverse engineering
US6032143A (en) Evaluation of existential and universal subquery in a relational database management system for increased efficiency
US7680781B1 (en) Automatic search query generation and results set management
Motro et al. Fusionplex: resolution of data inconsistencies in the integration of heterogeneous information sources
US6356892B1 (en) Efficient implementation of lightweight directory access protocol (LDAP) search queries with structured query language (SQL)
US7882132B2 (en) Support for RDBMS in LDAP system
US7801913B2 (en) System and method for querying data for implicit hierarchies
US6085188A (en) Method of hierarchical LDAP searching with relational tables
US7319995B2 (en) Method and system for inclusion hash joins and exclusion hash joins in relational databases
US20050165754A1 (en) Method and system for data retrieval from heterogeneous data sources
Grant et al. Query languages for relational multidatabases
Rajaraman et al. Integrating information by outerjoins and full disjunctions
US6957210B1 (en) Optimizing an exclusion join operation using a bitmap index structure
US20060161525A1 (en) Method and system for supporting structured aggregation operations on semi-structured data
US20040083223A1 (en) Global database management system integrating heterogeneous data resources
Gardarin et al. XML-based components for federating multiple heterogeneous data sources
US20040049495A1 (en) System and method for automatically generating general queries
US20030046272A1 (en) Database systems, methods and computer program products using type based selective foreign key association to represent multiple but exclusive relationships in relational databases
Zuzarte et al. Winmagic: Subquery elimination using window aggregation

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20071115

Year of fee payment: 8

LAPS Lapse due to unpaid annual fee