IP Library Granted Patent US 9,904,708
Granted Patent B2
US 9,904,708 · App. 14/626,429 · Granted Feb 27, 2018

Apparatus and method for processing query in database with hybrid storage

Inventors: Youngjae Choi (Gyeonggi-do, KR); Sangyoung Park (Gyeonggi-do, KR); Sungwook Moon (Gyeonggi-do, KR); Sehoon Seo (Gyeonggi-do, KR)
Assignee: TMAXDATA CO., LTD.
G06F17/30463
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,904,708
App. No.
14/626,429
Granted
Feb 27, 2018
Kind
B2
Abstract

The present invention provides an apparatus and method for processing a query in a relational database system having a hybrid storage of a memory tablespace and a disk tablespace, with the configuration of the present invention, by extending a table partitioning technology in order for the relational database system to use the disk tablespace and memory tablespace in a hybrid manner, it is possible to implement data discrimination due to different data storages in one logical table and create scan plans in compliance with the difference in the storages, thereby establishing an optimal scan plan to the query intended to access the storages having different properties.

Claims (58)

1. An apparatus for processing a query in a database system, the apparatus comprising:

a processor including:

a tablespace metadata that stores information as to whether tables are stored in which tablespace, wherein the tables are stored in the database system including a disk tablespace and a memory tablespace;

a query compiling unit, upon receiving a query statement, configured to:

check whether a table needed for processing the query statement is stored in the disk tablespace or the memory tablespace by referencing the information about the tablespace;

create a scan plan for a disk table full scan when it is checked that the table is stored in the disk tablespace;

create a scan plan for a memory table full scanning when it is checked that the table is stored in the memory tablespace;

create a scan plan for a hybrid full table scanning when the table is a partitioned table and it is checked that the partitioned table is stored in a hybrid storage of the disk tablespace and the memory tablespace; and

a query execution unit configured to:

read out the data of the table by accessing the disk tablespace or the memory tablespace in accordance with the scan plan that is created by the query compiling unit and to perform a processing of the query statement using the read-out data;

read out rows in the table in the form of a data block when it is checked that the table is stored in the disk tablespace;

read out rows in the table through memory pages when it is checked that the table is stored in the memory tablespace;

fit the storage structure of the rows that are read-out from the disk tablespace and the memory tablespace into the same format of the rows during performing the scan plan of the table,

wherein, when the table is the partitioned table the table is divided into a plurality of partitions and stored in either one of the disk tablespace and the memory tablespace, or the partitioned tables are stored in the hybrid storage of the disk tablespace or the memory tablespace depending on the importance of a partition key value in the partitioned table, and each of the partitioned tables is transferred in sequence from the memory tablespace to the disk tablespace with the lapse of time pursuant to the partition key value having time information in the partitioned table.

2. The apparatus of claim 1 , wherein the query compiling unit is further configured to:

when creating the scan plan for disk table full scanning, check whether there is an index of the table;

create a scan plan for a disk index scan when it is checked that there is an index of the table; and

select either one of the disk table full scan plan and the disk index scan plan through the comparison of costs between them.

3. The apparatus of claim 1 , wherein the query compiling unit is further configured to:

when creating the scan plan for the memory table full scan, check whether there is an index of the table;

create a scan plan for a memory index scan when it is checked that there is an index of the table; and

select either one of the memory table full scan plan and the memory index scan plan through the comparison of costs between them.

4. The apparatus of claim 1 , wherein the query compiling unit is configured to:

when the table is a partitioned table, check whether the partitioned tables are stored in a hybrid storage of the disk tablespace and the memory tablespace or the partitioned tables are stored either one of the disk tablespace and the memory tablespace; and

create a scan plan for a hybrid full table scanning when it is checked that the partitioned table is stored in the hybrid storage.

5. The apparatus of claim 4 , wherein the query compiling unit is further configured to:

