Updating method and database updating device

By copying and strategically writing back files with low frequency to faster storage, the database update method addresses the bottleneck issue, reducing update times and improving efficiency.

JP2024158839APending Publication Date: 2024-11-08HITACHI LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2023074402
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

Existing database update methods suffer from a bottleneck due to repeated writing of data to secondary storage devices, which are significantly slower than non-volatile memory, leading to increased update times.

Method used

A method and device that involve copying files from a first storage device to a second storage device, and then writing back updated files with low frequency to the first storage device, utilizing a query determination process and a low-frequency file specifying process to optimize data transfer.

Benefits of technology

This approach reduces the time required for database updates by minimizing writes to slower secondary storage devices, thereby enhancing update efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024158839000001_ABST
    Figure 2024158839000001_ABST
Patent Text Reader

Abstract

To reduce a time required for an update of a database.SOLUTION: An updating method is a method for a computer to update data stored in a first storage device by copying a plurality of files stored in the first storage device to a second storage device and writing the files updated in the second storage device back to the first storage device. The plurality of files form part of the database. The update method includes: query determination processing for determining whether or not a query that commands writing to a file stored in the second storage device is a designation using a cluster key for the database; low-frequency file identification processing for identifying a file with a low writing frequency among the files stored in the second storage device; and writing-back processing for writing the file with a low writing frequency identified by the low-frequency file identification processing back to the first storage device.SELECTED DRAWING: Figure 3
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to an updating method and a database updating device. [Background technology]

[0002] Since reliability is required for databases, they are generally stored in data centers or the like that are physically distant from database users. Therefore, communication between the database user and the database often requires time due to distance, and a configuration in which a cache is provided on the database user side as a countermeasure against this is known. Patent Document 1 discloses a database management system that includes an OLTP (Online Transaction Process) that performs update processing of the database and an OLAP (Online Analytical Processing) that performs aggregation processing of data accumulated in the database, characterized in that the database management system includes a non-volatile memory that stores row-oriented data for the OLTP, and a memory management means that updates data in the non-volatile memory and holds it in a row-oriented manner, accumulates a predetermined amount of data held in a row-oriented manner, and then stores the predetermined amount of accumulated data in a volatile memory in column-based blocks, and stores the column-based blocks in a secondary storage device other than the non-volatile memory for the OLAP. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] JP 2020-13318 A Summary of the Invention [Problem to be solved by the invention]

[0004] In the invention described in Patent Document 1, there is room for consideration in shortening the time required to update a database. When multiple updates are performed, there is a method of storing the updated data in the non-volatile memory in the secondary storage device, but if multiple updates are in the same non-volatile memory area, the data in the same area will be sent to the secondary storage device multiple times. Since secondary storage devices are generally two or more orders of magnitude slower than non-volatile memory, these repeated writes become a bottleneck and database updates take time. The object of the present invention is to eliminate this writing bottleneck. [Means for solving the problem]

[0005] An updating method according to a first aspect of the present invention is an updating method in which a computer updates data stored in a first storage device by copying a plurality of files stored in a first storage device to a second storage device and writing the files updated in the second storage device back to the first storage device, wherein the plurality of files constitute part of a database, and includes a query discrimination process for determining whether a query instructing writing to the files stored in the second storage device is a specification using a cluster key of the database, a low frequency file identification process for identifying files that have a low write frequency among the files stored in the second storage device, and a write back process for writing the low write frequency files identified by the low frequency file identification process to the first storage device. A database updating device according to a first aspect of the present invention is a database updating device that updates data stored in a first storage device by copying a plurality of files stored in a first storage device to a second storage device and writing the files updated in the second storage device back to the first storage device, wherein the plurality of files constitute part of a database, and the device comprises a query determination unit that determines whether a query instructing writing to the files stored in the second storage device is a specification using a cluster key of the database, a low frequency file identification unit that identifies files that have a low write frequency among the files stored in the second storage device, and a write back unit that writes the low write frequency files identified by the low frequency file identification process to the first storage device. Effect of the Invention

