KR101780041B1 - Method and apparatus for improving throughput of database - Google Patents

Method and apparatus for improving throughput of database Download PDF

Info

Publication number
KR101780041B1
KR101780041B1 KR1020160066374A KR20160066374A KR101780041B1 KR 101780041 B1 KR101780041 B1 KR 101780041B1 KR 1020160066374 A KR1020160066374 A KR 1020160066374A KR 20160066374 A KR20160066374 A KR 20160066374A KR 101780041 B1 KR101780041 B1 KR 101780041B1
Authority
KR
South Korea
Prior art keywords
query
cache
region
result
data
Prior art date
Application number
KR1020160066374A
Other languages
Korean (ko)
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 KR1020160066374A priority Critical patent/KR101780041B1/en
Application granted granted Critical
Publication of KR101780041B1 publication Critical patent/KR101780041B1/en

Links

Images

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/2455Query execution
    • G06F16/24552Database cache management
    • G06F17/3048
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2219Large Object storage; Management thereof
    • 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/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • G06F16/24539Query rewriting; Transformation using cached or materialised query results
    • 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/2455Query execution
    • G06F16/24553Query execution of query operations
    • G06F17/30318
    • G06F17/30457
    • G06F17/30483

Landscapes

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

Abstract

Disclosed are a method for increasing processing speed of a database and an apparatus thereof. The database apparatus, when receiving a query for a time series database, identifies whether a cache for the query exists, identifies a first area of the time series database in which the query is to be executed and a second area of the time series database for the cache, and obtains a final result for the query by using a result stored in the cache when the second area is placed in the first area.

Description

데이터베이스의 처리 속도 향상 방법 및 그 장치{Method and apparatus for improving throughput of database}[0001] The present invention relates to a method and an apparatus for improving processing speed of a database,

본 발명은 캐시를 이용하여 데이터베이스의 처리 속도를 향상시키는 방법 및 그 장치에 관한 것이다.The present invention relates to a method and apparatus for improving the processing speed of a database using a cache.

데이터베이스를 관리하기 위하여 쿼리(Query)를 사용하는데, 일반적으로 SQL(Structured Query Language)에는 삽입(INSERT) 쿼리, 삭제(DELETE) 쿼리, 갱신(UPDATE) 쿼리, 선택(SELECT) 쿼리 등이 존재한다. 삽입, 삭제, 갱신 쿼리 등은 모두 데이터베이스에 저장된 데이터의 실질적인 변화를 발생시키나 선택 쿼리는 특정 데이터의 조회나 통계적인 연산 등을 수행하는 것으로서, 데이터베이스에 저장된 데이터의 실질적인 변화를 발생시키지 않는다.In order to manage a database, a query is used. Generally, an INSERT query, a DELETE query, an UPDATE query, and a SELECT query exist in a SQL (Structured Query Language). Insertion, deletion, and update queries all cause a substantial change in the data stored in the database, whereas the select query performs specific data retrieval or statistical computation, and does not cause any substantial change in the data stored in the database.

종래의 DBMS(Database Management System)에서, 쿼리가 발생하면 쿼리에서 지정한 테이블의 해당 범위 내 모든 데이터를 읽은 후 쿼리에 대한 최종 결과를 산출한다. 데이터베이스의 데이터가 갱신, 삽입 또는 삭제되었다면, 이전과 동일한 쿼리라고 하여도 데이터베이스의 해당 범위 내 모든 데이터를 다시 읽어 쿼리를 수행하여야 한다. 다시 말해, 일부 데이터가 변경된 경우에도 전체 데이터를 매번 다시 읽어 동일한 쿼리를 반복수행하므로 시스템 전체에 매번 동일한 부하를 발생시킨다. In a conventional DBMS (Database Management System), when a query is generated, all the data in the corresponding range of the table specified in the query is read, and the final result of the query is calculated. If the data in the database is updated, inserted, or deleted, it is necessary to read all the data in the corresponding range of the database and query the same as the previous one. In other words, even if some data is changed, the entire data is read again every time, and the same query is repeated, which causes the same load to be incurred all over the system.

특허출원번호 10-2012-0051558Patent Application No. 10-2012-0051558

본 발명이 이루고자 하는 기술적 과제는, 반복 수행되는 쿼리에 대해 매번 데이터베이스의 해당 범위 내 모든 데이터를 읽을 필요 없이 변경된 일부 데이터만을 읽어 쿼리를 수행하도록 하여 데이터베이스의 처리 속도를 향상시키는 방법 및 그 장치를 제공하는 데 있다. SUMMARY OF THE INVENTION The present invention provides a method and system for improving the processing speed of a database by performing a query by reading only a part of changed data without having to read all the data in the corresponding range of the database every time the query is repeatedly executed I have to.

상기의 기술적 과제를 달성하기 위한, 본 발명에 따른 데이터베이스의 처리 속도 향상 방법의 일 예는, 시계열 데이터베이스에 대한 쿼리를 수신하는 단계; 상기 쿼리에 대한 캐시가 존재하는지 파악하는 단계; 상기 쿼리가 수행될 상기 시계열 데이터베이스의 제1 영역과 상기 캐시에 대한 상기 시계열 데이터베이스의 제2 영역을 파악하는 단계; 및 상기 제1 영역 내에 상기 제2 영역이 위치하면, 상기 캐시에 저장된 결과를 이용하여 상기 쿼리에 대한 최종 결과를 얻는 단계;를 포함한다.According to an aspect of the present invention, there is provided a method for improving a processing speed of a database, the method comprising: receiving a query for a time series database; Determining whether a cache for the query exists; Determining a first area of the time series database to which the query is to be performed and a second area of the time series database for the cache; And if the second region is located within the first region, using the results stored in the cache to obtain a final result for the query.

상기의 기술적 과제를 달성하기 위한, 본 발명에 따른 질의처리장치의 일 예는, 시계열 데이터베이스에 대한 쿼리를 수신하는 쿼리수신부; 상기 쿼리에 대한 캐시가 존재하는지 파악하는 캐시검색부; 및 상기 쿼리가 수행될 상기 시계열 데이터베이스의 제1 영역 내에 상기 캐시에 대한 상기 시계열 데이터베이스의 제2 영역이 위치하면, 상기 캐시에 저장된 결과를 이용하여 상기 쿼리에 대한 최종 결과를 얻는 쿼리수행부;를 포함한다.According to an aspect of the present invention, there is provided an apparatus for processing a query, the apparatus comprising: a query receiver for receiving a query for a time series database; A cache search unit for determining whether a cache for the query exists; And a query execution unit for obtaining a final result of the query using a result stored in the cache if a second area of the time series database for the cache is located in a first area of the time series database to be queried .

본 발명에 따르면, 쿼리가 반복 수행되는 경우 매번 시계열 데이터베이스의 모든 데이터를 읽어 쿼리를 수행할 필요없이 이전에 수행한 쿼리 결과를 활용하여 쿼리 수행 시간을 크게 단축할 수 있다. According to the present invention, when a query is repeatedly performed, it is possible to greatly reduce the query execution time by utilizing previously performed query results without having to read all the data in the time series database every time and perform the query.

데이터가 순차적으로 쌓이는 시계열 데이터베이스에서 특정 쿼리를 주기적으로 실행하면 전체 데이터양에 관계없이 결과를 얻는데 걸리는 시간을 일정하게 유지할 수 있으므로, 빅데이터와 같은 대용량 데이터베이스에 적합하게 사용될 수 있다. In a time series database in which data is sequentially accumulated, periodic execution of a specific query can be used suitably for a large database such as big data because the time taken to obtain the result can be kept constant regardless of the total amount of data.

