KR100315601B1 - Storing and re-execution method of object-oriented sql evaluation plan in dbms - Google Patents
Storing and re-execution method of object-oriented sql evaluation plan in dbms Download PDFInfo
- Publication number
- KR100315601B1 KR100315601B1 KR1019980052255A KR19980052255A KR100315601B1 KR 100315601 B1 KR100315601 B1 KR 100315601B1 KR 1019980052255 A KR1019980052255 A KR 1019980052255A KR 19980052255 A KR19980052255 A KR 19980052255A KR 100315601 B1 KR100315601 B1 KR 100315601B1
- Authority
- KR
- South Korea
- Prior art keywords
- execution plan
- function
- condition
- class
- stored
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/289—Object oriented databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
- G06F16/2255—Hash tables
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24564—Applying rules; Deductive queries
- G06F16/24566—Recursive queries
Abstract
1. 청구범위에 기재된 발명이 속한 기술분야1. TECHNICAL FIELD OF THE INVENTION
본 발명은 객체지향 질의어 실행계획의 저장과 재실행 방법에 관한 것임.The present invention relates to a method for storing and replaying an object-oriented query execution plan.
2. 발명이 해결하려고 하는 기술적 과제2. The technical problem to be solved by the invention
본 발명은 기억 장치 데이타베이스 관리시스템(MDBMS)에서 객체지향 질의어에 대한 질의어 최적화 결과인 실행계획(evaluation plan)을 압축하여 저장하고 재실행하는 객체지향 질의어 실행계획의 저장과 재실행 방법 및 상기 방법을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공하는데 그 목적이 있음.The present invention realizes a method and method for storing and re-executing an object-oriented query execution plan which compresses, stores, and executes an execution plan that is a result of query optimization for an object-oriented query in a storage database management system (MDBMS). The aim is to provide a computer readable recording medium having recorded thereon a program for the purpose of recording the program.
3. 발명의 해결방법의 요지3. Summary of Solution to Invention
본 발명은, 객체지향 질의어를 최적화하여 실행계획을 생성하는 제 1 단계; 상기 주기억 장치 데이타베이스 관리시스템(MDBMS)에서 데이터가 메모리에 상주하므로 실행계획을 저장하는 경우에 허용된 메모리내에 가능한 많은 실행계획을 저장할 수 있도록 재실행이 가능한 범위내에서 압축된 형태로 실행계획을 구성하여 저장하는 제 2 단계; 상기 저장된 실행계획을 신속하게 해독하여 재실행하는 제 3 단계를 포함한다.The present invention includes a first step of generating an execution plan by optimizing an object-oriented query; In the main memory database management system (MDBMS), the data resides in memory, so when the execution plan is stored, the execution plan is configured in a compressed form within a range that can be re-executed to store as many execution plans as possible in the allowed memory. Storing the second step; And a third step of quickly decrypting and rerunning the stored execution plan.
4. 발명의 중요한 용도4. Important uses of the invention
본 발명은 주기억 장치 데이터베이스 관리시스템(MDBMS)에 이용됨.The present invention is used in a main memory database management system (MDBMS).
Description
본 발명은 주기억 장치 데이터베이스 관리시스템(MDBMS : Main-memory Database Management System)에서 질의어 최적화의 결과인 실행계획을 저장하여n(n은 자연수)회 사용하도록 하므로써 질의어 최적화 자체에 걸리는 시간을 최소화하기 위한 객체지향 질의어 실행계획의 저장과 재실행 방법 및 상기 방법을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체에 관한 것으로, 특히 주기억 장치 데이터베이스 관리시스템(MDBMS)에서는 모든 데이터가 메모리에 상주함을 감안하여 압축된 형태로 실행계획을 생성하여 효율적으로 저장하고, 재실행하는 객체지향 질의어 실행계획의 저장과 재실행 방법 및 상기 방법을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체에 관한 것이다.The present invention stores an execution plan that is the result of query optimization in a main-memory database management system (MDBMS) so that n (n is a natural number) is used to minimize the time required for query optimization itself. The present invention relates to a method of storing and re-executing an oriented query execution plan and a computer-readable recording medium recording a program for realizing the method. In particular, in a main memory database management system (MDBMS), all data reside in a memory. The present invention relates to a method for storing and re-executing an object-oriented query execution plan that generates, efficiently stores, and executes an execution plan in a compressed form, and a computer-readable recording medium recording a program for realizing the method.
먼저, 종래의 배경 기술들에 대하여 살펴보면 다음과 같다.First, the conventional background technologies will be described.
1978년에 "P.G. Selinger"가 "ACM SIGMOD Conference(pp23-34)"에 게재한 "관계형 데이터베이스 관리시스템에서 액세스 경로 선택 기법(Access Path Selection in a Relational Database Management System)"은 디스크 기반의 관계형 데이터베이스 관리시스템(System R)에서의 질의어 최적화 방법에 관한 것이다."Access Path Selection in a Relational Database Management System", published in 1978 by the PG Selinger at the ACM SIGMOD Conference (pp23-34), is a disk-based relational database management system. The present invention relates to a query optimization method in System R.
이 방법은 고급 질의어(SQL)를 분석한 후에 질의어 최적화가 조인의 순서와 조인 알고리즘 및 각 테이블 액세스 방법을 결정하여 실행계획을 만드는 체계적인 방법을 제시하고 있다. 조인 순서의 결정에서는 모든 가능한 조인 순서를 생성한 다음에 비용을 기반으로 최소 비용의 조인 순서와 각 조인의 조인 알고리즘을 결정한다. 그리고, 질의 조건을 단위 조건으로 분리한 다음에, 각 단위 조건의 선택률을 계산하고, 이를 기반으로 각 테이블의 액세스 방법을 결정한다. 즉, 질의어에 대하여 모든 가능한 실행계획들을 생성한 후에 이들의 비용을 예측하고, 최소비용의 실행 전략을 수립하게 된다.After analyzing advanced query (SQL), this method presents a systematic method for creating an execution plan by determining the order of joins, join algorithm, and each table access method. Determining the join order generates all possible join orders and then determines the minimum cost join order and the join algorithm for each join based on the cost. After the query conditions are separated into unit conditions, the selectivity of each unit condition is calculated, and the access method of each table is determined based on the selectivity. That is, after generating all possible execution plans for the query, their cost is estimated and the least-cost execution strategy is established.
그리고, 1987년에 "G. Graefe" 등이 "ACM SIGMOD Conference(pp160-172)"에 게재한 "엑서더스 최적화 생성기(The Exodus Optimizer Generator)"는 질의 최적화 모듈 생성기에 관한 것이다.In 1987, "The Exodus Optimizer Generator" published by "G. Graefe" in "ACM SIGMOD Conference (pp160-172)" relates to a query optimization module generator.
대부분의 데이터베이스 관리시스템에서 질의 최적화 기법은 데이터베이스 관리시스템 소스 코드내에 고정된 형태로 설계 구현되지만, 이 방법에서는 질의 최적화 모듈 자체를 자동으로 생성하려는 아이디어이다. 자동 생성을 위해서는 필요한 인자들과 규칙 및 비용 모델을 정의하고, 이들을 입력받으면 자동 생성기가 적절한 질의 최적화 모듈을 생성한다. 사용자는 인자와 규칙 및 비용 모델을 조정하므로써 다양한 형태의 질의 최적화기를 시험적으로 생성할 수 있으며, 이들중 적합한 것을 선택하게 된다.In most database management systems, the query optimization technique is designed and implemented in a fixed form in the database management system source code, but this is the idea of automatically generating the query optimization module itself. For automatic generation, we define the necessary factors, rules, and cost model, and when inputted, the automatic generator creates the appropriate query optimization module. By adjusting the arguments, rules, and cost model, the user can create various types of query optimizers experimentally, selecting the appropriate one.
그리고, 1993년에 "J. Blakeley"가 "ACM SIGMOD Conference(pp287-296)"에 게재한 방법은, 디스크 상주형 객체지향 데이터베이스 관리시스템에서 규칙기반 질의 최적화 기법에 관한 것이다. 이 방법은 먼저 질의 변환 규칙을 사용하여 파싱 결과인 대수 트리를 최적의 대수트리로 변환해 나가는 방식을 취하고 있으며, 핵심 아이디어는 논리적 대수변환 규칙과 더불어 인덱스 등의 활용을 감안하는 물리적 대수변환 규칙을 동시에 사용한다는 점이다.In 1993, the method published by J. Blakeley at the ACM SIGMOD Conference (pp287-296) relates to a rule-based query optimization technique in a disk-resident object-oriented database management system. This method first uses a query transformation rule to transform the algebraic tree, which is the result of parsing, into an optimal algebra tree. The key idea is to use a physical algebraic rule that considers the use of indexes and the like with logical algebraic conversion rules. It is used at the same time.
그리고, 미국 특허 US5,345,585호(Method for optimizing processing of join queries by determining optimal processing order and assigning optimal join methods to each of the join operations : 1994. 9. 6)는 관계형 데이터베이스에서 질의 최적화를 위한 조인 연산자 최적 처리 기법에 관한 것으로, 데이터는 테이블 형태의 릴레이션들에 저장되고, 저장된 데이터는 조인 연산을 사용하여 검색하게 된다. 그러나, 조인 연산자는 처리 비용이 비싼 것이 그 특징이며, 따라서 최적화 기법에서 가장 중요하게 고려되어야 할 분야이다.In addition, US Pat. No. 5,345,585 (Method for optimizing processing of join queries by determining optimal processing order and assigning optimal join methods to each of the join operations: September 6, 1994) With regard to the processing technique, data is stored in relations in table form, and the stored data is retrieved using a join operation. However, the join operator is characterized by a high processing cost, and thus is the most important area to be considered in the optimization technique.
이러한 조인 연산 최적화 방법은 조인 연산에 대한 초기 계산 순서를 랜덤하게 선택한 후에 "KBZ(Krishanmurthy, Boral and Zaniolo)" 알고리즘에 의하여 최적 조인 순서로 개선해 나가는 방법을 취한다. 이 방법의 핵심 아이디어는 다항(polynomial) 함수의 복잡도를 갖는 방식으로 최적의 조인 처리 순서를 결정한다는 점이다.This join operation optimization method adopts a method of randomly selecting an initial calculation order for a join operation and then improving it to an optimal join order by the "KBZ (Krishanmurthy, Boral and Zaniolo)" algorithm. The key idea of this method is to determine the optimal join processing order in a way that has the complexity of a polynomial function.
그리고, 미국 특허 US5,301,317호(System for adapting query optimization effort to expected execution time : 1994. 4. 5)는 예측된 질의 실행 시간에 따라서 질의 최적화에 소요될 자원의 적정량을 자동으로 결정하는 시스템에 관한 것이다.In addition, US Pat. No. 5,301,317 (System for adapting query optimization effort to expected execution time: April 5, 1994) relates to a system for automatically determining an appropriate amount of resources required for query optimization according to the predicted query execution time. .
이 방법의 핵심 아이디어는 질의 최적화 단계에서 소요될 비용(즉 여러 대안들의 비용을 예측하여 최적의 실행계획을 수립하는데 드는 비용)과 최적의 실행계획을 찾아서 실행하는 경우에 얻어지는 실행 시간상의 이득(benefit) 차이를 분석하여 이익이 남는 적정한 수준에서 질의 최적화를 실행하겠다는 의도이다. 이익이 남지 않는다고 판단되면 질의 최적화가 고려할 대안의 개수를 줄이게 되며, 반대의 경우에는 대안의 수를 늘려서 탐색 공간을 늘여서 검사한다. 이익이 있고 없음을 판단하는 것은 컴파일 시간의 파라메터와 휴리스틱을 사용한다.The key idea of this method is the cost of the query optimization phase (ie, the cost of predicting the cost of the alternatives) and the run-time benefits of finding and implementing the best execution plan. The intention is to perform query optimization at an appropriate level of profit by analyzing the differences. If it is determined that there is no benefit, query optimization reduces the number of alternatives to consider. In the opposite case, the search space is increased by increasing the number of alternatives. To determine if there is a benefit or not, use compile-time parameters and heuristics.
그리고, 미국 특허 US5,822,747호(System and method for optimizingdatabase queries : 1994. 4. 5)는 에스큐엘(SQL : Structured Query Language) 질의어에 대한 최적의 실행 계획을 수립하는 질의 최적화 기법에 관한 것이다.In addition, US Pat. No. 5,822,747 (System and method for optimizing database queries: April 5, 1994) relates to a query optimization technique for establishing an optimal execution plan for a structured query language (SQL) query.
에스큐엘(SQL) 질의어중에서 중첩 질의를 포함하는 경우에 질의 최적화기는 대안이 되는 실행 계획을 만든 후에 이에 대하여 구현 규칙(implementation rule)과 변환 규칙(transformation rule)을 적용하여 최소 비용의 것을 만들어 낸다. 질의 최적화기는 대안이 되는 실행계획들을 만들어 나가는 과정에서 모든 변환규칙을 적용하는 것이 아니라 이득이 있다고 판단되는 일부만 적용하므로써 탐색 공간을 최소화한다. 질의 최적화가 처음 대안이 되는 실행 계획을 만들때는 구현 규칙을 사용하여 임의의 실행 계획을 만들고 그의 예상 비용을 기준치로 저장한다. 다음부터는 규칙을 사용하여 새로운 실행계획을 만들 때 이 기준치를 초과하지 않는 경우에만 실행 계획을 만들도록 통제하여 과다한 탐색공간을 만들지 않도록 한다.In the case of nested queries in SQL queries, the query optimizer creates an alternative execution plan and then applies implementation rules and transformation rules to produce the least expensive one. The query optimizer minimizes the search space by not applying all the conversion rules in the process of creating alternative execution plans, but by applying only the parts that are considered to be beneficial. When creating an execution plan for which query optimization is the first alternative, use implementation rules to create an arbitrary execution plan and store its estimated cost as a baseline. In the future, when you create a new execution plan using rules, you should control the creation of the execution plan only if it does not exceed this threshold, so that you do not create excessive search space.
상기와 같은 종래의 질의어 최적화 기법들은 대부분의 경우가 디스크 기반 데이터베이스 관리시스템(DDBMS : Disk-Based DBMS)에 대한 기술로서, 질의어 처리에 소요될 디스크 접근 회수를 최소화하도록 실행 전략을 수립하기 위한 기술들이다.The conventional query optimization techniques described above are techniques for a disk-based database management system (DDBMS) in most cases, and techniques for establishing an execution strategy to minimize the number of disk accesses required for query processing.
그런데, 주기억 장치 데이타베이스 관리시스템(MDBMS)이 교환기나 통신시스템 등에서 사용되기 위해서는 고성능의 실시간(real-time) 성질을 지원하는 것이 중요하다. 이를 위하여 정교하게 질의어를 최적화하고, 비용을 들여 생성한 질의어 최적화의 결과를 저장한 후에 이를 n회 재사용하는 것이 바람직하다.However, it is important to support a high performance real-time property in order for a main memory database management system (MDBMS) to be used in an exchange or a communication system. For this purpose, it is desirable to optimize the query in detail, store the result of the query optimization generated at a cost, and reuse it n times.
즉, 주기억 장치 데이타베이스 관리시스템(MDBMS)에서 고성능의 실시간 특성을 만족시키기 위해서는 주어진 질의어에 대하여 최소비용의 실행계획을 수립하는 질의어 최적화 기법을 가져야 하며, 자주 사용되는 질의어에 대하여 최적화된 실행계획을 데이타베이스에 저장한 후에 n번 이상 재사용할 수 있도록 하므로써 질의어 최적화 자체에 걸리는 시간을 단축하는 방법이 요구되고 있다.In other words, in order to satisfy the high performance real-time characteristics in main memory database management system (MDBMS), it is necessary to have a query optimization technique that establishes a minimum cost execution plan for a given query, and to optimize the execution plan for frequently used queries. There is a need for a method that reduces query query optimization time by allowing it to be reused more than n times after being stored in the database.
그러나, 주기억 장치 데이타베이스 관리시스템(MDBMS)에서는 이러한 기법이 아직 제안되지 않았으며, 특히 객체지향 질의어를 대상으로 실행계획의 저장과 재실행 기법을 연구한 사례는 지금까지 발표되지 않고 있는 실정이다.However, such a technique has not been proposed in main memory database management system (MDBMS). In particular, there have been no cases of studying the execution and storage of execution plans for object-oriented queries.
따라서, 상기 요구에 부응하기 위하여 안출된 본 발명은, 주기억 장치 데이타베이스 관리시스템(MDBMS)에서 객체지향 질의어에 대한 질의어 최적화 결과인 실행계획(evaluation plan)을 압축하여 저장하고 재실행하는 객체지향 질의어 실행계획의 저장과 재실행 방법 및 상기 방법을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공하는데 그 목적이 있다.Accordingly, the present invention, which is designed to meet the above requirements, executes an object-oriented query that compresses, stores, and executes an execution plan that is a query optimization result for an object-oriented query in a main memory database management system (MDBMS). It is an object of the present invention to provide a method of storing and re-executing a plan and a computer-readable recording medium recording a program for realizing the method.
즉, 본 발명은, 주기억 장치 데이타베이스 관리시스템(MDBMS)에서 데이터가 메모리에 상주하므로 실행계획을 저장하는 경우에 허용된 메모리내에 가능한 많은 실행계획을 저장할 수 있도록 재실행이 가능한 범위내에서 압축된 형태로 실행계획을 구성하여 저장하고, 저장된 실행계획을 신속하게 해독하여 재실행하는 객체지향 질의어 실행계획의 저장과 재실행 방법 및 상기 방법을 실현시키기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체를 제공하는데 그 목적이 있다.That is, in the present invention, since the data resides in the memory in the main memory device database management system (MDBMS), it is compressed in a range that can be re-executed to store as many execution plans as possible in the allowed memory when storing the execution plans. The present invention provides a method of storing and re-executing an object-oriented query execution plan, which constructs and stores an execution plan, quickly decodes and executes the execution plan, and a computer-readable recording medium recording a program for realizing the method. There is a purpose.
도 1 은 본 발명에 따른 질의 최적화기에서 생성한 실행계획의 일실시예 구조도.1 is a structural diagram of an embodiment of an execution plan generated by a query optimizer according to the present invention;
도 2 는 본 발명에 따른 실행계획의 구성 및 저장 방법의 일실시예 설명도.Figure 2 is an illustration of an embodiment of the configuration and storage method of the execution plan according to the present invention.
도 3 은 본 발명에 따른 실행계획의 해독 및 재실행 방법에 대한 일실시예 흐름도.Figure 3 is an embodiment flow diagram for the decryption and re-execution method of the execution plan according to the present invention.
* 도면의 주요 부분에 대한 부호의 설명* Explanation of symbols for the main parts of the drawings
11 : 질의 최적화기 21 : 실행계획 테이블11: query optimizer 21: execution plan table
22 : 조건 테이블22: conditional table
상기 목적을 달성하기 위한 본 발명의 방법은, 주기억 장치 데이터베이스 관리시스템(MDBMS)에 적용되는 객체지향 질의어 실행계획의 저장과 재실행 방법에 있어서, 객체지향 질의어를 최적화하여 실행계획을 생성하는 제 1 단계; 상기 주기억 장치 데이타베이스 관리시스템(MDBMS)에서 데이터가 메모리에 상주하므로 실행계획을 저장하는 경우에 허용된 메모리내에 가능한 많은 실행계획을 저장할 수 있도록 재실행이 가능한 범위내에서 압축된 형태로 실행계획을 구성하여 저장하는 제 2 단계; 상기 저장된 실행계획을 신속하게 해독하여 재실행하는 제 3 단계를 포함하여 이루어진 것을 특징으로 한다.The method of the present invention for achieving the above object, in the storage and re-execution method of the object-oriented query execution plan applied to the main memory device database management system (MDBMS), the first step of optimizing the object-oriented query query to generate the execution plan ; In the main memory database management system (MDBMS), the data resides in memory, so when the execution plan is stored, the execution plan is configured in a compressed form within a range that can be re-executed to store as many execution plans as possible in the allowed memory. Storing the second step; And a third step of quickly decoding and re-executing the stored execution plan.
한편, 본 발명은, 프로세서를 구비하는 주기억 장치 데이터베이스 관리시스템(MDBMS)에, 객체지향 질의어를 최적화하여 실행계획을 생성하는 제 1 기능; 상기 주기억 장치 데이타베이스 관리시스템(MDBMS)에서 데이터가 메모리에 상주하므로 실행계획을 저장하는 경우에 허용된 메모리내에 가능한 많은 실행계획을 저장할 수 있도록 재실행이 가능한 범위내에서 압축된 형태로 실행계획을 구성하여 저장하는 제 2 기능; 상기 저장된 실행계획을 신속하게 해독하여 재실행하는 제 3 기능을 실현시키기 위한 프로그램을 기록한, 컴퓨터로 읽을 수 있는 기록매체를 제공한다.On the other hand, the present invention, the main memory device database management system (MDBMS) having a processor, a first function for generating an execution plan by optimizing the object-oriented query language; In the main memory database management system (MDBMS), the data resides in memory, so when the execution plan is stored, the execution plan is configured in a compressed form within a range that can be re-executed to store as many execution plans as possible in the allowed memory. A second function of storing; A computer readable recording medium having recorded thereon a program for realizing a third function of quickly decrypting and executing the stored execution plan is provided.
상술한 목적, 특징들 및 장점은 첨부된 도면과 관련한 다음의 상세한 설명을 통하여 보다 분명해 질 것이다. 이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 일실시예를 상세히 설명한다.The above objects, features and advantages will become more apparent from the following detailed description taken in conjunction with the accompanying drawings. Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings.
먼저, 본 발명의 주요 개념을 개략적으로 살펴보면 다음과 같다.First, the main concept of the present invention will be described as follows.
본 발명에서는 질의어 최적화의 결과인 실행계획을 압축된 형태로 구성하여 저장하고, 저장된 실행계획을 재실행한다. 실행계획을 저장하는 방식에서는 디스크 기반 데이터베이스 관리시스템(DBMS)과 달리, 모든 데이터가 메모리에 상주하는 주기억 장치 데이타베이스 관리시스템(MDBMS)에서 한정된 메모리 자원을 최대한 이용할 수 있도록 실행계획을 압축하여 저장하며, 특히 저장 형태가 객체 관계 모델을 따르도록 모델링한다. 다음으로 실행계획을 재실행할 때는 객체 관계 모델로 표시된 실행계획을 읽어와서 재해석하여 실행한 후에 해를 리턴하게 된다.In the present invention, the execution plan resulting from the query optimization is configured and stored in a compressed form, and the stored execution plan is executed again. Unlike the disk-based database management system (DBMS), the execution plan is compressed and stored to maximize the limited memory resources in the main memory database management system (MDBMS), where all data reside in memory. In particular, model the storage form to follow the object relational model. Next, when rerunning the execution plan, the execution plan represented by the object relational model is read, reinterpreted and executed, and the solution is returned.
도 1 은 본 발명에 따른 질의 최적화기에서 생성한 실행계획의 일실시예 구조도이다.1 is a structural diagram of an embodiment of an execution plan generated by the query optimizer according to the present invention.
주어진 SQL(Structured Query Language) 문장에 대한 실행 결과에서는 질의에 포함된 각 클래스들이 하나의 노드로 표시되며, 각 노드에는 다음과 같은 필드가 존재한다.In the execution result for a given SQL (Structured Query Language) statement, each class included in the query is represented by one node, and each node has the following fields.
· 클래스 정보(T1, T2, ...) : 클래스에 관한 정보를 가진 필드로서, 그 클래스의 객체들이 저장된 메모리상의 포인터, 각 객체의 크기, 각 속성의 오프셋(offset)과 데이터 타입 정보들로 구성된다.Class information (T1, T2, ...): A field with information about a class that contains pointers in memory where objects of that class are stored, the size of each object, the offset and data type information of each property. It is composed.
· 조인 알고리즘(Null, Ptr-based, ...) : 직전에 액세스된 클래스와 지금 액세스될 클래스 사이의 조인 방법을 표시하는 필드로서, 첫 클래스의 경우에는 널(Null), 두 번째 이후의 클래스의 경우에는 OID(Object Identifier)를 값으로 가지면 "Ptr-based", 그렇지 않으면 "Nested-loop"로 표시한다.Join algorithm (Null, Ptr-based, ...): A field that indicates how to join between the class just accessed and the class now being accessed. Null for the first class and class after the second. In the case of OID (Object Identifier), it is expressed as "Ptr-based", otherwise it is expressed as "Nested-loop".
· 사용될 인덱스(Index(att1), T1.att3, ...) : 현재 클래스에서 객체를 가져올 때 사용될 액세스 방법을 명시하는 필드로서, 속성(att)에 대한 인덱스를 사용하는 경우에는 "Index(att)", 속성값으로 저장된 OID(Object Identifier)를 사용하는 경우에는 "테이블명.속성명"(예, T1.att3), 순차접근의 경우에는 시퀀스(SEQ)로 표시한다.The index to be used (Index (att1), T1.att3, ...). This field specifies the access method to be used when retrieving objects from the current class. If you use an index on the attribute (att), use "Index (att In the case of using an OID (Object Identifier) stored as an attribute value, "Table name. Attribute name" (for example, T1.att3), and a sequence (SEQ) for sequential access.
· 조건(att2 θ v, att4 θ v', ...) : 각 클래스에서 객체를 가져온 후에 검사해야 할 조건을 나타내는 필드로서, 조인 조건의 경우에 조인될 두 객체가 모두 액세스된 후에 검사하도록 두 번째로 액세스되는 클래스에 첨부한다.Condition (att2 θ v, att4 θ v ', ...): A field indicating the condition to check after getting an object from each class. In the case of join condition, two fields to be checked after both objects to be joined are accessed. Attached to the first accessed class.
· 다음 노드에 대한 포인터 : 다음으로 액세스될 클래스를 지시하는 포인터를 나타내는 필드이다.Pointer to next node: This field represents the pointer to the next class to be accessed.
도 2 는 본 발명에 따른 실행계획의 구성 및 저장 방법의 일실시예 설명도로서, 도 1 에 나타난 정보를 데이터베이스에 저장하기 위하여 객체 형태로 압축하여 구성한 모습을 보여준다.FIG. 2 is a diagram illustrating an embodiment of a method of configuring and storing an execution plan according to the present invention, and shows a state in which the information illustrated in FIG.
여기서, 각 필드에 대한 설명은 다음과 같다.Here, the description of each field is as follows.
· 테이블 포인터(table-ptr) : 클래스에 대한 포인터를 나타내는 필드이다. 예들들어, 주소(T1)은 클래스 T1의 객체가 저장된 곳의 시작 주소(offset)를 나타낸다.Table pointer (table-ptr): A field that represents a pointer to a class. For example, address T1 represents the starting address of where an object of class T1 is stored.
· 조인 알고리즘(join-algo) : 조인 알고리즘을 나타내는 필드이다.Join-algo: This field indicates the join algorithm.
· 액세스 경로(acc-path) : 액세스 경로(access path)를 나타내는 필드로서, 인덱스(index) 또는 순차 접근이 사용된다.Acc-path: A field indicating an access path, where index or sequential access is used.
· 조건(conditions) : 현재 테이블에 부과된 조건을 지시하는 필드이다.Conditions: This field indicates the conditions imposed on the current table.
· 다음(next) : 다음으로 액세스될 테이블의 시작 주소(offset)를 나타내는 필드이다.Next: This field indicates the starting address of the next table to be accessed.
상기 도 1 에 도시된 각 노드는, 도 2 에서 하나의 실행계획 테이블(EvalPlanTable) 객체와 조건 개수만큼의 조건 테이블(CondTable) 객체들로 표시된다. 실행계획 테이블(EvalPlanTable) 객체의 각 필드는 앞의 설명과 같이 도 1 의 각 필드와 그 의미가 동일하지만 메모리상의 포인터로 변환된 점이 다르다. 다만, 조건의 경우에 각 테이블마다 두 개 이상의 조건이 부과될 수 있으므로 이를 별도의 클래스인 조건 테이블(CondTable)(22)에 저장하였으며, 포인터로 지시하도록 하였다.Each node illustrated in FIG. 1 is represented by one execution plan table (EvalPlanTable) object and as many condition table objects (CondTable) objects as in FIG. 2. Each field of the execution plan table (EvalPlanTable) object has the same meaning as that of each field of FIG. 1 as described above, but is converted into a pointer in memory. However, in the case of a condition, two or more conditions may be imposed on each table. Therefore, the condition is stored in a separate class (CondTable) 22, which is indicated by a pointer.
즉, 도 1 에서 첫 번째 노드는 도 2 의 실행계획 테이블(EvalPlanTable)(21)의 첫 번째 객체와 조건 테이블(CondTable)(22)의 첫 번째 객체로 표시되었으며, 도 1 의 두 번째 노드는 도 2 의 실행계획 테이블(EvalPlanTable)(21)의 두 번째 객체와 조건 테이블(CondTable)(22)의 두 번째 및 세 번째 객체로 표시되었다. 도 2 의 압축된 표현 방식은 실시간 데이터베이스 시스템(RTDBS)에서 제공하는 객체-관계 모델의 객체 형식과 동일하므로 사용자는 실행계획 테이블(EvalPlanTable)(21)과 조건 테이블(CondTable)(22)의 객체들에 대하여 질의를 하거나 변경할 수 있다. 즉, 도 1에서는 실행 계획 정보와 조건 정보가 각 노드에 분산되어 존재함으로써 메모리의 낭비와 함께 저장되기에 적합하지 않지만 제안된 방식에서는 이들을 두 개의 테이블 (EvalPlanTable과 CondTable)에 통합하여저장함으로써 정보가 압축하여 저장하는 효과를 얻게 된다.That is, in FIG. 1, the first node is represented by the first object of the execution plan table (EvalPlanTable) 21 and the first object of the condition table (CondTable) 22 of FIG. 2, and the second node of FIG. The second object of the execution plan table (EvalPlanTable) 21 and the second and third objects of the condition table (CondTable) 22 are represented. The compressed representation of FIG. 2 is the same as the object format of the object-relationship model provided by the real-time database system (RTDBS), so that the user can select the objects of the execution plan table (EvalPlanTable) 21 and the condition table (CondTable) 22. You can inquire or change the query. In other words, in FIG. 1, execution plan information and condition information are distributed to each node so that it is not suitable to be stored with wasted memory, but in the proposed method, information is stored by integrating and storing them in two tables (EvalPlanTable and CondTable). Compress and save.
도 3은 본 발명에 따른 객체지향 질의어 실행 계획의 저장 방법에 대한 일실시예 흐름도로서, 도 1의 기 생성된 실행 계획으로부터 도 2의 저장용 실행 계획의 생성 및 저장 방법을 표시한 알고리즘이다.3 is a flowchart illustrating a method of storing an object-oriented query execution plan according to an exemplary embodiment of the present invention, and is an algorithm showing a method of generating and storing an execution plan for storage of FIG. 2 from a previously generated execution plan of FIG. 1.
먼저, 사용자로부터 주어진 SQL에 대하여 실행 계획을 생성하라는 명령을 수신하면(30), 상기 시스템에서는 저장용 실행계획 테이블 (EvalPlanTable)과 조건 테이블(CondTable)이 존재하는지를 판단한다(31).First, when a user receives a command to generate an execution plan for a given SQL (30), the system determines whether a storage execution plan table (EvalPlanTable) and a condition table (CondTable) exist (31).
상기 과정(31)에서 판단 결과, 저장용 실행계획 테이블 (EvalPlanTable)과 조건 테이블(CondTable)이 존재하지 않을 경우, 메모리 데이터베이스 내에 클래스 형태로 저장용 실행계획 테이블 (EvalPlanTable)과 조건 테이블(CondTable)을 생성한다(32,33).If it is determined in step 31 that the execution plan table (EvalPlanTable) and the condition table (CondTable) do not exist, the execution plan table (EvalPlanTable) and the condition table (CondTable) are stored in the form of classes in the memory database. Create (32, 33).
여기서, 저장용 실행 계획 테이블(EvalPlanTable)과 조건 테이블 (CondTable)은 여러 에스큐엘(SQL)에 대한 실행 계획과 조건들을 모두 통합하여 저장하는 곳이다. 따라서 에스큐엘(SQL)에 대한 실행 계획을 생성할 때마다 만들어지는 테이블이 아니라 처음 한번만 생성하며, 이후에 생성되는 모든 실행 계획들은 이 두 테이블에 객체 형태로 저장된다.Here, the execution plan table (EvalPlanTable) and the condition table (CondTable) for storage are places to store all the execution plans and conditions for various escrow (SQL). Therefore, instead of creating a table every time an execution plan for SQL is created, it is created only once, and all execution plans created afterwards are stored as objects in these two tables.
다음으로, 질의 최적화기에서 만든 도 1의 각 노드로부터 정보를 추출하여 객체 형태로 실행 계획 테이블(EvalPlanTable)에 기록한다(34). 이때, 기록되는 객체를 t1 이라고 하면, 객체 t1에 포함된 정보는 테이블 번호, 조인 알고리즘의 종류, 액세스 경로, 조건에 대한 포인터, 다음(next) 정보이다.Next, information is extracted from each node of FIG. 1 made by the query optimizer and recorded in an execution plan table (EvalPlanTable) in the form of an object (34). In this case, if the object to be recorded is t1, the information contained in the object t1 is a table number, a type of join algorithm, an access path, a pointer to a condition, and next information.
다음으로, 각 노드에 대한 조건은 다수개의 단위 조건으로 분리하여 구성하는데, 예를들어, 조건이 "a1 = 20 and a2 = a3" 이라면 두 개의 단위 조건 "a1 = 20"과 "a2 = a3"으로 분리되고, 이 각 단위 조건은 조건 테이블(CondTable)에 객체 형태로 저장하고, 이를 저장용 실행계획 테이블(EvalPlanTable)의 객체 t1에서 속성 조건(conditions)의 값으로 참조하도록 한다(35). 그리고, 현재의 단위 조건이 마지막 단위 조건인지를 판단한다(36).Next, the condition for each node is divided into a number of unit conditions. For example, if the condition is "a1 = 20 and a2 = a3", two unit conditions "a1 = 20" and "a2 = a3" Each unit condition is stored as an object in a condition table (CondTable), and is referred to as the value of attribute conditions in the object t1 of the execution plan table (EvalPlanTable) for storage (35). Then, it is determined whether the current unit condition is the last unit condition (36).
상기 과정(36)에서 판단 결과, 현재의 단위 조건이 마지막 단위 조건이 아닐 경우에는 과정(35)으로 복귀하여 노드의 조건 필드에 포함된 마지막 단위 조건일 때까지 단위 조건의 분리 구성을 반복 수행하고, 현재의 단위 조건이 마지막 단위 조건일 경우에는 실행 계획에 포함된 마지막 노드인지를 판단한다(37).If it is determined in step 36 that the current unit condition is not the last unit condition, the process returns to step 35 and repeats the separation of unit conditions until the last unit condition included in the condition field of the node. If the current unit condition is the last unit condition, it is determined whether it is the last node included in the execution plan (37).
상기 과정(37)에서 판단 결과, 실행 계획에 포함된 마지막 노드가 아닐 경우에는 노드로부터 정보를 추출하여 객체 형태로 실행 계획 테이블에 기록하는 과정(34)으로 복귀하여 루프를 반복 수행하고, 실행 계획에 포함된 마지막 노드일 경우에는 실행 계획에 포함된 노드 수 만큼의 실행계획 테이블의 객체 생성 및 저장을 종료한다.As a result of the determination in step 37, if it is not the last node included in the execution plan, the process returns to the process 34 of extracting information from the node and recording the information in the execution plan table in the form of an object, repeating the loop, and executing the execution plan. In the case of the last node included in, the object creation and storage of the execution plan table for the number of nodes included in the execution plan is terminated.
도 4는 본 발명에 따른 실행 계획의 해독 및 재실행 방법에 대한 일실시예 흐름도로서, 도 2의 형태로 저장된 실행계획을 읽어서 재실행하는 방법을 기술한 알고리즘이다.FIG. 4 is a flowchart illustrating an example of a method of decrypting and re-executing an execution plan according to the present invention, which is an algorithm describing a method of reading and executing an execution plan stored in the form of FIG. 2.
먼저, 사용자가 실행계획이 저장된 에스큐엘(SQL)에 관하여 질의를 하면 시스템은 실행계획 테이블(EvalPlanTable)에서 그 질의에 해당하는 실행계획 객체를해싱 기법으로 찾는다(41). 이때, 해당하는 객체가 있는지를 검사하여(42), 없으면 이미 질의가 모두 처리된 것이므로 해(solution)를 모아둔 객체 배열인 result[] 배열을 리턴하고(43) 종료한다.First, when a user makes a query about an execution plan stored SQL, the system searches for an execution plan object corresponding to the query in an execution plan table (EvalPlanTable) using a hashing technique (41). At this time, it is checked whether there is a corresponding object (42), and if not, the query is already processed, so the result [] array, which is an object array that collects solutions, is returned (43).
한편, 해당 객체가 있으면(42) 포인터(Ptr)가 지시하는 객체에서 주어진 액세스 경로(access path)를 사용하여 다음 조인될 객체를 데이터베이스로부터 가져온다(44). 이때, 포인터(Ptr)가 지시하는 객체가 실행계획의 첫 번째 객체라면 조인될 객체를 가져올 필요없이 무조건 가져오면 된다. 상기 과정(44)에서 가져온 데이터베이스 객체를 Oi라고 표시한다.Meanwhile, if the corresponding object exists (42), the object to be joined next is fetched from the database using the access path given in the object indicated by the pointer Ptr (44). At this time, if the object indicated by the pointer Ptr is the first object of the execution plan, it is not necessary to bring the object to be joined. The database object obtained in step 44 is marked Oi.
이후, 객체 Oi가 해당 노드에 부과된 조건을 만족하는지를 검사한다(45). 이때, 노드에 부과된 조건은 포인터(Ptr)의 조건(conditions) 필드를 따라가서 찾으며, 조건 테이블(CondTable)의 다음(next) 필드가 널(null)이 될 때까지 조건을 검사하여 모든 조건을 만족하는지 확인한다(45). 모든 조건을 만족하는 객체를 찾을 때까지 객체를 읽어와서 검사하는 과정(44,45)을 반복한다. 객체 Oi가 모든 조건을 만족한다면 객체 Oi를 결과 객체를 저장한 배열인 result[k++]에 저장하고(46), 포인터(Ptr)가 실행계획 테이블의 다음 객체인 다음(next)을 지시하도록 재지정하고(47), 포인터가 널인지를 검사하는 과정(42)으로 분기하여 실행을 계속한다.Then, it is checked whether the object Oi satisfies the condition imposed on the node (45). At this time, the condition imposed on the node is found by following the conditions field of the pointer (Ptr), and all conditions are examined by checking the condition until the next field of the CondTable becomes null. Check if it is satisfied (45). The process of reading and inspecting an object is repeated until the object that satisfies all conditions is found (44, 45). If the object Oi satisfies all the conditions, store the object Oi in result [k ++], the array that stores the result objects (46), and redirect the pointer (Ptr) to point to the next object, the next object in the execution table. (47), the process proceeds to step 42 to check whether the pointer is null and continues execution.
상술한 바와 같은 본 발명의 방법은 프로그램으로 구현되어 컴퓨터로 읽을 수 있는 기록매체(씨디롬, 램, 롬, 플로피 디스크, 하드 디스크, 광자기 디스크 등)에 저장될 수 있다.The method of the present invention as described above may be implemented as a program and stored in a computer-readable recording medium (CD-ROM, RAM, ROM, floppy disk, hard disk, magneto-optical disk, etc.).
이상에서 설명한 본 발명은 전술한 실시예 및 첨부된 도면에 의해 한정되는 것이 아니고, 본 발명의 기술적 사상을 벗어나지 않는 범위 내에서 여러 가지 치환, 변형 및 변경이 가능하다는 것이 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 있어 명백할 것이다.The present invention described above is not limited to the above-described embodiments and the accompanying drawings, and various substitutions, modifications, and changes can be made in the art without departing from the technical spirit of the present invention. It will be apparent to those of ordinary knowledge.
상기와 같은 본 발명은, 주기억 장치 데이터베이스 관리시스템(MDBMS)의 질의 최적화 모듈 개발시 실행계획을 압축하여 저장한 후에 n회 재실행할 수 있도록 하므로써, 질의 최적화 자체에 걸리는 시간을 줄일 수 있고, 주기억 장치 데이터베이스 관리시스템의 성능을 향상시켜 주기억 장치 데이터베이스 관리시스템의 실시간성을 증대시킬 수 있으며, 이에 따라 전체 시스템의 성능 향상에 기여할 수 있으며, 저장 공간도 주기억 장치 데이터베이스 관리시스템(MDBMS)임을 감안하여 최소화할 수 있는 효과가 있다.As described above, the present invention can reduce the time required for the query optimization itself by compressing and storing the execution plan in the development of the query optimization module of the main memory device database management system (MDBMS), and executing it n times. By improving the performance of the database management system, it is possible to increase the real-time performance of the main memory database management system, thereby contributing to the improvement of the overall system, and minimizing the storage space considering the main memory database management system (MDBMS). It can be effective.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1019980052255A KR100315601B1 (en) | 1998-12-01 | 1998-12-01 | Storing and re-execution method of object-oriented sql evaluation plan in dbms |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1019980052255A KR100315601B1 (en) | 1998-12-01 | 1998-12-01 | Storing and re-execution method of object-oriented sql evaluation plan in dbms |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20000037624A KR20000037624A (en) | 2000-07-05 |
KR100315601B1 true KR100315601B1 (en) | 2002-01-12 |
Family
ID=19560762
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1019980052255A KR100315601B1 (en) | 1998-12-01 | 1998-12-01 | Storing and re-execution method of object-oriented sql evaluation plan in dbms |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR100315601B1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100520301B1 (en) * | 2001-10-13 | 2005-10-13 | 한국전자통신연구원 | Object-relational database management system and method for deleting class instance for the same |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100424557B1 (en) * | 2001-07-28 | 2004-03-27 | 엘지전자 주식회사 | a Memory Resident LDAP System and a Management Method thereof |
-
1998
- 1998-12-01 KR KR1019980052255A patent/KR100315601B1/en not_active IP Right Cessation
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100520301B1 (en) * | 2001-10-13 | 2005-10-13 | 한국전자통신연구원 | Object-relational database management system and method for deleting class instance for the same |
US7076490B2 (en) | 2001-10-13 | 2006-07-11 | Electronics And Telecommunications Research Institute | Object-relational database management system and method for deleting class instance for the same |
Also Published As
Publication number | Publication date |
---|---|
KR20000037624A (en) | 2000-07-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Xie et al. | Simba: Efficient in-memory spatial analytics | |
US6581055B1 (en) | Query optimization with switch predicates | |
US7275056B2 (en) | System and method for transforming queries using window aggregation | |
Bruno et al. | To tune or not to tune? a lightweight physical design alerter | |
US6021405A (en) | System and method for optimizing database queries with improved performance enhancements | |
US5864840A (en) | Evaluation of existential and universal subquery in a relational database management system for increased efficiency | |
US8332389B2 (en) | Join order for a database query | |
US5963932A (en) | Method and apparatus for transforming queries | |
US5696960A (en) | Computer program product for enabling a computer to generate uniqueness information for optimizing an SQL query | |
JP3640346B2 (en) | Set predicates and retrieval in database management systems | |
US8423569B2 (en) | Decomposed query conditions | |
US6134546A (en) | Method and computer program product for implementing subquery join | |
US20040220908A1 (en) | Information retrieval system and method for optimizing queries having maximum or minimum function aggregation predicates | |
US6999967B1 (en) | Semantically reducing the number of partitions involved in a join | |
Zou et al. | Lachesis: automatic partitioning for UDF-centric analytics | |
Li et al. | LotusSQL: SQL engine for high-performance big data systems | |
US7974968B2 (en) | Direct call threaded code | |
US6260037B1 (en) | Method and computer program product for implementing skip key processing for database grouping queries involving aggregate operations by using one or more indices | |
KR100315601B1 (en) | Storing and re-execution method of object-oriented sql evaluation plan in dbms | |
Roelleke et al. | Modelling retrieval models in a probabilistic relational algebra with a new operator: the relational Bayes | |
Pereira et al. | Evaluation of conditional preference queries | |
Georgiadis et al. | Cost based plan selection for XPath | |
Kvet et al. | Enhancing Analytical Select Statements Using Reference Aliases | |
Xu | Efficiency in the Columbia database query optimizer | |
Kader et al. | Overview of query optimization in XML database systems |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E902 | Notification of reason for refusal | ||
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant | ||
FPAY | Annual fee payment |
Payment date: 20101101 Year of fee payment: 10 |
|
LAPS | Lapse due to unpaid annual fee |