[0006] According to the present invention, the time required to update a database can be reduced. [Brief description of the drawings]

[0007] [Figure 1] Database system configuration diagram [Diagram 2] Server hardware configuration diagram [Diagram 3] Database management section configuration diagram [Figure 4] Diagram showing the structure of the write LRU [Diagram 5] Diagram showing the structure of index information [Figure 6] Flowchart showing the processing of the query execution module [Figure 7] Flowchart showing the processing of the timing generation module [Figure 8] A flowchart showing details of the pre-write process in FIG. [Figure 9] Flowchart showing details of pre-write processing in Modification 1 [Figure 10] Configuration diagram of database system in modification 2 DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0008] --First embodiment-- Hereinafter, a first embodiment of an updating method and a database updating device will be described with reference to FIGS.

[0009] 1 is a configuration diagram of a database system 1000. The database system 1000 includes a server 1, a low-speed storage 2, and a client 9. The server 1 and the low-speed storage 2 are connected via a network 3. The network 3 may be the Internet, or may be any of a wide area network, a closed area network, and a local communication network. The client 9 transmits a query 112 to the server 1, which includes a write instruction to a database management unit 10, which will be described later.

[0010] The server 1 comprises a database management unit 10 and a high-speed storage 11. The detailed configuration of the database management unit 10 will be described later, but it comprises at least a memory 120. The high-speed storage 11 is, for example, an SSD (Solid State Drive) or an array of SSDs, and the memory 120 is, for example, a DRAM. In the following, the low-speed storage 2 is also referred to as the "first storage device," and the high-speed storage 11 is also referred to as the "second storage device."

[0011] The low-speed storage 2 includes a non-volatile storage device such as a hard disk drive (hereinafter also referred to as "HDD"). The low-speed storage 2 may be a storage product with a network connection function, or may be a storage area provided as an online storage service. FIG. 1 merely illustrates the concept of the low-speed storage 2, and the low-speed storage 2 may be configured with multiple pieces of hardware, or may have a redundant configuration in different geographical environments.

[0012] The memory 120, the high-speed storage 11, and the low-speed storage 2 have in common that they are storage areas, but there is a large difference in their access speed. Specifically, access to the memory 120 is the fastest, access to the high-speed storage 11 is medium, and access to the low-speed storage 2 is the slowest. All data handled by the database management unit 10 is stored in the low-speed storage 2. A portion of the data handled by the database management unit 10 is stored in the high-speed storage 11 and the memory 120. The database management unit 10 divides all data and stores it in a cache file 7, and the cache file 7 is made up of multiple pages 71.

[0013] A plurality of pages 71 are stored in the memory 120. A plurality of cache files 7 are stored in the high-speed storage 11 and the low-speed storage 2. The high-speed storage 11 inputs and outputs data in units of pages 71 between the memory 120, and inputs and outputs data in units of cache files 7 between the high-speed storage 11 and the low-speed storage 2. There is no direct input and output of data between the high-speed storage 11 and the memory 120. Note that the number of pages 71 stored in the memory 120 in FIG. 1, the number of pages 71 constituting each cache file 7, the number of cache files 7 stored in the high-speed storage 11, and the number of cache files 7 stored in the low-speed storage 2 are merely examples.

[0014] The database management unit 10 reads and writes data from and to the virtual memory space, which is a virtual memory space. The database management unit 10 divides this virtual memory space at a predetermined granularity, and handles data stored in an area of ​​the divided virtual memory space as one file. The file name of this file is determined based on the address of the divided virtual memory space. For example, the first address of the divided virtual memory space itself may be used as the file name, or the value obtained by dividing the first address of the divided virtual memory space by a predetermined value may be used as the file name, or the address at the center or end of the divided virtual memory space may be used as the file name. Regardless of which naming rule is adopted, the file names of the cache files 7 are consecutive for consecutive areas in the virtual memory space.