도 1은 본 발명에 따른 데이터베이스 처리 속도 향상을 위한 개략적인 구조의 일 예를 도시한 도면,
도 2는 본 발명에 따른 질의처리장치의 일 실시 예의 구성을 도시한 도면,
도 3은 본 발명에 따른 캐시의 일 실시 예의 구성을 도시한 도면,
도 4는 쿼리와 캐시에 대한 시계열 데이터베이스의 각 영역의 일 예를 도시한 도면,
도 5는 본 발명에 따른 캐시의 중간 연산 결과를 이용하여 쿼리의 최종 결과를 얻는 과정의 일 예를 도시한 도면,
도 6은 본 발명에 따른 데이터베이스의 처리 속도 향상 방법의 일 실시 예의 흐름을 도시한 도면, 그리고,
도 7은 본 발명에 따른 쿼리에 대한 캐시 검색 방법의 일 실시 예의 흐름을 도시한 도면이다.
FIG. 1 is a diagram illustrating an example of a schematic structure for improving a database processing speed according to the present invention.
2 is a diagram showing a configuration of an embodiment of a query processing apparatus according to the present invention,
3 illustrates a configuration of an embodiment of a cache according to the present invention,
4 shows an example of each area of a time series database for a query and a cache,
5 is a diagram illustrating an example of a process of obtaining a final result of a query using a result of intermediate calculation of a cache according to the present invention.
6 is a flowchart illustrating a method of improving the processing speed of a database according to an embodiment of the present invention,
FIG. 7 is a flowchart illustrating a cache search method according to an embodiment of the present invention.

이하에서, 첨부된 도면들을 참조하여 본 발명에 따른 데이터베이스 처리 속도 향상 방법 및 그 장치에 대해 상세히 설명한다. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, a database processing speed enhancement method and apparatus according to the present invention will be described in detail with reference to the accompanying drawings.

도 1은 본 발명에 따른 데이터베이스 처리 속도 향상을 위한 개략적인 구조의 일 예를 도시한 도면이다.FIG. 1 is a diagram showing an example of a schematic structure for improving the database processing speed according to the present invention.

도 1을 참조하면, 질의처리장치(100)는 외부로부터 쿼리를 수신하면, 시계열 데이터베이스(110)로부터 쿼리가 지정한 범위의 데이터를 읽어 쿼리를 수행한 후 최종결과를 출력한다. Referring to FIG. 1, upon receiving a query from the outside, the query processing apparatus 100 reads data from a range specified by a query from the time series database 110, performs a query, and outputs a final result.

시계열 데이터베이스(110)는 시계열적으로 발생하는 데이터를 실시간으로 저장하고 분석하는 데이터베이스를 의미한다. 일반적으로 시계열 데이터베이스(110)는 로그성 데이터를 저장하므로 데이터가 변경될 필요가 거의 없어 읽기 전용이 대부분이다.The time series database 110 is a database for storing and analyzing data generated in a time series in real time. Generally, the time series database 110 stores log-likelihood data, so that it is almost read-only that data need not be changed.

시계열 데이터베이스(110)는 데이터의 생성 시점을 기준으로 과거에서 현재시간 순으로 데이터를 저장한다. 시계열 데이터베이스는 테이블에 저장되는 데이터에 대해 시간에 따라 순차적으로 증가 또는 감소하는 형태의 데이터 식별자(RID)를 부여할 수 있다. 예를 들어, 데이터 식별자는 년월일시간분초(나노초) 등과 같은 시간 기반으로 생성될 수 있다. 이 경우에, 데이터 식별자만으로 특정 시구간에 대한 데이터를 용이하게 파악할 수 있다. The time series database 110 stores data in the order of the past to the present time based on the generation time of the data. The time series database may assign a data identifier (RID) to the data stored in the table in the form of increasing or decreasing sequentially with time. For example, the data identifier may be generated on a time basis, such as year, month, day, hour, minute, nanosecond, and so on. In this case, data for a specific time period can be easily grasped only by the data identifier.

데이터 식별자가 순차적인 값인 경우, 시계열 데이터베이스(110)는 테이블 헤더에 가장 오래전에 생성된 데이터의 식별자와 가장 최근에 생성된 데이터의 식별자를 유지하여 테이블을 관리할 수 있다. 본 실시 예에서, 데이터의 일 예로, 테이블에 저장되는 레코드가 있다. When the data identifier is a sequential value, the time series database 110 can manage the table by keeping the identifier of the data generated the longest ago in the table header and the identifier of the most recently generated data. In this embodiment, as an example of data, there is a record stored in a table.

질의처리장치(100)는 쿼리를 수행하면, 해당 쿼리가 수행된 시계열 데이터베이스(110)의 데이터 영역에 대한 정보와 함께 쿼리 수행 결과(최종 결과 또는 중간 연산 결과 등)를 캐시에 저장한다. 데이터 식별자가 순차적으로 증가하는 값인 경우에, 질의처리장치(100)는 테이블 식별자, 해당 데이터 영역의 시작 시점의 데이터 식별자(BeginRID) 및 마지막 시점의 데이터 식별자(EndRID)를 데이터 영역에 대한 정보로 저장할 수 있다. 이때, 캐시 저장 이후 새롭게 추가된 데이터는 마지막 시점의 데이터 식별자(EndRID)로부터 순차적으로 증가한 값의 식별자를 가지므로 용이하게 파악할 수 있다. When the query processing apparatus 100 executes the query, the query execution result (the final result or the intermediate calculation result, etc.) is stored in the cache together with the information about the data area of the time series database 110 in which the query is performed. In the case where the data identifiers are sequentially incrementing values, the query processing device 100 stores the table identifier, the data identifier (BeginRID) at the start time point of the data area and the data identifier (EndRID) at the last time point as information about the data area . At this time, the data newly added after the cache storage can be easily grasped since it has an identifier of a value sequentially increased from the last data ID (EndRID).

이전에 수행했던 쿼리와 동일한 쿼리가 발생하면 질의처리장치(100)는 쿼리가 지정한 시계열 데이터베이스(110)의 해당 영역의 데이터를 모두 읽는 것이 아니라, 이전 쿼리 수행 이후 변경된 부분(즉, 새로 추가된 데이터)만을 읽어 그 부분에 대해서만 쿼리를 수행하고 기존 부분은 캐시에 저장된 결과를 그대로 이용한다. 만약 이전 쿼리 수행 이후 변경된 부분이 없다면, 질의처리장치(100)는 시계열 데이터베이스(110)의 데이터를 전혀 읽을 필요 없이 캐시에 저장된 결과를 그대로 이용하면 된다. When the same query as the previously performed query is issued, the query processing apparatus 100 does not read all the data of the corresponding area of the time series database 110 designated by the query, but rather reads the changed part (i.e., ) To perform the query only for that part, and the existing part uses the results stored in the cache. If there is no changed part after the execution of the previous query, the query processing apparatus 100 may use the results stored in the cache without directly reading the data of the time series database 110 at all.

본 실시 예에 따른 캐시를 이용할 수 있는 경우는, 쿼리가 실질적인 데이터의 변경을 일으키는 쿼리(예를 들어, 삽입, 삭제, 갱신 쿼리 등)가 아니라, 실질적인 데이터의 변경 없이 조회나 통계 연산 등의 결과를 요청하는 쿼리(예를 들어, 선택 쿼리)가 발생하는 경우이다.When the cache according to the present embodiment is available, the query is not a query (for example, insert, delete, update query, etc.) causing actual data change, (E.g., a select query) occurs.

본 실시 예에서 사용될 수 있는 선택 쿼리의 일부 유형을 살펴보면 다음과 같다. Some types of select queries that can be used in this embodiment are as follows.