when creating the scan plan for a hybrid full table scan, check whether there is an index of the table;

create a scan plan for a hybrid index scan when it is checked that there is an index of the table; and

select either one of the hybrid full table scan plan and the hybrid index scan plan through the comparison of costs between them.

6. The apparatus of claim 1 , wherein the query compiling unit is configured to create the scan plan that minimizes a cost required to process the query statement through the calculation of the cost necessary to read-out the table depending on the storage in which the table is stored.

7. A method for processing a query in a database system including a hybrid storage of a memory tablespace and a disk tablespace, the method comprising:

receiving a query statement in the database system;

upon receiving the query statement, checking whether a table needed for processing the query statement is stored in which storage by referencing information about the storage in which the table is stored;

creating a scan plan of the table in compliance with the storage in which the table is stored, the creating scan plan of the table comprising:

creating a scan plan for a disk table full scan when it is checked that the table is stored in the disk tablespace;

creating a scan plan for a memory table full scanning when it is checked that the table is stored in the memory tablespace; and

creating a scan plan for a hybrid full table scanning when the table is a partitioned table and it is checked that the partitioned table is stored in a hybrid storage of the disk tablespace and the memory tablespace;

reading out data of the table by scanning the disk tablespace or the memory tablespace in accordance with the scan plan of the table, the reading out data of the table comprising:

reading out rows in the table in the form of a data block when it is checked that the table is stored in the disk tablespace; and

reading out rows in the table through memory pages when it is checked that the table is stored in the memory tablespace; and

performing a processing of the query statement using the read-out data,

wherein, when the table is the partitioned table the table is divided into a plurality of partitions and stored in either one of the disk tablespace and the memory tablespace, or the partitioned tables are stored in a hybrid storage of the disk tablespace or the memory tablespace depending on the importance of a partition key value in the partitioned table, and

wherein each of the partitioned tables is transferred in sequence from the memory tablespace to the disk tablespace with the lapse of time pursuant to the partition key value having time information in the partitioned table.

8. The method of claim 7 , wherein said creating a scan plan for a disk table full scan further comprises:

checking whether there is an index of the table;

creating a scan plan for a disk index scan when it is checked that there is an index of the table; and

selecting either one of the disk table full scan plan and the disk index scan plan through the comparison of costs between them.

9. The method of claim 7 , wherein said creating a scan plan for a memory table full scan further comprises:

checking whether there is an index of the table;

creating a scan plan for a memory index scan when it is checked that there is an index of the table; and

selecting either one of the memory table full scan plan and the memory index scan plan through the comparison of costs between them.

10. The method of claim 7 , wherein said creating a scan plan of the table further comprises:

when the table is a partitioned table, checking whether the partitioned table is stored in a hybrid storage of the disk tablespace and the memory tablespace or the partitioned tables are stored either one of the disk tablespace and the memory tablespace; and

creating a scan plan for a hybrid full scan when it is checked that the partitioned tables are stored in the hybrid storage.

11. The method of claim 10 , wherein said creating a scan plan for a hybrid full scan further comprises:

checking whether there is an index of the table;

creating a scan plan for a hybrid index scan when it is checked that there is an index of the table; and

selecting either one of the hybrid full table scan plan and the hybrid index scan plan through the comparison of costs between them.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 12, 2022
From: TMAXDATACO., LTD. (ALSO KNOWN AS TMAXDATA CO., LTD. AND TMAX DATA CO., LTD.)
To: TMAXTIBERO CO., LTD.
Reel/Frame 060635/0387 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 19, 2015
From: CHOI, YOUNGJAE; PARK, SANGYOUNG; MOON, SUNGWOOK; SEO, SEHOON
To: TMAXDATA CO., LTD.
Reel/Frame 034987/0080 →
Priority Claims (1)
KR 10-2014-0019730 · Feb 20, 2014 · national
Continuity (1)
Related Publication 20150234898A1 · Aug 20, 2015