[0015] 2 is a hardware configuration diagram of the server 1. The server 1 includes a CPU 41 which is a central processing unit, a ROM 42 which is a read-only storage device, a RAM 43 which is a readable and writable storage device, a high-speed storage 11, and a communication device 45. The memory 120 shown in FIG. 1 is a partial area of ​​the RAM 43. The RAM 43 is, for example, a DRAM (Dynamic Random Access Memory). The communication device 45 realizes communication with the low-speed storage 2 via the network 3.

[0016] The CPU 41 performs various calculations by loading a program stored in the ROM 42 into the RAM 43 and executing it. The server 1 may be realized by a field programmable gate array (FPGA) that is a rewritable logic circuit or an application specific integrated circuit (ASIC) that is an integrated circuit for a specific application, instead of the combination of the CPU 41, the ROM 42, and the RAM 43. The server 1 may also be realized by a combination of different configurations, for example, a combination of the CPU 41, the ROM 42, the RAM 43, and an FPGA, instead of the combination of the CPU 41, the ROM 42, and the RAM 43.

[0017] 3 is a configuration diagram of the database management unit 10. The database management unit 10 includes a query execution module 104, a scan execution module 105, a transaction execution module 106, an import execution module 107, a data input / output module 108, a timing generation module 109, a management buffer 110, an import buffer 111, a query plan 113, index information 114, and a write LRU 115.

[0018] The client 9 accepts operations on the database management unit 10 from a user (not shown), and queries the database management unit 10 in the form of a query 112. The client 9 also accepts the results of the operations from the database management unit 10 and presents them to the user. The server 1 is computer hardware on which the database management unit 10 operates, and has a built-in high-speed storage 11. The server 1 is connected to the client 9, which is an external terminal, and the low-speed storage 2 via a network 3. The database management unit 10 accepts the query 112 from the client 9, searches for and writes data using various modules, and returns the processing results to the client 9.

[0019] The query execution module 104 interprets a query 112 received from the client 9 and converts it into a query plan 113, which is an instruction sequence executable by the scan execution module 105, the transaction execution module 106, and the import execution module 107. The query execution module 104 transmits execution commands to the scan execution module 105, the transaction execution module 106, and the import execution module 107 in that order based on the query plan 113.

[0020] The scan execution module 105 receives a scan execution command in the query plan 113 generated by the query execution module 104 and executes a scan, i.e., a search, of the data stored in the database management unit 10. The search results by the scan execution module 105 are returned to the query execution module 104, where they are aggregated and finally returned to the client 9.

[0021] Transaction execution module 106 executes a transaction on a selected specific row of data stored in database management unit 10, based on a transaction execution command in query plan 113 generated by query execution module 104. The result of the transaction execution by transaction execution module 106 is returned to query execution module 104, and finally returned to client 9. Import execution module 107 reads data from outside database management unit 10, based on an import execution command in query plan 113 generated by query execution module 104, and stores it as internal data of database management unit 10.

[0022] The data input / output module 108 receives requests to read or write data from the scan execution module 105, the transaction execution module 106, and the import execution module 107. The data input / output module 108 determines whether or not a page 71 to be read or written (hereinafter referred to as a "target page") exists in the management buffer 110, and if the target page exists in the management buffer 110, it reads data from the management buffer 110, and if the target page does not exist in the management buffer 110, it makes the following determination.

[0023] That is, the data input / output module 108 determines whether or not the target page exists in the high-speed storage 11, and if the target page exists in the high-speed storage 11, it reads it from the high-speed storage 11, and if the target page does not exist in the high-speed storage 11, it reads the cache file 7 including the target page from the low-speed storage 2. Necessary data in the cache file read from the high-speed storage 11 is stored in this management buffer 110. If the cache file 7 is read from the low-speed storage 2, the cache file 7 is also stored in the high-speed storage 11. Note that writing to the low-speed storage 2 is performed under the initiative of the timing generation module 109. Specifically, the data input / output module 108 writes the write target determined by the timing generation module 109 to the low-speed storage 2 at the timing determined by the timing generation module 109.