<유형 1>

SELECT 검색 대상 표현식
FROM 검색 대상 테이블 이름
WHERE 검색 조건 표현식
<Type 1>

SELECT search target expression
FROM Name of table to be searched
WHERE search condition expression

유형 1의 쿼리는 검색 대상 테이블에서 검색 조건을 실행하여 검색 대상 표현식에 해당하는 값들을 반환하는 쿼리이다. 이 경우, 검색 대상 데이터를 이용한 통계는 수행하지 않는다. 검색 대상 표현식은 테이블의 컬럼 자체이거나 컬럼들을 포함한 수식 등을 지정할 수 있다. A type 1 query is a query that executes a search condition on the table to be searched and returns values corresponding to the search target expression. In this case, statistics using search target data are not performed. The expression to be searched can be either a column of the table itself or an expression containing the columns.

유형 1의 쿼리는 통계 연산을 수행하지 않으므로, 질의처리장치(100)는 쿼리 수행의 최종 결과만을 캐시에 저장할 수 있다. 따라서 질의처리장치(100)가 다시 쿼리를 수행할 때, 캐시의 저장 시점 이후에 새롭게 추가된 데이터만을 시계열 데이터베이스(110)에서 읽은 후 캐시에 저장된 데이터의 결과와 함께 쿼리의 최종 결과로 출력한다. Since the type 1 query does not perform the statistical operation, the query processing device 100 can store only the final result of the query execution in the cache. Therefore, when the query processing apparatus 100 performs the query again, only the data newly added after the storage time of the cache is read in the time series database 110, and the result is output as the final result of the query together with the data stored in the cache.

<유형 2>

SELECT 집합 함수를 포함한 표현식
FROM 검색 대상 테이블 이름
WHERE 검색 조건절
<Type 2>

An expression that contains a SELECT set function
FROM Name of table to be searched
WHERE search condition

유형 2의 선택 쿼리는 검색 대상 조건을 만족하는 데이터를 검색한 이후 그 결과 집합에 대해서 집합 함수를 수행한 결과를 반환한다. 집합 함수는 결과 집합의 수를 세는 count, 결과 집합의 합계를 계산하는 sum 등이 있으며, 검색 조건을 만족하는 결과 집합 내 데이터 수가 여러 개이더라도 하나의 결과가 생성된다. The select query of type 2 retrieves the data satisfying the search condition and returns the result of performing the set function on the result set. The aggregate function includes a count that counts the number of result sets, a sum that computes the sum of the result sets, and so on. Even if there are several data in the result set that satisfies the search condition, one result is generated.

질의처리장치(100)는 유형 2의 쿼리를 수신하면, 캐시의 저장 시점 이후에 새롭게 추가된 데이터만을 읽어 집합 함수를 수행한 결과를 산출하고, 이 결과와 캐시에 저장된 집합 함수의 결과를 이용하여, 쿼리에 대한 최종 결과를 산출한다. 예를 들어, 쿼리가 테이블에 저장된 데이터 합계를 연산하는 것이라면, 질의처리장치(100)는 캐시의 저장 시점 이후 새롭게 테이블에 추가된 데이터에 대한 합계 연산을 수행하고, 이를 캐시에 저장된 합계와 합산하여 쿼리의 최종 결과를 산출한다. Upon receiving the query of type 2, the query processing apparatus 100 calculates a result of performing the aggregate function by reading only the newly added data after the storage time of the cache, and using the result and the result of the aggregate function stored in the cache , And produces the final result for the query. For example, if the query is to calculate the sum of data stored in the table, the query processing device 100 performs a sum operation on the data newly added to the table after the storage time of the cache, adds the sum to the total stored in the cache The final result of the query is computed.

검색 결과 집합을 특정 조건으로 그룹화하여 각 그룹별 통계 연산을 수행하기 위하여 'GROUP BY' 절과 집합 함수를 이용할 수 있다. 이에 대한 예가 다음 유형 3과 같다.The GROUP BY clause and the set function can be used to group the search result sets into specific conditions and perform statistical computation for each group. An example of this is the following type 3.

<유형 3>

SELECT 기준 표현식, 집계함수
FROM 대상 테이블
WHERE 검색 조건절
GROUP BY 기준 표현식
ORDER BY 순서 표현식
HAVING 집계합수 결과를 포함하는 조건절
<Type 3>

SELECT base expression, aggregate function
FROM destination table
WHERE search condition
GROUP BY criteria expression
ORDER BY sequence expression
HAVING conditional clause containing aggregate sum result

유형 3에서, SELECT 절은 검색을 원하는 기준 표현식과 통계 결과를 계산하는 집계함수를 포함한다. FROM 절은 검색 대상 테이블을 지정하고, WHERE 절은 검색 조건을 설정한다. GROUP BY 절은 집계 기준으로 사용할 표현식을 설정하고, ORDER BY 절은 통계값을 포함한 검색 결과의 표시 순서를 지정한다. 그리고 집계함수 결과로 결과 집합을 다시 제한하는 HAVING 절을 더 포함할 수 있다. In type 3, the SELECT clause contains an aggregate function that computes a statistical result and a base expression for which you want to search. The FROM clause specifies the table to be searched, and the WHERE clause sets the search conditions. The GROUP BY clause sets an expression to be used as an aggregation criterion, and the ORDER BY clause specifies the display order of search results including a statistic value. And a HAVING clause to restrain the result set as a result of the aggregate function.

질의처리장치(100)가 유형 3의 쿼리를 수신하면, 캐시의 저장 시점 이후에 새롭게 추가된 데이터에 대해서 그룹핑을 수행하여 해당 그룹에 연산을 수행한 후, 캐시에 저장된 각 그룹별 연산 결과를 이용하여 쿼리의 최종 결과를 산출한다. When the query processing apparatus 100 receives the query of type 3, it performs grouping on newly added data after the storage time of the cache, performs operation on the group, and then uses the operation result of each group stored in the cache To produce the final result of the query.

도 2는 본 발명에 따른 질의처리장치의 일 실시 예의 구성을 도시한 도면이다.2 is a diagram showing a configuration of an embodiment of a query processing apparatus according to the present invention.

도 2를 참조하면, 질의처리장치(100)는 쿼리수신부(200), 캐시검색부(210), 쿼리수행부(220), 적어도 하나 이상의 캐시(230,232,234) 및 캐시저장부(240)를 포함한다.2, the query processing apparatus 100 includes a query receiving unit 200, a cache searching unit 210, a query executing unit 220, at least one cache 230, 232 and 234, and a cache storing unit 240 .

쿼리수신부(200)는 쿼리를 수신한다. 쿼리수신부(200)는 수신한 쿼리가 삽입(insert), 삭제(delete) 또는 갱신(update) 쿼리와 같이 데이터의 실질적인 변화를 발생시키는 쿼리이면, 이 쿼리를 쿼리수행부(220)에 전달하여 종래의 방법으로 수행되도록 한다. 쿼리가 선택(select) 쿼리 등과 같이 데이터의 실질적인 변화를 발생시키는 것이 아니라 조회나 통계 연산 등을 요청하는 쿼리인 경우에, 쿼리수신부(200)는 해당 쿼리를 캐시검색부(210)에 전달한다.The query receiving unit 200 receives the query. The query receiving unit 200 transmits the query to the query execution unit 220 when the received query is a query that causes a substantial change in data such as an insert, delete, or update query, As shown in FIG. The query receiving unit 200 transmits the query to the cache search unit 210 when the query is a query such as a select query that does not cause a substantial change in data but requests a query or a statistical operation.

캐시검색부(210)는 쿼리수신부(200)로부터 전달받은 쿼리에 대한 캐시가 존재하는지 파악한다. 캐시검색부(210)는 쿼리에 대한 캐시가 존재하는지 파악하기 위하여 동일한 쿼리가 저장된 캐시를 검색하는데, 이때 쿼리 그 자체를 비교하는 경우 수십 byte 이상의 문자열을 서로 비교하여야 하므로 검색시간이 많이 걸릴 수 있다. 따라서 캐시검색부(210)는 쿼리에 대한 해시값을 기초로 캐시를 검색하는 것이 바람직하다. 쿼리에 대한 캐시의 검색 과정에 대해서는 도 7에 도시되어 있다.The cache search unit 210 determines whether a cache for the query received from the query receiving unit 200 exists. The cache search unit 210 searches the cache in which the same query is stored to determine whether there is a cache for the query. In this case, when comparing the queries themselves, . Therefore, the cache search unit 210 preferably searches the cache based on the hash value for the query. The search process of the cache for the query is shown in FIG.

쿼리에 대한 캐시가 존재하지 아니하면, 캐시검색부(210)는 해당 쿼리를 쿼리수행부(220)에게 전달하여 종래 방법으로 쿼리가 수행될 수 있도록 한다. If there is no cache for the query, the cache search unit 210 transmits the query to the query execution unit 220 so that the query can be performed by the conventional method.

쿼리에 대한 캐시가 존재하면, 캐시검색부(210)는 현 쿼리가 수행될 시계열 데이터베이스의 제1 영역과 캐시에 대한 시계열 데이터베이스의 제2 영역을 파악한다. 캐시검색부(210)는 제2 영역이 제1 영역 내에 위치하고 제2 영역의 데이터가 캐시 저장 이후 변경(예를 들어, 삭제나 갱신 등)되지 않았다면 캐시에 저장된 결과를 쿼리수행부(220)에게 전달한다. If there is a cache for the query, the cache search unit 210 grasps the first area of the time series database to be subjected to the current query and the second area of the time series database for the cache. If the second area is located in the first area and the data of the second area is not changed (for example, deleted or updated) after the cache is stored, the cache search unit 210 transmits the result stored in the cache to the query execution unit 220 .

본 실시 예는, 제2 영역에 속한 데이터가 제1 영역에 포함되는지 여부는 각 영역에 속한 데이터를 일일이 비교하는 것이 아니라, 제1 영역에서 가장 오래된 데이터의 식별자(BeginRID_1)와 가장 최근의 데이터 식별자(EnDRID_1)를 파악하고, 제2 영역에서 가장 오래된 데이터의 식별자(BeginRID_2)와 가장 최근의 데이터의 식별자(EndRID_2)를 비교하여 용이하게 파악할 수 있다. 예를 들어, 데이터 식별자가 데이터 생성시점에 따라 순차적으로 증가하는 경우라면, (BeginRID_1<=BeginRID_2) & (EndRID_1>=EndRID_2)의 관계이면 제2 영역이 제1 영역에 속한다. Whether or not the data belonging to the second area is included in the first area is determined by comparing the data of the oldest data in the first area (BeginRID_1) and the latest data identifier (EnDRID_1), and can easily grasp the identifier (BeginRID_2) of the oldest data in the second area and the identifier (EndRID_2) of the latest data in the second area. For example, if the data identifiers sequentially increase according to the data generation time, the second area belongs to the first area if (BeginRID_1 <= BeginRID_2) & (EndRID_1> = EndRID_2).

또한, 제2 영역에 속한 데이터가 변경되었는지 여부는, 캐시 저장 이후 데이터의 삭제 또는 갱신 등이 발생한 경우, 삭제 또는 갱신 등이 발생한 데이터의 식별자가 제2 영역의 데이터 식별자의 구간 내에 위치하였는지를 기초로 용이하게 파악할 수 있다. 예를 들어, 삭제된 데이터 식별자(RID_del)가 제2 영역의 식별자 구간 사이에 위치한 경우, 즉 BeginRID_2 <= RID_del <= EndRID_2 이면 제2 영역의 데이터가 변경된 경우이다.Whether or not the data belonging to the second area has been changed may be determined based on whether the identifier of the data in which deletion or update has occurred is located within the interval of the data identifier of the second area It can be easily grasped. For example, when the deleted data identifier (RID_del) is located between the identifier intervals of the second area, that is, when BeginRID_2 <= RID_del <= EndRID_2, the data of the second area is changed.

쿼리수행부(220)는 캐시검색부(210)로부터 캐시에 저장된 결과를 이용하여 쿼리에 대한 최종 결과를 구한다. 예를 들어, 현 쿼리의 제1 영역과 캐시의 제2 영역이 동일하면, 쿼리수행부(220)는 시계열 데이터베이스에 대해 쿼리를 수행할 필요없이 캐시에 저장된 결과를 현 쿼리에 대한 최종 결과로 바로 출력한다. 다른 예로, 도 4와 같이 제2 영역이 제1 영역의 일부인 경우에, 쿼리수행부(220)는 제1 영역과 제2 영역의 차이 영역에 대해서 쿼리를 수행하고, 그 수행 결과와 캐시에 저장된 결과를 이용하여 현 쿼리에 대한 최종 결과를 구한다. 제2 영역이 제1 영역의 일부인 경우에 쿼리의 최종 결과를 구하는 구체적인 방법은 도 4 및 도 5에서 다시 설명한다. The query execution unit 220 obtains the final result of the query from the cache search unit 210 using the result stored in the cache. For example, if the first area of the current query and the second area of the cache are the same, then the query execution unit 220 does not need to perform a query on the time series database, Output. As another example, when the second area is a part of the first area as shown in FIG. 4, the query execution unit 220 performs a query on the difference area between the first area and the second area, Use the result to get the final result for the current query. A specific method for obtaining the final result of the query in the case where the second region is a part of the first region will be described again in FIG. 4 and FIG.

캐시저장부(240)는 쿼리수행부(220)에 의해 수행된 쿼리의 수행 결과를 캐시에 저장한다. 앞서 든 예에서 제1 영역과 제2 영역이 일치하여, 캐시에 저장된 결과를 그대로 쿼리의 최종 결과가 출력한 경우에는 이미 동일한 캐시가 존재하므로 다시 저장할 필요는 없다. The cache storage unit 240 stores the execution result of the query performed by the query execution unit 220 in the cache. In the above example, if the first region and the second region coincide with each other, and the final result of the query outputs the results stored in the cache, there is no need to store them again because the same cache exists.

실시 예에 따라, 캐시저장부(240)는 쿼리 수행 결과를 항상 저장하는 것이 아니라, 캐시를 사용하는 것이 좀 더 효율적인 경우에만 캐시를 저장할 수 있다. 쿼리에 대한 최종 결과와 중간 연산 결과를 저장하는 조건은 서로 상이할 수 있다.According to the embodiment, the cache storage unit 240 may store the cache only when it is more efficient to use the cache, rather than always storing the query execution result. The final result for the query and the condition for storing the intermediate result may differ.

예를 들어, 중간 연산 결과의 저장은, 캐시를 복원하는데 사용되는데 드는 비용이 실제 쿼리를 처음부터 수행하는데 드는 비용보다 작을 때 저장한다. 예를 들어, 도 1에서 살펴본 쿼리의 유형 중 <유형 3>과 같이 각 그룹별 집합 함수의 결과가 연산되는 경우에 이를 중간 연산 결과로 저장할 수 있다. For example, the storage of intermediate results is stored when the cost of being used to restore the cache is less than the cost of performing the actual query from scratch. For example, when the result of a set function for each group is calculated as shown in <Type 3> among the types of queries shown in FIG. 1, it can be stored as an intermediate result.