[0024] When the timing generation module 109 receives a data write command from the data input / output module 108, it judges whether or not the cache file 7 to be written exists in the high-speed storage 11. If the target cache does not exist in the high-speed storage 11, the timing generation module 109 reads the target cache from the low-speed storage 2, saves it in the high-speed storage 11, and writes data to this target cache. Thereafter, the timing generation module 109 writes the target cache to the low-speed storage 2 if a specific condition is satisfied. The timing generation module 109 refers to the index information 114 and the write LRU 115 to make this judgment. The operation of the timing generation module 109 will be described in detail later.

[0025] The management buffer 110 is a storage area that the scan execution module 105 and the transaction execution module 106 can read and write at high speed. The management buffer 110 temporarily stores table data and management data obtained in response to a read request by the scan execution module 105 and the transaction execution module 106. The management buffer 110 also temporarily stores write data in response to a write request by the scan execution module 105 and the transaction execution module 106. As described above, data is stored in the management buffer 110 in units of pages 71, and the pages 71 in the management buffer 110 are written to an appropriate cache file 7 in the high-speed storage 11 at an appropriate timing. The writing of the cache file 7 from the high-speed storage 11 to the low-speed storage 2 is performed in response to an instruction from the timing generation module 109.

[0026] The import buffer 111 is a write data buffer used by the import execution module 107. The query 112 is a request sent from the client 9 to the database management unit 10. The query 112 is, for example, a request process such as searching, merging, or importing database data. Generally, one query 112 is combined with a plurality of request processes, but the number of request processes included in one query 112 is not particularly limited. The query plan 113 is generated by the query execution module 104 interpreting the query 112 sent from the client 9. The query plan 113 is a decomposition of the query 112, which is a complex request, and is a list of simple scan processes and transaction processes.

[0027] In order to process data in the database management unit 10 at high speed, the index information 114 organizes the data and stores the result in the database as the index information 114. By using the index information 114, it becomes possible to determine whether the arrangement of data is local. The write LRU 115 is an LRU (Least Recently Used) list that records the history of writing data to the cache file 7 in the high-speed storage 11. The write LRU 115 is updated every time data is written to the cache file 7 stored in the high-speed storage 11. The write LRU 115 is configured to list the cache files 7 in order from the most recently accessed.

[0028] 4 is a diagram showing the structure of the write LRU 115. The write LRU 115 is, for example, a list of finite length, and is made up of multiple entries. Each entry that makes up the write LRU 115 is made up of a cache file name 1151, a dirty bit 1152, and a next entry pointer 1153.

[0029] The cache file name 1151 is the name of the cache file 7 written from the database management unit 10. The dirty bit 1152 is a Boolean value indicating whether or not the write from the database management unit 10 has been reflected in the low-speed storage 2. When the cache file 7 is written to by the database management unit 10, the dirty bit 1152 is set to "1", and when the data is written to the low-speed storage 2, it is set to "0". The next entry pointer 1153 is the address where the next entry is stored. However, the next entry pointer 1153 in the last entry is a terminal pointer indicating that there are no subsequent entries.

[0030] The write LRU 115 is updated every time a write is performed from the database management unit 10 to the high-speed storage 11. If the written cache file 7 is called the "file to be written" here, the method of updating the write LRU 115 differs depending on whether the file to be written is written as the cache file name 1151 in any entry of the write LRU 115.