최종 결과의 저장은, 쿼리의 수행 시간이 기 설정된 일정 시간 이상인 경우에 저장한다. 너무 짧은 시간이 걸리는 쿼리는 직접 수행하면 되므로 캐시에 저장하지 않는 것이 바람직하다. 다른 예로, 쿼리의 최종 결과가 기 설정된 메모리 크기를 초과하는 경우에 메모리 사용에 따른 시스템 부하를 방지하기 위하여 저장하지 않는 것이 바람직하다. The final result is stored when the execution time of the query is longer than a predetermined time. Queries that take too little time should be done directly, so it is better not to store them in the cache. As another example, when the final result of a query exceeds a preset memory size, it is preferable not to store it in order to prevent a system load due to memory use.

도 3은 본 발명에 따른 캐시의 일 실시 예의 구성을 도시한 도면이다. 3 is a diagram showing a configuration of an embodiment of a cache according to the present invention.

도 3을 참조하면, 캐시(230)는 쿼리 수행의 최종 결과를 저장하는 최종 결과 캐시(300)과 쿼리 수행의 중간 연산 결과를 저장하는 연산 결과 캐시(350)로 구분될 수 있다. Referring to FIG. 3, the cache 230 can be divided into a final result cache 300 storing a final result of query execution, and an operation result cache 350 storing an intermediate operation result of query execution.

캐시(230)는 쿼리 필드(305), LRU 리스트 필드(310), 해시 리스트 필드(315), 제1 영역정보 필드(320), 관리정보 필드(325), 최종결과 필드(330), 제2 영역정보 필드(355), 중간연산결과 필드(360)를 포함한다. 본 실시 예의 캐시는 본 발명의 이해를 돕기 위한 하나의 예이며, 캐시의 구조가 반드시에 이에 한정되는 것은 아니며 실시 예에 따라 다양하게 변형 가능하다.The cache 230 includes a query field 305, an LRU list field 310, a hash list field 315, a first region information field 320, a management information field 325, a final result field 330, An area information field 355, and an intermediate calculation result field 360. [ The cache of this embodiment is an example for helping understanding of the present invention, and the structure of the cache is not necessarily limited to this, and can be variously modified according to the embodiment.

쿼리 필드(305)는 현 캐시에 저장된 최종 결과 또는 중간 연산 결과를 산출하는데 사용된 쿼리를 포함한다. The query field 305 contains the query used to produce the final result or intermediate result stored in the current cache.

LRU 리스트 필드(310)는 복수 개의 캐시를 일정 저장 공간 내에서 LRU(Least-Recently-Used) 방식으로 저장 관리하기 위하여, 최근 사용 순으로 정렬된 캐시 리스트를 포함한다. 예를 들어, 저장 공간에 최대 100개의 캐시가 저장 가능한 상태에서, 새로운 캐시가 생성되면, 기존 100개의 캐시 중 LRU 리스트를 참조하여 가장 오랫동안 사용하지 않은 캐시가 삭제되고, 새롭게 생성된 캐시가 LRU 리스트에 추가된다.The LRU list field 310 includes a cache list sorted in order of recent use in order to store and manage a plurality of caches in a certain storage space in a Least-Recently-Used (LRU) manner. For example, when a new cache is created in a state where a maximum of 100 caches can be stored in the storage space, a cache that has not been used for the longest time is deleted by referring to the LRU list among 100 existing caches, Lt; / RTI &gt;

해시 리스트 필드(315)는 해시값은 동일하나 쿼리가 상이한 적어도 하나 이상의 캐시 리스트를 포함한다. 예를 들어, 제1 캐시는 제1 쿼리에 관한 것이고, 제2 캐시는 제2 쿼리에 관한 것이나, 제1 쿼리와 제2 쿼리에 대한 해시값이 동일할 수 있다. 질의처리장치는 해시값이 동일한 캐시를 찾으면, 그 캐시의 해시 리스트 필드(315)를 참조하여 동일한 해시값을 가진 다른 캐시를 용이하게 찾을 수 있다.The hash list field 315 includes at least one cache list in which the hash value is the same but the query is different. For example, the first cache is for a first query, the second cache is for a second query, but the hash values for the first query and the second query may be the same. When the query processing device finds a cache having the same hash value, it can easily find another cache having the same hash value by referring to the hash list field 315 of the cache.

제1 및 제2 영역정보 필드(320,355)는 쿼리 필드(305)에 최종 결과 또는 중간 연산 결과를 얻기 위하여 참조한 시계열 데이터베이스의 데이터 영역 정보를 나타낸다. 예를 들어, 영역정보 필드는 테이블 식별자, 데이터 영역의 시작 시점의 데이터 식별자(BeginRID) 및 마지막 시점의 데이터 식별자(EndRID)를 포함할 수 있다. The first and second area information fields 320 and 355 indicate data area information of a time series database referenced in order to obtain a final result or an intermediate calculation result in the query field 305. For example, the area information field may include a table identifier, a data identifier at the beginning of the data area (BeginRID), and a data identifier at the end (EndRID).

관리정보 필드(325)는 쿼리를 요청한 사용자 정보, 해당 캐시가 참조된 횟수, 참조 일자 등 실시 예에 따라 다양한 정보를 포함할 수 있다. 관리정보 필드(325)에 저장된 참조 횟수 및 참조 일자를 이용하여 캐시를 LRU 방식으로 관리할 수 있다. The management information field 325 may include various information according to the embodiment such as the user information requesting the query, the number of times the corresponding cache is referenced, and the reference date. The cache can be managed by the LRU method using the reference count stored in the management information field 325 and the reference date.

최종 결과 필드(330)는 쿼리를 수행한 최종 결과를 포함한다. The final result field 330 contains the final result of performing the query.

중간 연산 결과 필드(360)는 쿼리의 최종 결과를 얻기 위하여 수행한 연산 결과를 저장한다. 예를 들어, 쿼리가 도 1에서 살핀 <유형 3>과 같은 경우, 중간 연산 결과 필드는 각 그룹별 집합 연산의 결과를 리스트 형태로 저장한다. The intermediate result field 360 stores the result of the operation performed to obtain the final result of the query. For example, if the query is the same as in FIG. 1 (type 3), the intermediate result field stores the result of the group operation for each group in the form of a list.

도 4는 쿼리와 캐시에 대한 시계열 데이터베이스의 각 영역의 일 예를 도시한 도면이다. 4 is a diagram showing an example of each area of a time series database for a query and a cache.

도 4를 참조하면, 쿼리가 수행될 시계열 데이터베이스(400)의 제1 영역과 캐시에 대한 시계열 데이터베이스의 제2 영역이 서로 상이할 수 있다. 다시 말해, 캐시에 저장된 최종 결과 또는 중간 연산 결과는 시계열 데이터베이스의 제2 영역(예를 들어, 데이터 식별자 RID1~RID2 사이의 데이터)에 대한 쿼리의 수행 결과이므로, 캐시에 저장된 결과가 현재 수행할 쿼리의 수행 결과로 그래도 사용될 수는 없다.Referring to FIG. 4, the first area of the time series database 400 where the query is to be performed and the second area of the time series database of the cache may be different from each other. In other words, since the final result or the intermediate result stored in the cache is the result of performing the query on the second area of the time series database (for example, data between the data identifiers RID1 to RID2) Can not be used as a result of the execution of.

캐시 저장 이후 제2 영역에 대한 데이터에 변화가 없다면, 제2 영역에 대해서는 캐시에 저장된 결과를 그대로 이용할 수 있다. 따라서 질의처리장치는 시계열 데이터베이스의 제1 영역 전체(예를 들어, 데이터 식별자 RID1~RID3 사이의 데이터)를 다시 읽어 쿼리를 수행하는 것이 아니라, 제1 영역과 제2 영역과 차이 영역(예를 들어, 데이터 식별자 RID2~RID3 사이의 데이터)에 대한 데이터만을 읽어 쿼리를 수행하고, 제2 영역에 대해서는 캐시에 저장된 쿼리 수행 결과를 그대로 활용함으로써 쿼리 수행 속도를 향상시킬 수 있다.If there is no change in the data for the second area after cache storage, the results stored in the cache can be used for the second area. Therefore, the query processing apparatus does not read the entire first region of the time series database (for example, the data between the data identifiers RID1 to RID3) again to perform the query, but instead performs the query by comparing the first region and the second region with the difference region , Data between the data identifiers RID2 to RID3), and the query execution speed can be improved by using the query execution result stored in the cache as it is for the second area.

본 실시 예는 캐시 저장 이후 새롭게 데이터가 추가되는 경우를 도시하고 있으나, 반대로 캐시에 대한 제2 영역 이전의 과거 데이터를 더 포함하는 쿼리가 수행되는 경우에 본 발명이 그대로 적용될 수 있다. 또는 제2 영역의 과거 데이터 및 새롭게 추가된 데이터를 더 포함되는 쿼리가 수행되는 경우에도 본 발명이 적용될 수 있다. Although the present embodiment shows a case where data is newly added after cache storage, the present invention can be applied as it is when a query further including past data before the second region for the cache is performed. Alternatively, the present invention can be applied to a case where a query further including past data and newly added data of the second area is performed.

도 5는 본 발명에 따른 캐시의 중간 연산 결과를 이용하여 쿼리의 최종 결과를 얻는 과정의 일 예를 도시한 도면이다.5 is a diagram illustrating an example of a process of obtaining a final result of a query using the intermediate calculation result of the cache according to the present invention.

도 4 및 도 5를 함께 참조하면, 캐시에 저장된 제2 영역이 쿼리가 수행될 제1 영역의 일부인 경우에, 질의처리장치는 쿼리를 분석하여 쿼리 내 동일 연산 방식을 구분하여 각 연산의 결과(500,502,504,506)가 저장될 공간을 만든다.4 and 5, when the second area stored in the cache is a part of the first area in which the query is to be performed, the query processing apparatus analyzes the query, classifies the same operation method in the query, 500, 502, 504, and 506).

질의처리장치는 제1 영역 전체에 대해 연산을 수행하는 것이 아니라 제2 영역에 해당하는 연산의 결과(500,502,504)를 캐시에 저장된 값(520)으로 복원하고, 제1 영역과 제2 영역의 차이 영역에 해당하는 데이터를 읽어 직접 연산하여(530) 차이 영역에 대한 중간 연산 결과(506)를 얻는다. 그리고 질의처리장치는 각 중간연산 결과들(500,502,504,506)을 이용하여 최종 결과(510)를 얻는다. The query processing apparatus not only performs an operation on the entire first region but also restores the results (500, 502, 504) of the operation corresponding to the second region into the value 520 stored in the cache, (530) and obtains the intermediate calculation result (506) for the difference region. The query processor then uses the intermediate results 500, 502, 504, and 506 to obtain the final result 510.

예를 들어, 각 중간 연산 결과(500,502,504,506)는 도 1에서 살핀 <유형 3>의 쿼리에서 각 그룹별 집합 연산 결과일 수 있다. For example, each intermediate result 500, 502, 504, and 506 may be the result of an aggregate operation for each group in the query of FIG.

도 6은 본 발명에 따른 데이터베이스의 처리 속도 향상 방법의 일 실시 예의 흐름을 도시한 도면이다.FIG. 6 is a flowchart showing a flow of an embodiment of a method for improving the processing speed of a database according to the present invention.

도 6을 참조하면, 질의처리장치는 쿼리를 수신한다(S600). 쿼리가 삽입, 삭제, 또는 갱신에 관한 것이면, 질의처리장치는 종래의 방법으로 쿼리를 수행한다. Referring to FIG. 6, the query processing apparatus receives a query (S600). If the query is about insertion, deletion, or update, the query processing device performs the query in a conventional manner.

쿼리가 조회나 통계 연산 등에 관한 것이면, 질의처리장치는 쿼리에 대한 캐시가 존재하는지 검색한다(S610). 쿼리에 대한 캐시가 존재하지 아니하면(S620), 질의처리장치는 종래의 방법으로 쿼리를 수행하고(S660), 쿼리 수행 결과를 캐시에 저장한다(S670). If the query is related to a query, a statistical operation, or the like, the query processing apparatus searches whether there is a cache for the query (S610). If there is no cache for the query (S620), the query processing device performs the query in the conventional manner (S660) and stores the query execution result in the cache (S670).

시계열 데이터베이스는 시간이 지남에 따라 계속하여 데이터가 쌓이거나 기존 데이터가 삭제된다. 따라서 쿼리에 대한 캐시가 존재하여도, 쿼리가 수행되어야 할 시계열 데이터베이스의 제1 영역과 캐시에 대한 시계열 데이터베이스의 제2 영역이 서로 상이할 수 있다.Time series databases continue to accumulate over time or erase existing data. Therefore, even if there is a cache for the query, the first area of the time series database to which the query is to be performed and the second area of the time series database for the cache may be different from each other.

이에 질의처리장치는 제1 영역과 제2 영역이 일치하고, 캐시 저장 이후 현 시점까지 제2 영역에 대한 데이터가 변경되지 않았다면(S630), 캐시에 저장된 최종 결과를 현 쿼리에 대한 최종 결과로 그대로 출력한다(S640). 만약 제2 영역이 제1 영역의 일부분이고 캐시 저장 이후 현 시점까지 제2 영역에 대한 데이터가 변경되지 않았다면(S630), 질의처리장치는 캐시에 저장된 중간 연산 결과와, 제1 영역과 제2 영역의 차이 영역에 대해 수행한 쿼리의 중간 연산 결과를 이용하여 최종 결과를 산출한다(S650). 캐시 저장 이후 제2 영역에 대한 데이터가 변경되었다면, 질의처리장치는 종래와 동일한 방법으로 쿼리를 수행한다. If the first region and the second region coincide with each other and the data for the second region has not been changed up to the present time since the cache is stored (S630), the query processing apparatus proceeds to Step S630 to return the final result stored in the cache as the final result for the current query (S640). If the second area is a part of the first area and the data for the second area is not changed until the present time after the cache is stored (S630), the query processing device stores the intermediate calculation result stored in the cache, The final result is calculated using the intermediate calculation result of the query performed on the difference area of the difference region (S650). If the data for the second area has been changed since the cache is stored, the query processing device performs the query in the same manner as the conventional method.

도 7은 본 발명에 따른 쿼리에 대한 캐시 검색 방법의 일 실시 예의 흐름을 도시한 도면이다.FIG. 7 is a flowchart illustrating a cache search method according to an embodiment of the present invention.