[0031] First, a case will be described where the file to be written is written as the cache file name 1151 in one of the entries of the write LRU 115. Here, however, an entry in which the file to be written is written as the cache file name 1151 will be called the "target entry." In this case, the dirty bit 1152 of the target entry is set to "1," and the next entry pointer 1153 of the target entry is set to the address of the entry that was previously at the top.

[0032] Next, a case will be described where the file to be written is not written as the cache file name 1151 in any of the entries of the write LRU 115. In this case, a new entry is created. The cache file name 1151 of that entry is set to the file to be written, the dirty bit 1152 is set to "1", and the next entry pointer 1153 is set to the address of the previous top entry. Note that in this embodiment, the write LRU 115 is realized by a list, but it may also be realized by means other than a list, for example, by an array.

[0033] 5 is a diagram showing the structure of index information 114. Index information 114 is composed of multiple entries. Each entry is composed of a cache file ID, an index ID, a minimum address value, and a maximum address value. The cache file ID is an identifier of the cache file 7, that is, the file name of the cache file 7. The index ID is an identifier of the index. The minimum address value and the maximum address value are the range of addresses in the virtual memory space.

[0034] 6 is a flowchart showing the processing of the query execution module 104. First, in step S201, the query execution module 104 receives the query 112 from the client 9. In the following step S202, the query execution module 104 interprets the query 112 and creates a query plan 113. This query plan 113 is used in step S208, which will be described later. In the following step S203, the query execution module 104 processes the query 112 by executing the query plan 113 created in step S202.

[0035] 7 is a flowchart showing the processing of the timing generation module 109. First, in step S204, the timing generation module 109 receives a request to write the page 71 in the update processing of the transaction to the high-speed storage 11 from the query execution module 104 or the data input / output module 108. In the following step S205, the timing generation module 109 refers to the index information 114 to identify the target cache file 7 to which the page 71 is to be written, and judges whether the cache file 7 exists in the high-speed storage 11. If the timing generation module 109 judges that the target cache file 7 exists in the high-speed storage 11, it proceeds to step S207, and if it judges that the target cache file 7 does not exist in the high-speed storage 11, it proceeds to step S206.

[0036] In step S206, the timing generation module 109 reads the target cache file 7 from the low-speed storage 2 and stores it in the high-speed storage 11, and proceeds to step S207. In step S207, the timing generation module 109 writes the page 71 to the target cache file 7 stored in the high-speed storage 11. In the following step S207, the timing generation module 109 updates the write LRU 115. That is, the write LRU 115 is updated to indicate that the cache file 7 to be written in step S207 was used most recently.

[0037] In the next step S208, the timing generation module 109 refers to the query plan 113 and determines whether the current transaction update search uses a cluster key. This determination can also be rephrased as whether the current transaction update search constitutes a cluster, or whether the cache file 7 to be searched can be identified. If the timing generation module 109 determines that the current transaction update search uses a cluster key, it proceeds to step S220, and if it determines that the current transaction update search does not use a cluster key, it proceeds to step S214. Note that hereinafter, the process of step S208 is also referred to as "query determination process", and the function that realizes the process of step S208 is also referred to as "query determination unit".

[0038] Step S220 is a pre-write process. Details of the pre-write process will be described later with reference to Fig. 8. When the pre-write process ends, the timing generation module 109 proceeds to step S214.

[0039] In step S214, the timing generation module 109 judges whether or not the transaction processing has been committed. If the timing generation module 109 judges that the transaction processing has been committed, the process proceeds to step S215, and if the timing generation module 109 judges that the transaction processing has not been committed, the process returns to step S204. In step S215, the timing generation module 109 writes out all cache files 7 that are stored in the high-speed storage 11 and have not yet been written out to the low-speed storage 2, and ends the process shown in Fig. 7. Note that hereinafter, the process of step S215 is also referred to as "commit time processing", and the function that realizes the process of step S215 is also referred to as "commit time processing unit".