도 7을 참조하면, 질의처리장치는 쿼리에 대한 해시값을 구한다(S700). 질의처리장치는 해시값을 이용하여 캐시를 검색한다(S710). 질의처리장치는 현재 수행해야 할 쿼리와 캐시의 쿼리 필드(도 3의 305)에 저장된 쿼리가 동일한지 비교한다(S720). 쿼리가 동일하지 않으면, 질의처리장치는 캐시의 해시 리스트(도 3의 315)를 이용하여 동일 해시값을 가진 다른 캐시가 존재하는지 파악한다. 다른 캐시가 존재하면, 질의처리장치는 그 다른 캐시가 현재 수행해야 할 쿼리에 대한 캐시인지 파악하는 과정을 다시 수행한다. Referring to FIG. 7, the query processing apparatus obtains a hash value for a query (S700). The query processing apparatus searches the cache using the hash value (S710). The query processing device compares the query to be performed and the query stored in the query field (305 in FIG. 3) of the cache with each other (S720). If the query is not the same, the query processing device uses the hash list of the cache (315 in FIG. 3) to determine whether another cache with the same hash value exists. If there is another cache, the query processing apparatus again performs a process of determining whether or not the other cache is a cache for a query to be performed.

본 발명은 또한 컴퓨터로 읽을 수 있는 기록매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 기록매체는 컴퓨터 시스템에 의하여 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 컴퓨터가 읽을 수 있는 기록매체의 예로는 ROM, RAM, CD-ROM, 자기 테이프, 플로피디스크, 광데이터 저장장치 등이 있다. 또한 컴퓨터가 읽을 수 있는 기록매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어 분산방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수 있다.The present invention can also be embodied as computer-readable codes on a computer-readable recording medium. A computer-readable recording medium includes all kinds of recording apparatuses in which data that can be read by a computer system is stored. Examples of the computer-readable recording medium include ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage, and the like. The computer-readable recording medium may also be distributed over a networked computer system so that computer readable code can be stored and executed in a distributed manner.

이제까지 본 발명에 대하여 그 바람직한 실시예들을 중심으로 살펴보았다. 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 본 발명이 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 변형된 형태로 구현될 수 있음을 이해할 수 있을 것이다. 그러므로 개시된 실시예들은 한정적인 관점이 아니라 설명적인 관점에서 고려되어야 한다. 본 발명의 범위는 전술한 설명이 아니라 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다.The present invention has been described with reference to the preferred embodiments. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the disclosed embodiments should be considered in an illustrative rather than a restrictive sense. The scope of the present invention is defined by the appended claims rather than by the foregoing description, and all differences within the scope of equivalents thereof should be construed as being included in the present invention.

Claims (13)

질의처리장치에 의한 데이터베이스의 처리 속도 향상 방법에 있어서,
상기 처리 속도 향상 방법은,
시계열 데이터베이스에 대한 쿼리를 수신하는 단계;
상기 쿼리에 대한 캐시가 존재하는지 파악하는 단계;
상기 쿼리가 수행될 상기 시계열 데이터베이스의 제1 영역과 상기 캐시에 저장된 쿼리 수행 결과를 얻는데 사용한 상기 시계열 데이터베이스의 제2 영역을 파악하는 단계; 및
상기 제1 영역 내에 상기 제2 영역이 위치하면, 상기 제1 영역에서 상기 제2 영역을 제외한 영역에 대한 상기 시계열 데이터베이스의 데이터를 읽어 상기 쿼리를 수행하여 얻은 결과와 상기 캐시에 저장된 쿼리 수행 결과를 이용하여 상기 쿼리에 대한 최종 결과를 얻는 단계;를 포함하는 것을 특징으로 하는 데이터베이스의 처리 속도 향상 방법.
A method for improving a processing speed of a database by a query processing device,
The processing speed enhancement method includes:
Receiving a query for a time series database;
Determining whether a cache for the query exists;
Determining a first region of the time series database in which the query is to be performed and a second region of the time series database used to obtain a query execution result stored in the cache; And
If the second region is located in the first region, reading the data of the time series database for the region excluding the second region in the first region, and comparing the result obtained by performing the query with the query execution result stored in the cache And obtaining a final result of the query using the query result.
제 1항에 있어서, 상기 쿼리에 대한 최종 결과를 얻는 단계는,
상기 캐시의 생성시점과 상기 쿼리의 수신시점 사이에 상기 제2 영역에 대한 데이터 변화 여부를 파악하는 단계; 및
상기 제2 영역의 데이터 변화가 없고, 상기 제1 영역과 상기 제2 영역이 일치하면 상기 캐시에 저장된 결과를 상기 쿼리에 대한 최종 결과로 출력하는 단계;를 포함하는 것을 특징으로 하는 데이터베이스의 처리 속도 향상 방법.
2. The method of claim 1, wherein obtaining a final result for the query comprises:
Determining whether data changes in the second area between a generation time of the cache and a reception time of the query; And
And outputting a result stored in the cache as a final result for the query if there is no data change in the second region and the first region and the second region coincide with each other, How to improve.
제 1항에 있어서, 상기 쿼리에 대한 최종 결과를 얻는 단계는,
상기 제2 영역이 상기 제1 영역의 일부분인 경우에, 상기 제1 영역과 상기 제2 영역의 차이 영역에 대해 상기 쿼리를 수행하는 단계; 및
상기 차이 영역에 대한 상기 쿼리의 수행 결과와 상기 캐시에 저장된 결과를 이용하여 산출한 최종 결과를 출력하는 단계;를 포함하는 것을 특징으로 하는 데이터베이스의 처리 속도 향상 방법.
2. The method of claim 1, wherein obtaining a final result for the query comprises:
Performing the query on a difference region between the first region and the second region when the second region is a portion of the first region; And
And outputting a result of performing the query on the difference region and a final result calculated using a result stored in the cache.
제 3항에 있어서,
상기 캐시는 상기 제2 영역에 대한 상기 쿼리를 수행하는데 발생하는 연산에 대한 결과인 연산 결과를 포함하고,
상기 쿼리에 대한 최종 결과를 얻는 단계는,
상기 차이 영역에 대한 연산 결과를 산출하는 단계; 및
상기 캐시에 저장된 상기 제2 영역에 대한 연산 결과와 상기 차이 영역에 대한 연산 결과를 이용하여 상기 제1 영역에 대한 상기 쿼리의 최종 결과를 산출하는 단계;를 포함하는 것을 특징으로 하는 데이터베이스의 처리 속도 향상 방법.
The method of claim 3,
Wherein the cache comprises an operation result that is a result of an operation occurring in performing the query on the second region,
Wherein obtaining the final result for the query comprises:
Calculating an operation result for the difference area; And
And calculating the final result of the query for the first region using the computation result for the second region stored in the cache and the computation result for the difference region, How to improve.
제 1항에 있어서,
상기 쿼리에 대한 캐시가 존재하지 아니하면, 상기 제1 영역에 대한 쿼리의 수행 결과를 포함하는 캐시를 저장하는 단계;를 더 포함하는 것을 특징으로 하는 데이터베이스의 처리 속도 향상 방법.
The method according to claim 1,
And if the cache for the query does not exist, storing a cache including a result of performing a query on the first area.
제 1항에 있어서, 상기 캐시가 존재하는지 파악하는 단계는,
상기 쿼리에 대한 해시값을 구하는 단계;
상기 해시값과 동일한 해시값을 포함하는 캐시를 검색하는 단계; 및
상기 쿼리가 상기 검색된 캐시에 저장된 쿼리와 동일한지 파악하는 단계;를 포함하고,
상기 캐시는 해시값이 동일하나 쿼리가 상이한 적어도 하나 이상의 캐시 리스트를 포함하고,
상기 캐시를 검색하는 단계는, 상기 캐시 리스트를 이용하여 동일한 해시값을 가진 적어도 하나 이상의 캐시를 검색하는 것을 특징으로 하는 데이터베이스의 처리 속도 향상 방법.
The method of claim 1, wherein the step of determining whether the cache exists includes:
Obtaining a hash value for the query;
Retrieving a cache including a hash value equal to the hash value; And
Determining whether the query is the same as the query stored in the retrieved cache,
Wherein the cache includes at least one cache list in which the hash value is the same but the query is different,
Wherein the step of searching for the cache searches at least one cache having the same hash value using the cache list.
시계열 데이터베이스에 대한 쿼리를 수신하는 쿼리수신부;
상기 쿼리에 대한 캐시가 존재하는지 파악하는 캐시검색부; 및
상기 쿼리가 수행될 상기 시계열 데이터베이스의 제1 영역 내에 상기 캐시에 저장된 쿼리 수행 결과를 얻는데 사용한 상기 시계열 데이터베이스의 제2 영역이 위치하면, 상기 제1 영역에서 상기 제2 영역을 제외한 영역에 대한 상기 시계열 데이터베이스의 데이터를 읽어 상기 쿼리를 수행하여 얻은 결과와 상기 캐시에 저장된 쿼리 수행 결과를 이용하여 상기 쿼리에 대한 최종 결과를 얻는 쿼리수행부;를 포함하는 것을 특징으로 하는 질의처리장치.
A query receiver for receiving a query for a time series database;
A cache search unit for determining whether a cache for the query exists; And
When the second region of the time series database used for obtaining the query execution result stored in the cache is located in the first region of the time series database in which the query is to be performed, And a query execution unit for obtaining the final result of the query by using the result obtained by performing the query by reading the data of the database and the query execution result stored in the cache.
제 7항에 있어서, 상기 쿼리수행부는,
상기 캐시의 생성시점과 상기 쿼리의 수신시점 사이에 상기 제2 영역에 대한 데이터 변화가 없고, 상기 제1 영역과 상기 제2 영역이 일치하면 상기 캐시에 저장된 결과를 상기 쿼리에 대한 최종 결과로 산출하는 것을 특징으로 하는 질의처리장치.
8. The apparatus of claim 7,
If there is no data change in the second region between the generation time of the cache and the reception of the query and if the first region and the second region coincide with each other, a result stored in the cache is calculated as a final result for the query And the query processing unit.
제 7항에 있어서, 상기 쿼리수행부는,
상기 제2 영역이 상기 제1 영역의 일부분인 경우에, 상기 제1 영역과 상기 제2 영역의 차이 영역에 대한 상기 쿼리의 수행 결과와 상기 캐시에 저장된 결과를 이용하여 최종 결과를 산출하는 것을 특징으로 하는 질의처리장치.
8. The apparatus of claim 7,
And a final result is calculated using the result of the query for the difference region between the first region and the second region and the result stored in the cache when the second region is a part of the first region To the query processing unit.
제 7항에 있어서, 상기 캐시는,
쿼리를 저장하는 쿼리 필드;
상기 쿼리에 대한 해시값을 가진 적어도 하나 이상의 캐시의 리스트를 저장하는 해시 리스트 필드;
상기 쿼리가 수행된 영역을 나타내는 영역정보 필드; 및
상기 쿼리의 최종 결과 또는 중간 연산 결과를 저장하는 결과 필드;를 포함하는 것을 특징으로 하는 질의처리장치.
8. The method of claim 7,
A query field that stores the query;
A hash list field storing a list of at least one cache having a hash value for the query;
An area information field indicating an area where the query is performed; And
And a result field for storing a final result or an intermediate result of the query.
제 10항에 있어서, 상기 캐시검색부는,
상기 해시 리스트 필드를 이용하여 동일한 해시값을 가진 적어도 하나 이상의 캐시를 파악하고, 상기 쿼리수신부가 수신한 쿼리에 대한 해시값과 동일한 해시값을 포함하는 캐시의 쿼리 필드에 저장된 쿼리가 상기 쿼리수신부가 수신한 쿼리와 동일한지 파악하는 것을 특징으로 하는 질의처리장치.
11. The apparatus of claim 10,
A query stored in a query field of a cache including a hash value equal to a hash value of a query received by the query receiving unit is received by the query receiving unit Whether the query is the same as the received query.
제 7항에 있어서, 상기 쿼리수행부는,
상기 쿼리에 대한 캐시가 존재하지 아니하면, 상기 제1 영역에 대한 쿼리의 수행 결과를 포함하는 캐시를 생성하여 저장하는 것을 포함하는 것을 특징으로 하는 질의처리장치.
8. The apparatus of claim 7,
And generating and storing a cache including a result of performing a query for the first area if the cache for the query does not exist.
제 1항 내지 제 6항 중 어느 한 항에 기재된 방법을 수행하기 위한 프로그램을 기록한 컴퓨터로 읽을 수 있는 기록매체.A computer-readable recording medium storing a program for performing the method according to any one of claims 1 to 6.
KR1020160066374A 2016-05-30 2016-05-30 Method and apparatus for improving throughput of database KR101780041B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020160066374A KR101780041B1 (en) 2016-05-30 2016-05-30 Method and apparatus for improving throughput of database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020160066374A KR101780041B1 (en) 2016-05-30 2016-05-30 Method and apparatus for improving throughput of database