[0040] FIG. 8 is a flowchart showing details of the pre-write process in FIG. 7. In step S221, the timing generation module 109 sets the target entry, which is the entry of the write LRU 115 to be processed, to the first entry of the write LRU 115, and proceeds to step S222. In step S222, the timing generation module 109 judges whether the target entry is within a predetermined range from the beginning. The predetermined range is a predetermined constant, for example, "100". If the timing generation module 109 judges that the target entry is within the predetermined range from the beginning, it proceeds to step S224, and if the timing generation module 109 judges that the target entry is not within the predetermined range from the beginning, it proceeds to step S223. Note that hereinafter, the process of step S222 is also called "low-frequency file identification process", and the function that realizes the process of step S222 is also called "low-frequency file identification unit".

[0041] In step S223, the timing generation module 109 writes the cache file 7 corresponding to the target entry to the low-speed storage 2, and proceeds to step S224. In the following, the process of step S223 is also called "write-back process", and the function that realizes the process of step S223 is also called "write-back unit". In step S224, the timing generation module 109 judges whether the target entry is the end of the list, that is, the end entry of the write LRU 115. If the timing generation module 109 judges that the target entry is the end of the list, it ends the process shown in FIG. 8, and if it judges that the target entry is not the end of the list, it proceeds to step S225. In step S225, the timing generation module 109 updates the target entry to the next entry in the write LRU 115, and returns to step S222.

[0042] If a transaction process is not committed and a rollback is required, various known methods can be used to deal with this. For example, if the low-speed storage 2 has a function called a snapshot or shadow copy that restores a file to its state before it was updated, this function may be used. Also, when writing to the low-speed storage 2, instead of overwriting the cache file 7, if the file is saved under a different name with a timestamp or the like added and the file name is changed to the original name upon commit, deleting the file saved under a different name will be equivalent to a rollback.

[0043] According to the above-described first embodiment, the following advantageous effects can be obtained. (1) The method of updating data stored in the low-speed storage 2 executed by the database management unit 10 of the server 1 includes the following query determination process, low-frequency file identification process, and write-back process. The server 1 updates data stored in the low-speed storage 2 by copying a plurality of files stored in the low-speed storage 2 to the high-speed storage 11 and writing back the files updated in the high-speed storage 11 to the low-speed storage 2. A plurality of cache files 7 stored in the low-speed storage 2 constitute a part of the database. The method includes a query determination process (step S208 in FIG. 7) for determining whether or not the query 112 instructing writing to a file stored in the high-speed storage 11 is specified using a cluster key of the database, a low-frequency file identification process (step S222 in FIG. 8) for identifying a file with a low write frequency among the files stored in the high-speed storage 11, and a write-back process (step S223 in FIG. 8) for writing the file with a low write frequency identified by the low-frequency file identification process to the low-speed storage 2. Therefore, the time required for updating the database can be shortened by writing some of the cache files 7 to the low-speed storage 2 in advance.

[0044] (2) A write LRU update process (step S207 in FIG. 7) is included, which updates the write LRU 115, which records the order of updated files, by recording the file identifier every time a file in the high-speed storage 11 is updated. The low-frequency file identification process includes reference to the write LRU 115. Therefore, the write LRU 115 is used to record writing to the cache file 7 in the high-speed storage 11, and it is possible to identify cache files 7 that have not been updated recently.

[0045] (3) The order of file updates after the start of a transaction is recorded in the write LRU 115. When the transaction is committed (S214: YES), the process includes a commit time process (step S215 in FIG. 7) of writing to the low-speed storage 2 all of the cache files 7 stored in the high-speed storage 11 that have not been written to the low-speed storage 2 after being updated.

[0046] (Variation 1) FIG. 9 is a flowchart showing details of the advance write process in the first modification. The difference between FIG. 8 shown in the first embodiment and FIG. 9 in this modification is that step S229 is added. If a negative decision is made in step S222, the process proceeds to step S229. In step S229, the timing generation module 109 judges whether the corresponding addresses of the latest entry in the write LRU 115 and the target entry differ by a predetermined value or more. If the timing generation module 109 judges that the corresponding addresses of the latest entry and the target entry differ by a predetermined value or more, the process proceeds to step S223, and if the timing generation module 109 judges that the difference between the corresponding addresses of the latest entry and the target entry is less than the predetermined value, the process proceeds to step S224.

[0047] According to the first modification, the following advantageous effects can be obtained. (4) Each cache file 7 is a specific area cut out from a virtual memory space, which is a virtual memory space with an address. In the write back process, the write target file to be written to the low-speed storage 2 has an additional condition that the address in the virtual memory space to which the query 112 used for the judgment in the query discrimination process writes differs from the address in the virtual memory space to which the write target file corresponds by a predetermined value or more (step S229 in FIG. 9). Therefore, it is possible to suppress writing (S223) to the low-speed storage 2 of the cache file 7 whose virtual address is relatively close to the latest entry, in other words, the cache file 7 that is assumed to be likely to be written again in the future.

[0048] (Variation 2) Fig. 10 is a configuration diagram of a database system 1000A in Modification 2. The difference from the above-described embodiment is that data is stored in the memory 120 of the server 1 in units of cache files 7, not in units of pages 71. However, there is no difference in other configurations, and the processes in the flowcharts shown in Figs. 6 to 8 are also the same.

[0049] (Variation 3) In the above-described embodiment, the low-speed storage 2 is connected to the server 1 via the network 3. However, the low-speed storage 2 may be connected to the server 1 without the network 3, or the low-speed storage 2 may be built into the server 1. The high-speed storage 11 may be disposed outside the server 1 and connected to the server 1 via the network 3 in the same manner as the low-speed storage 2. The essential component of the memory 120, the high-speed storage 11, and the low-speed storage 2 is that they have different response times, and there is no limitation on their physical locational relationship. The difference in response time may be due to physical distance, hardware performance, or software processing. The difference in response time due to software processing may be caused by, for example, the high or low priority of the processing.

[0050] (Variation 4) In the embodiment described above, the database management unit 10 manages writing to the high-speed storage 11 using the write LRU 115. However, using the write LRU 115 is not an essential component, and it is sufficient if information that enables the determination in step S222 in Fig. 8 is created. For example, a list of file names of a predetermined number of cache files 7 that have been most recently updated may be stored, or a list of cache files 7 that have not been written to in a predetermined number of recent writes may be stored.

[0051] (Variation 5) In the above-described embodiment, the pre-write process in step S220 is executed only when a positive determination is made in step S208. However, step S220 may be executed in cases other than when a positive determination is made in step S208. For example, step S220 may be executed whenever step S207 is executed, or step S220 may be executed every time step S207 is executed a predetermined number of times, for example, 10 times. Furthermore, step S220 may be executed at predetermined time intervals, for example, every 30 seconds, regardless of the execution of step S207.

[0052] In each of the above-mentioned embodiments and modifications, the configuration of the functional blocks is merely an example. Some functional configurations shown as separate functional blocks may be integrated, or a configuration shown in one functional block diagram may be divided into two or more functions. In addition, some of the functions of each functional block may be provided by other functional blocks.

[0053] In the above-mentioned embodiments and modifications, the program of the server 1 is stored in the ROM 42, but the program may be stored in a non-volatile storage device (not shown). The server 1 may have an input / output interface (not shown), and the program may be read from another device via the input / output interface and a medium available to the server 1 when necessary. The medium here refers to, for example, a storage medium that is detachable from the input / output interface, or a communication medium, that is, a network such as a wired, wireless, or optical network, or a carrier wave or digital signal that propagates through the network. Some or all of the functions realized by the program may be realized by a hardware circuit or an FPGA.

[0054] The above-mentioned embodiments and modifications may be combined with each other. Although various embodiments and modifications have been described above, the present invention is not limited to these. Other aspects that are conceivable within the scope of the technical idea of ​​the present invention are also included in the scope of the present invention. [Explanation of symbols]

[0055] 1: Server 2: Slow storage 7: Cache files 9: Client 10: Database Management Department 11: High-speed storage 43: RAM Page 71 104: Query execution module 105: Scan execution module 106: Transaction execution module 107: Import execution module 108: Data input / output module 109: Timing generation module 110: Managed buffer 112 : Query 114: Index information 120: Memory 1000: Database Systems 1151: Cache file name 1152: Dirty bit 1153: Next entry pointer 109: Timing generation module 115: Write LRU

Claims

1. 1. An updating method in which a computer updates data stored in a first storage device by copying a plurality of files stored in a first storage device to a second storage device and writing the files updated in the second storage device back to the first storage device, comprising: said plurality of files forming part of a database; a query determination process for determining whether a query instructing writing to the file stored in the second storage device is specified using a cluster key of the database; a low-frequency file identification process for identifying files with a low write frequency among the files stored in the second storage device; a write-back process for writing the files with low write frequency identified by the low-frequency file identification process to the first storage device.

2. 2. The update method according to claim 1, The update method further comprises the steps of: performing the write-back process when it is determined by the query determination process that the query is a specification using a cluster key of the database.

3. 2. The update method according to claim 1, a write LRU update process for updating a write LRU that records an order of the updated files by recording an identifier of the file every time the file in the second storage device is updated; An updating method, wherein the low frequency file identification process includes referring to the write LRU.

4. 4. The updating method according to claim 3, The write LRU records the order of updates to the file since the transaction started, An update method further comprising a commit time process for writing, when a transaction is committed, all of the files stored in the second storage device that have not been written to the first storage device after updating to the first storage device.

5. 4. The updating method according to claim 3, Each of the files is a specific area cut out from a virtual memory space, which is a virtual memory space with addresses, An update method in which the write target file to be written to the first storage device in the write back process has an additional condition that the address in the virtual memory space to which the query used for judgment in the query determination process is written differs by a predetermined value or more from the address in the virtual memory space to which the write target file corresponds.

6. 1. A database updating device that updates data stored in a first storage device by copying a plurality of files stored in a first storage device to a second storage device and writing the files updated in the second storage device back to the first storage device, said plurality of files forming part of a database; a query determination unit that determines whether a query instructing writing to the file stored in the second storage device is specified using a cluster key of the database; a low-frequency file identification unit that identifies a file that has a low write frequency among the files stored in the second storage device; a write back unit that writes the low-write-frequency files identified by the low-write-frequency file identifying unit to the first storage device.

7. 7. The database updating device according to claim 6, A database updating device in which the write back unit writes a file with a low write frequency identified by the low frequency file identification unit to the first storage device when the query determination unit determines that the query is a specification using a cluster key of the database.

8. 7. The database updating device according to claim 6, a write LRU update process for updating a write LRU that records an order of the updated files by recording an identifier of the file every time the file in the second storage device is updated; The low-frequency file identifying unit identifies a file that is written infrequently by referring to the write LRU.

9. 9. The database updating device according to claim 8, The write LRU records the order of updates to the file since the transaction started, The database updating device further includes a commit time process for writing, when a transaction is committed, all of the files stored in the second storage device that have not been written to the first storage device after updating to the first storage device.

10. 9. The database updating device according to claim 8, Each of the files is a specific area cut out from a virtual memory space, which is a virtual memory space with addresses, A database update device in which the write target file to be written to the first storage device by the write back unit has an additional condition that the address in the virtual memory space to which the query used for judgment by the query determination unit writes the file to be written differs by a predetermined value or more from the address in the virtual memory space to which the query used for judgment by the query determination unit corresponds.

Citation Information

Patent Citations

  • Database management system, memory management device, database management method, and program

    JP2020013318A