Publications (1)

Publication Number Publication Date
KR101780041B1 true KR101780041B1 (en) 2017-09-19

Family

ID=60033361

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020160066374A KR101780041B1 (en) 2016-05-30 2016-05-30 Method and apparatus for improving throughput of database

Country Status (1)

Country Link
KR (1) KR101780041B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102102313B1 (en) 2019-11-27 2020-04-20 주식회사 리얼타임테크 System for Managing TimeSeries data in In-Memory Database

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6609126B1 (en) 2000-11-15 2003-08-19 Appfluent Technology, Inc. System and method for routing database requests to a database and a cache
KR101318234B1 (en) * 2012-04-25 2013-10-15 주식회사 비트랜 Data cache method and device for database system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6609126B1 (en) 2000-11-15 2003-08-19 Appfluent Technology, Inc. System and method for routing database requests to a database and a cache
KR101318234B1 (en) * 2012-04-25 2013-10-15 주식회사 비트랜 Data cache method and device for database system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102102313B1 (en) 2019-11-27 2020-04-20 주식회사 리얼타임테크 System for Managing TimeSeries data in In-Memory Database

Similar Documents

Publication Publication Date Title
US7603339B2 (en) Merging synopses to determine number of distinct values in large databases
US10372706B2 (en) Tracking and maintaining expression statistics across database queries
US7636731B2 (en) Approximating a database statistic
US8095559B2 (en) Fast adaptive document filtering
US8140495B2 (en) Asynchronous database index maintenance
US7711668B2 (en) Online document clustering using TFIDF and predefined time windows
Tao et al. Spatio-temporal aggregation using sketches
US7797265B2 (en) Document clustering that applies a locality sensitive hashing function to a feature vector to obtain a limited set of candidate clusters
US20070233720A1 (en) Lazy bulk insertion method for moving object indexing
JP5663044B2 (en) Managing storage of individually accessible data units
Wang et al. A flexible spatio-temporal indexing scheme for large-scale GPS track retrieval
US20150106397A1 (en) System and Method for Optimizing Queries
CN107783985B (en) Distributed database query method, device and management system
EP3365812A1 (en) Create table for exchange
US11777983B2 (en) Systems and methods for rapidly generating security ratings
CN109815240B (en) Method, apparatus, device and storage medium for managing index
KR20140137842A (en) System and method for searching information based on data absence tagging
EP2920715A1 (en) Improved database search facility
US9594784B2 (en) Push-model based index deletion
CN110637292A (en) System and method for querying a resource cache
Zhang et al. Probabilistic n-of-N skyline computation over uncertain data streams
KR101780041B1 (en) Method and apparatus for improving throughput of database
US10019483B2 (en) Search system and search method
US20170235779A1 (en) Processing query of database and data stream
US10366067B2 (en) Adaptive index leaf block compression

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant