WO2014097475A1 - 情報処理方法、情報処理装置、及び、プログラム - Google Patents

情報処理方法、情報処理装置、及び、プログラム Download PDF

Info

Publication number
WO2014097475A1
WO2014097475A1 PCT/JP2012/083289 JP2012083289W WO2014097475A1 WO 2014097475 A1 WO2014097475 A1 WO 2014097475A1 JP 2012083289 W JP2012083289 W JP 2012083289W WO 2014097475 A1 WO2014097475 A1 WO 2014097475A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
update
record
transaction log
database
Prior art date
Application number
PCT/JP2012/083289
Other languages
English (en)
French (fr)
Inventor
山田 浩之
Original Assignee
株式会社Murakumo
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 株式会社Murakumo filed Critical 株式会社Murakumo
Priority to PCT/JP2012/083289 priority Critical patent/WO2014097475A1/ja
Priority to EP12890487.7A priority patent/EP2937788A4/en
Priority to JP2014552858A priority patent/JP6082029B2/ja
Publication of WO2014097475A1 publication Critical patent/WO2014097475A1/ja
Priority to US14/744,877 priority patent/US10437812B2/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/23Updating
    • G06F16/2358Change logging, detection, and notification
    • 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/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Definitions

  • the present invention relates to an information processing method, an information processing apparatus, and a program.
  • FIG. 1 shows two methods for performing replication by synchronizing another master or slave with the master.
  • the transaction log generated in the master is transmitted to the other master or slave, and ACK is returned to the master after the database update is completed in the other master or slave. . Then, the commit of the target transaction is completed.
  • FIG. 1 shows a second method (method indicated by a dotted line).
  • ACK is returned to the master at the time when reception of the transaction log is completed in another master or slave, regardless of whether or not the transaction log is applied. Therefore, in the second method, it is possible to shorten the time until the transaction commit is completed, and it is possible to improve the performance of the entire system.
  • Patent Document 1 a method of waiting for execution of search processing occurring in another master or slave until replication is completed.
  • a third method shown in FIG. 2 has been proposed (for example, Patent Document 2 is cited).
  • the master creates a plurality of transaction logs in parallel, and transmits the plurality of transaction logs created in parallel to another master or slave.
  • the plurality of transaction logs are applied to the database in parallel.
  • the transaction log can be applied in parallel to another master or slave database, so that it seems that the processing speed of applying the transaction log to the database is improved.
  • the third method has the following problems.
  • the first problem is that the technology related to transaction logs is a technology related to the foundation of the database, such as being used for recovery in the event of a failure.
  • the transaction log is created in a serial state. Therefore, in order to implement the third method in the conventional system, there is a risk of changing the system related to the base of the database.
  • the order in which the parallelized transaction logs are applied is determined in order to maintain consistency with the master database.
  • the mechanism will be provided in another master or slave. Therefore, when the third method is performed, the system becomes complicated.
  • the number of transactions processed in parallel varies depending on the situation, while the number of transaction logs created in parallel is fixed. Therefore, in the third method, the problem of imbalance between the number of transactions and the number of transaction logs is not fundamentally solved, and the speed of processing for applying the transaction log to the database is not necessarily improved.
  • the present invention has been made in consideration of such points, and an object thereof is to improve the processing speed of updating a database by applying a transaction log.
  • a computer that updates its own database using a transaction log obtains the transaction log, refers to the records of the obtained transaction log in order from the top, and stores them in the transaction log.
  • the update instruction is executed, When the target of the update instruction indicated by the record has not been read out on the memory of the computer, the execution of the update instruction is made to wait, thereby processing the acquired record of the transaction log, and waiting
  • the target of the update instruction is the memory When the target of the update command that has been waited for and processed is read into the memory and becomes the target of processing, the update command that has been waited for the target is executed. And an information processing method for executing.
  • the acquired transaction log is referred to and processed in order from the beginning of the record.
  • the record of the update instruction target is read by the record when it is read out on the computer memory.
  • the update instruction is executed.
  • execution of the update instruction indicated by the record is put on standby. Then, until the target of the update command that has been waited is read into the memory and becomes the target of processing, or the target of the update command that has been waited is read into the memory and becomes the target of processing In this case, the command that is made to wait for the target is executed.
  • processing is executed for an update command that does not require reading data from a database.
  • the first form of the present invention delays processing for an update instruction that needs to read data from a database. Therefore, according to the first aspect of the present invention, it is possible to efficiently perform data read and write processing when a database is updated by applying a transaction log. In addition, it is possible to process update instructions that have been put on standby in parallel.
  • the computer in the step in which the computer acquires the transaction log, in order to perform replication between a database of another computer and the own database, the computer is created in series in the other computer. It is the information processing method of the 1st form which acquires the done transaction log.
  • the computer waits for execution of the update instruction indicated by the record
  • the computer waits to indicate that there is an update instruction that has been waited for in the target of the update instruction.
  • At least one of the content of the update command and the number of the record is recorded in map information in association with the target of the update command, and the update command waiting for the target is executed with reference to the map information. It is the information processing method of a 1st form or a 2nd form.
  • the computer when the computer performs reading into the memory to be processed for each predetermined set and waits for execution of the update instruction indicated by the record, the computer waits for the update instruction target.
  • the update instruction target In order to indicate that the updated instruction is present, at least one of the content of the updated instruction and the number of the record that has been waited is recorded in map information in association with a predetermined set including the target of the updated instruction.
  • the map information is read before the predetermined set is read onto the memory and becomes a processing target, or when the predetermined set is read onto the memory and becomes a processing target.
  • the information processing method according to the first form or the second form, in which the update command that is made to wait for the target included in the predetermined set is executed.
  • the computer causes the search process for the database to wait until the process for the record of the transaction log that is required to be processed with respect to the search process is completed. It is an information processing method in any form of form to 4th form.
  • a computer that updates its own database using a transaction log acquires the transaction log, refers to the records of the acquired transaction log in order from the top, and stores them in the transaction log.
  • a record related to an update instruction for updating data included in the database by waiting for execution of the update instruction, a step of processing the acquired record of the transaction log, An information processing method that executes a step of executing an update command that has been waited for the target until the target becomes a target of processing or when a target of the update command that has been waiting has been processed. is there.
  • the computer in the step in which the computer acquires the transaction log, in order to perform replication between a database of another computer and the own database, the computer is serially created in the other computer. It is the information processing method of the 6th form which acquires the done transaction log.
  • the update command contents and the update command are used to indicate that there is an update command that is waiting for the update command.
  • the at least one of the record numbers related to the update command is recorded in map information in association with the target of the update command, and the update command waiting for the target is executed with reference to the map information.
  • the update instruction when the computer performs reading into the memory to be processed for each predetermined set and waits for execution of the update instruction, the update instruction is made to wait for the target of the update instruction. Is recorded in map information in association with a predetermined set including the target of the update command, and at least one of the content of the update command and the number of the record that have been waited An update command that waits for an object included in the predetermined set with reference to the map information until the set becomes a processing target or when the predetermined set becomes a processing target. It is the information processing method of the 6th form or the 7th form to perform.
  • the computer causes the search process for the database to wait until the process for the record of the transaction log required to be processed with respect to the search process is completed.
  • An information processing method according to any one of forms 9 to 9.
  • an information processing apparatus that implements each of the above configurations, an information processing system, or a program may be used. It may be a storage medium that can be read by a computer, other devices, machines, or the like in which such a program is recorded.
  • the computer-readable recording medium is a medium that stores information such as programs by electrical, magnetic, optical, mechanical, or chemical action.
  • the information processing system may be realized by one or a plurality of information processing devices.
  • the eleventh aspect of the present invention is an information processing apparatus that updates its own database using a transaction log, and refers to the means for acquiring the transaction log and the records of the acquired transaction log in order from the top.
  • the record relating to the update instruction for updating the data included in the database if the target of the update instruction indicated by the record is read on the memory of the computer, An update instruction is executed, and when the target of the update instruction indicated by the record has not been read out on the memory of the computer, execution of the update instruction is waited to process the acquired record of the transaction log Means and the target of the update command An update instruction that is waiting for an update instruction that has been read into the memory and becomes a target of processing, or when a target of an update instruction that has been waited for is read into the memory and becomes a target of processing And an information processing apparatus.
  • the twelfth aspect of the present invention refers to a step of acquiring the transaction log in a computer that updates its own database using the transaction log, and sequentially refers to the records of the acquired transaction log from the top, Of the records included in the transaction log, for a record relating to an update instruction for updating data included in the database, the update instruction when the target of the update instruction indicated by the record is read out on the memory of the computer And processing the obtained record of the transaction log by waiting for execution of the update instruction when the target of the update instruction indicated by the record is not read on the memory of the computer; Of the update instruction that was made to wait When an elephant is read into the memory and becomes a target of processing, or when a target of an update instruction that has been waited is read into the memory and becomes a target of processing, the target is made to wait. For executing the update instruction.
  • the thirteenth aspect of the present invention is an information processing apparatus that updates its own database using a transaction log, the means for acquiring the transaction log, and the acquired record of the transaction log from the beginning.
  • An information processing apparatus comprising:
  • a computer that updates its own database using a transaction log is referred to the records of the acquired transaction log in order from the top, and among the records included in the transaction log.
  • the processing speed for applying the transaction log to the database can be improved.
  • FIG. 1 illustrates a conventional method for performing replication by synchronizing another master or slave with the master.
  • FIG. 2 illustrates a conventional method for performing replication by synchronizing another master or slave with the master.
  • FIG. 3 illustrates an information processing apparatus according to the embodiment.
  • FIG. 4 illustrates the relationship between the processes executed in the information processing apparatus according to the embodiment.
  • FIG. 5 shows a database update example according to the embodiment.
  • FIG. 6 illustrates a transaction log acquired in the information processing apparatus according to the embodiment.
  • FIG. 7 illustrates an operation state of the information processing apparatus according to the embodiment at the time when the query is received.
  • FIG. 8 illustrates the operation state of the information processing apparatus at the time when the main process according to the embodiment is completed up to the 36th record.
  • FIG. 1 illustrates a conventional method for performing replication by synchronizing another master or slave with the master.
  • FIG. 2 illustrates a conventional method for performing replication by synchronizing another master or slave with the master.
  • FIG. 3 illustrates an information processing apparatus according
  • FIG. 9 illustrates the operation state of the information processing apparatus when the processing of the main process according to the embodiment is completed up to the record of the synchronization point.
  • FIG. 10 illustrates the processing procedure of the helper process according to the embodiment.
  • FIG. 11 illustrates a processing procedure of the back-end process according to the embodiment.
  • FIG. 12 illustrates the operation state of the information processing apparatus at the time when the main process according to the embodiment is completed up to the 36th record.
  • FIG. 13 illustrates the operation state of the information processing apparatus at the time when the processing of the main process according to the embodiment is completed up to the synchronization point record.
  • FIG. 14 illustrates the processing procedure of the helper process according to the embodiment.
  • FIG. 15 illustrates the processing procedure of the back-end process according to the embodiment.
  • this embodiment an embodiment according to one aspect of the present invention (hereinafter also referred to as “this embodiment”) will be described with reference to the drawings.
  • the present embodiment described below is merely an example of the present invention in all points, and is not intended to limit the scope thereof. It goes without saying that various improvements and modifications can be made without departing from the scope of the present invention. That is, in implementing the present invention, a specific configuration according to each embodiment may be employed as appropriate.
  • data appearing in this embodiment is described in a natural language, more specifically, it is specified by a pseudo language, a command, a parameter, a machine language, etc. that can be recognized by a computer.
  • FIG. 3 illustrates a hardware configuration of the information processing apparatus 1 according to the present embodiment.
  • the information processing apparatus 1 according to the present embodiment is a computer in which a control unit, a storage device, and a communication interface for performing communication via a network are electrically connected.
  • the control unit includes a CPU (Central Processing Unit), a RAM (Random Access Memory), a ROM (Read Only Memory), and the like.
  • the storage device stores a program executed by the control unit and stores a database (“DB” in the figure).
  • the communication interface is described as “communication I / F”.
  • the RAM and ROM included in the control unit may be referred to as a main storage device, and the storage device may be referred to as an auxiliary storage device.
  • the CPU included in the control unit may be referred to as a processing device.
  • the information processing apparatus 1 may be a PC (Personal Computer), a server machine, or the like.
  • control unit may include a plurality of processors.
  • FIG. 4 illustrates the relationship between the processes executed in the information processing apparatus 1.
  • the information processing apparatus 1 is a computer that acquires a transaction log and updates a database stored in its own storage device using the acquired transaction log.
  • the information processing apparatus 1 refers to the acquired transaction log records in order from the top and applies them to its own database.
  • the information processing apparatus 1 executes an update command for data (tuple) read to the RAM, and skips an update command for data not read to the RAM.
  • the skipped update command is executed before or when the target data is read out to the RAM. Thereby, the update of the database using the transaction log is completed.
  • control unit of the information processing apparatus 1 expands a program or the like stored in the storage device to a RAM or the like, and interprets the contents thereof, thereby "MAIN"), back-end process (“BACKEND” in the figure), and helper process ("HELPER” in the figure).
  • the main process is a process that refers to the acquired transaction log records in order from the top and applies them to its own database.
  • the transaction log includes a record relating to an update command for updating data included in the database and a record relating to transaction management.
  • the main process executes the update instruction for the record related to the update instruction that updates the data included in the database among the records included in the acquired transaction log if the update instruction target is read on the RAM.
  • the acquired transaction log record is processed by waiting for execution of the update command.
  • the waited update command is processed by the helper process or the back-end process, and the database update using the transaction log is completed.
  • the helper process is an auxiliary process of the main process and the back-end process described later.
  • the helper process executes an update instruction that is waited by the main process.
  • the back-end process is a process that executes a search process in response to a search request (query) for a database from a client PC (“CL” in the figure).
  • the update instruction waited by the main process may be executed not only by the helper process but also by the back-end process.
  • the back-end process according to the present embodiment waits for execution of the search process until the process of the main process for the transaction log record that is required to be processed for the search process is completed.
  • the back-end process may execute processing other than search processing.
  • the processing executed by the back-end process is not limited to search processing.
  • the transaction log used for updating the database may be created by itself in order to recover its own database.
  • the information processing apparatus 1 acquires the transaction log from the storage device of itself or another computer.
  • the transaction log used for updating the database in the present embodiment may be created in another computer in order to perform replication between the database of the other computer and its own database.
  • the information processing apparatus 1 acquires the transaction log from another computer.
  • the transaction log used for updating the database in the present embodiment may be created in series or in parallel. However, in order not to change the technology related to the transaction log from the conventional system, the transaction log used in the present embodiment should be created in series.
  • This embodiment can be widely applied to systems that update a database using a transaction log.
  • FIG. 5 shows a database update example in this operation example.
  • FIG. 6 illustrates a transaction log acquired in this operation example.
  • FIG. 5 exemplifies a scene in which a part of the database in the table format including the line number, instruction content, and pointer is updated. Specifically, FIG. 5 shows a scene in which the tuples with line numbers 101, 103, and 104 are deleted (DELETE), and the tuples with line numbers 205 and 206 are inserted (INSERT).
  • the format of the database is not limited to the table format, and may be appropriately selected according to the embodiment.
  • each tuple of the database is managed in units of pages on the storage device, and data exchange between the storage device and the RAM is This is done in units of pages.
  • the control unit reads the page including the update target tuple from the storage device to the RAM, and updates the target tuple. Then, after updating the target tuple, the control unit stores the database update by writing the page including the tuple from the RAM to the storage device. Note that the timing at which a page is written from the RAM to the storage device is appropriately determined according to the embodiment.
  • One or more tuples are stored in the page.
  • a page may be referred to as a block, and corresponds to a “predetermined set” of the present invention.
  • FIG. 6 exemplifies a transaction log created in series when the database shown in FIG. 5 is updated.
  • the transaction log at least the instruction content and the target of the instruction are continuously recorded in time series.
  • the first transaction is started (XB1), and the tuple of the row number 101 stored in the page with the page number 5 is deleted by the first transaction (D1_101_5).
  • the transaction is started (XB2), and the tuple with the row number 205 is inserted into the page with the page number 2 by the second transaction (I2 — 205_2).
  • the tuple with the row number 103 stored in the page with the page number 2 by the first transaction Is deleted (D1_103_2), the first transaction is committed (XC1), the tuple of row number 104 stored in the page of page number 9 is deleted by the second transaction (D2_104_9), and the page is deleted by the second transaction.
  • Issue 8 page tuples line number 206 is inserted into the (I2_206_8), 2 th transaction indicates that it is committed (XC2).
  • the record of the transaction log illustrated in FIG. 6 includes a record (D1_101_5, D1_103_2, I2_205_2, D2_104_9, I2_206_8) related to an update command for updating data included in the database, and a record (XB1, XB2, XC1, XC2).
  • a number (LSN: log sequence number) for specifying each record is given.
  • ⁇ Main process> 7-9 illustrate the operation of the main process.
  • FIG. 7 illustrates the operation state of the information processing apparatus 1 at the time when the query is received.
  • the tuple with row number 103 is stored in the page with page number 2 (P2)
  • the tuple with row number 101 is stored in the page with page number 5 (P5)
  • the tuples with row numbers 102 and 104 are page numbers. 9 (P9).
  • pages with page numbers 1, 5, and 8 (P1, P5, and P8) are read on the RAM.
  • the transaction log is acquired up to the 40th record, and the processing of the main process is completed up to the record before the 32nd record.
  • a back-end process is activated in response to a query from the client PC.
  • the main process refers to the acquired transaction log records in order from the top. Then, if the referenced record is a record related to a database update instruction, the main process is concerned with an update instruction (for example, a DELETE instruction) whose target (tuple) exists in the database when the record is referenced. Then, it is determined whether or not the target (tuple) of the update instruction has been read on the RAM. On the other hand, for an update instruction (for example, an INSERT instruction) whose target (tuple) does not exist in the database when the record is referenced, an area where the target (tuple) of the update instruction is inserted is stored in the RAM.
  • an update instruction for example, an INSERT instruction
  • the main process determines whether or not a page including a tuple that is a target of an update instruction indicated by a record has been read onto the RAM. .
  • the main process executes the update command indicated by the target record. On the other hand, if the target page has not been read onto the RAM, the main process waits for execution of the update instruction indicated by the target record.
  • the main process updates management information for managing the transaction in accordance with the content indicated by the record.
  • the management information indicates, for example, a transaction being executed or a committed transaction.
  • the main process waits for execution of the update command indicated by the referenced record, it creates map information that records the content of the waited update command in association with the tuple.
  • map information At least one of the contents of the update command that has been waited and the record number is recorded in association with the tuple that is the target of the update command.
  • the helper process or the back-end process executes the waited update instruction with reference to the map information.
  • the transaction log in which the content of the instruction is recorded is held in the RAM or the storage device of the information processing apparatus 1. Therefore, when the transaction log record number is recorded in the map information, the helper process or the back-end process accesses the transaction log held in the RAM or the storage device based on the record number recorded in the map information.
  • the content of the update command to be executed is specified.
  • the tuple that is the target of the update command is managed in units of pages. Therefore, at least one of the content of the update command and the record number of the transaction log is recorded in the map information in association with the page (specifically, the page number) including the tuple that is the target of the update command. .
  • the present embodiment an example in which the content of an update command or a record number is recorded in association with a page number is shown.
  • the information processing apparatus 1 returns an ACK regardless of whether or not the transaction log is applied, and the information processing apparatus 1 and other computers It is assumed that replication is performed in synchronization with each other. Therefore, a synchronization point is set in the transaction log shown in FIG.
  • the synchronization point indicates a record that is required to be processed with respect to the search processing for the database of the information processing apparatus 1.
  • the back-end process executes search processing until the processing of the main process reaches the synchronization point set when the query is received, that is, until the processing of the main process for the record No. 40 is completed in this operation example. Wait.
  • the information indicating the processing completion point and the information indicating the synchronization point are held on the RAM, for example. For example, each time the main process completes the process, the process completion point is updated to indicate a record for which the process has been completed. In addition, the synchronization point is updated to indicate a record that has returned ACK, for example, every time an ACK indicating that a transaction log has been received is returned.
  • the synchronous replication method applied in the present embodiment is not limited to the second method illustrated in FIG. 1, for example, as in the first method illustrated in FIG. 1.
  • a method in which the information processing apparatus 1 returns ACK after applying the log to the database may be applied to the present embodiment.
  • the replication method executed in the information processing apparatus 1 may be asynchronous replication instead of synchronous replication. In these cases, since the synchronization point is not set, the operation of waiting for the search processing until the synchronization point is unnecessary among the operations of the back-end process according to the present embodiment.
  • FIG. 8 illustrates the operation state of the information processing apparatus 1 at the time when the main process is completed up to the 36th record after the state illustrated in FIG.
  • the No. 33, No. 35 and No. 36 records are records related to the database update command.
  • the 32nd and 34th records are records related to transaction management, and are records related to instructions other than update instructions.
  • the target of the update instruction indicated by the No. 33 record is the tuple of the row number 101 stored in the page P5.
  • the page P5 including the tuple with the line number 101 is read out on the RAM.
  • the target of the update command indicated by the 35th record is the tuple of the line number 205 inserted into the page of P2, and the page of P2 which is the area where the tuple of the line number 205 is inserted is stored on the RAM.
  • the target of the update command indicated by the 36th record is the tuple with the line number 103 stored in the page P2, and the P2 page including the tuple with the line number 103 is the same as the 35th record. Not read out on RAM.
  • the main process first refers to the record No. 32 and executes the command indicated by the record No. 32. Specifically, the 32nd record indicates the start of the first transaction. Therefore, the main process updates the management information so as to indicate that the state of the first transaction is being executed, for example.
  • the main process refers to the next 33rd record. Since the target of the update command (D1_101_5) indicated by the 33rd record has been read onto the RAM, the main process executes the update command (D1_101_5) indicated by the 33rd record. Specifically, the main process assigns a deletion pointer to the tuple of the line number 101 of P5 read out on the RAM.
  • the main process refers to the next 34th record and executes the command indicated by the 34th record.
  • the 34th record indicates the start of the second transaction. Therefore, the main process updates the management information so as to indicate that the state of the second transaction is being executed, for example.
  • the main process refers to the next 35th record. Since the target of the update command (I2_205_2) indicated by the 35th record has not been read out on the RAM, the main process waits for execution of the update command (I2_205_2) indicated by the 35th record. Then, the main process stores the contents of the update command (I2_205_2) indicated by the 35th record or the record number (35) in the map information in association with the page number (P2).
  • the main process refers to the next 36th record.
  • the target of the update command (D1_103_2) indicated by the 36th record is not read out on the RAM as in the 35th record. Therefore, the main process also waits for execution of the update command (D1_103_2) indicated by the 36th record. Then, the main process stores the contents of the update command (D1_103_2) indicated by the 36th record or the record number (36) in the map information in association with the page number (P2). This completes the processing of records up to number 36.
  • the main process records the content of the update command or the record number in the map information according to the order of reference.
  • the helper process or back-end process described later can recognize the execution order of the waiting update instructions.
  • the helper process or the back-end process updates the update command according to the record number of the update command that has been waited.
  • the execution order of instructions can be recognized.
  • the back-end process waits for execution because the processing of the main process has not been completed up to the 40th record, which is the synchronization point set when the query is received.
  • FIG. 9 illustrates the operation state of the information processing apparatus 1 at the time when the processing of the main process is completed up to the record of the synchronization point (number 40) set at the time of FIG. 7 after the state illustrated in FIG. To do.
  • the 38th and 39th records are records relating to database update instructions.
  • the 37th and 40th records are records related to transaction management, and are records related to commands other than the update command.
  • the target of the update command indicated by the 38th record is the tuple of the row number 104 stored in the page P9.
  • the page of P9 including the tuple is not read out on the RAM.
  • the target of the update command indicated by the 39th record is the tuple of the line number 206 inserted into the page of P8, and the page of P8, which is the area where the tuple of the line number 206 is inserted, is stored in the RAM. It has been read.
  • the main process first refers to the 37th record and executes the command indicated by the 37th record. Specifically, the 37th record indicates the commit of the first transaction. Therefore, the main process updates the management information to indicate that the first transaction has been committed, for example.
  • the main process refers to the next 38th record. Since the target of the update command (D2_104_9) indicated by the 38th record has not been read on the RAM, the main process waits for execution of the update command (D2_104_9) indicated by the 38th record. Then, the main process records the contents of the update command (D2_104_9) indicated by the 38th record or the record number (38) in the map information in association with the page number (P9).
  • the main process When the 38th record is processed, the main process refers to the next 39th record. Since the target of the update command (I2_206_8) indicated by the 39th record has been read onto the RAM, the main process executes the update command (I2_206_8) indicated by the 39th record. Specifically, the main process inserts a tuple with the line number 206 into the page P8 read out on the RAM.
  • the main process refers to the next 40th record and executes the command indicated by the 40th record. Specifically, the 40th record indicates the commit of the second transaction. Therefore, the main process updates the management information so as to indicate, for example, that the second transaction has been committed.
  • the processing of the main process is completed up to the 40th record that is the synchronization point set at the time of receiving the query, so the back-end process can execute the search processing for the target query. .
  • FIG. 10 illustrates the processing procedure of the helper process in this embodiment.
  • FIG. 10 illustrates a scene in which processing by the helper process is started before search processing by the back-end process in FIG. 9 is started.
  • step S11 the helper process refers to the map information and determines whether there is a waiting update command. If the waiting update instruction is not recorded in the map information, the helper process ends the process. On the other hand, if the waiting update command is recorded in the map information, the target to be processed is selected according to the management unit, and the process proceeds to step S12. In the example illustrated in FIG. 10, the update command that has been put on standby is managed in units of pages, and the helper process selects the page P9 as a target to be processed by itself.
  • step S12 the helper process reads a target to be processed from the storage device into the RAM.
  • the page P9 is selected as the processing target of the helper process, the page P9 is read from the storage device to the RAM.
  • step S13 the helper process executes a standby update command associated with the processing target selected by itself.
  • the helper process executes an update instruction (D2_104_9) waiting for P9, and assigns a deletion pointer to the tuple of line number 104.
  • the helper process executes the update command waiting for the processing target (P9) selected by itself, and then deletes the record related to the processed update command from the map information, and ends the processing.
  • the helper process sets the standby update commands in the order recorded in the map information (number order). Execute. Thereby, regarding the page, the consistency of the database can be maintained while replication is being executed between the information processing apparatus 1 and the replication source computer.
  • control unit of the information processing apparatus 1 may execute a plurality of helper processes, and may increase or decrease the number of helper processes that operate by generating, deleting, starting, or stopping helper processes. For example, according to the management unit of the update instruction that is recorded in the map information that has been waited for, the control unit, in this operation example, determines the number of pages in which the update instruction that has been waited for is recorded in the map information. Accordingly, the number of helper processes to be started may be increased or decreased. In this case, the processing capability of the helper process can be varied according to the request, and the existence of a useless helper process can be avoided, so that resources can be efficiently used.
  • helper processes may be activated in advance. In this case, there is a possibility that a useless helper process may exist depending on processing conditions. However, on the other hand, it is not necessary to start the helper process again when a request for processing occurs, and it becomes possible to quickly respond to the generated request.
  • helper process may appropriately execute processing according to the embodiment other than the timing shown in this operation example.
  • the helper process can execute the operation illustrated in FIG.
  • FIG. 11 illustrates the processing procedure of the back-end process in this embodiment.
  • FIG. 11 illustrates a scene where search processing by the back-end process has started after the state illustrated in FIGS. 9 and 10.
  • step S21 the back-end process accesses an area specified as a search range by the query in the storage area of the storage device in order to extract a tuple that matches the content of the received query.
  • step S22 when the page included in the accessed area does not exist in the RAM, the back-end process reads the page from the storage device to the RAM and sets it as a target of search processing. For example, when a database includes a plurality of tables, a specific table may be specified as a search range. In this case, the back-end process accesses an area that holds data relating to the table specified as the search range, and reads the data of the table that is the search range from the storage device to the RAM when the data does not exist in the RAM. .
  • the area to be read from the storage device to the RAM, the search range specified by the query, and the like may be appropriately determined according to the embodiment.
  • the back-end process may read, for example, each target page or a plurality of pages at a time when pages included in the search range are read from the storage device to the RAM. In this case, every time one or more pages are read, the back-end process executes processing to be described later on the read one or more pages.
  • FIG. 11 illustrates a scene in which the page P2 is read from the storage device to the RAM by the process of step S22.
  • step S23 If the page included in the area accessed by the back-end process already exists in the RAM, the back-end process does not read from the storage area, but uses the page already existing in the RAM as the target of the search process, step S23. Instead, the process proceeds to step S25.
  • step S23 the back-end process refers to the map information and determines whether there is an update command waiting for the page read into the RAM. If the update instruction waiting for the page read into the RAM is not recorded in the map information, the back-end process proceeds to step S25. On the other hand, when the update command waiting for the page read into the RAM is recorded in the map information, the process proceeds to step S24.
  • the page P2 is read into the RAM in step S22, and there are update instructions (I2_205_2 and D1_103_2) waiting for the tuples stored in the page P2, so that the process proceeds to step S24. Proceed to
  • step S24 the back-end process executes an update command waiting for the page read into the RAM.
  • the back-end process executes update instructions (I2_205_2 and D1_103_2) waiting for P2.
  • the back-end process executes the waiting update instructions in the order recorded in the map information. That is, in this operation example, the back-end process inserts the tuple with the line number 205 into P2, and then assigns the deletion pointer to the tuple with the line number 103. Then, the back-end process deletes the record relating to the processed update instruction from the map information after executing all the update instructions waiting for the page (P2) read into the RAM.
  • the back-end process waits in the order (number order) recorded in the map information when a plurality of update commands are waiting on the page selected as the processing target. Execute update instructions. Thereby, regarding the page, the consistency of the database can be maintained while replication is being executed between the information processing apparatus 1 and the replication source computer.
  • step S25 the back-end process executes a search process corresponding to the received query on the page targeted for the search process. If a page that is not the target of the search process remains in the search range, the back-end process returns to step S22 and repeats the process. On the other hand, if there are no remaining pages not subject to the search process in the search range, the back-end process returns the search process result to the client PC as a response to the query, and the process ends.
  • step S22 when a page is read out to the RAM, an update command that has been put on standby is executed for the page. In addition, an update instruction for a page existing on the RAM is immediately executed. Therefore, in this embodiment, when a page included in the search range has already been read into the RAM, execution of an update command for the page is not waited for. Therefore, in step S22, when the page to be read already exists in the RAM, the back-end process according to the present embodiment does not read from the storage area and searches for a page that already exists in the RAM. The process may be processed, and the processes in steps S23 and S24 may be omitted, and the process may proceed to step S25.
  • control unit of the information processing apparatus 1 may execute a plurality of back-end processes, and may increase or decrease the number of back-end processes that operate by generating, deleting, starting, or stopping the back-end processes. .
  • control unit may increase or decrease the number of back-end processes to be activated according to the number of queries received from the client PC.
  • the processing capability of the back-end process can be varied according to the request, and the existence of a useless back-end process can be avoided, so that resources can be efficiently used.
  • the back-end process may leave at least processing relating to page update in steps S23 and S24 to the helper process.
  • the back-end process requests the helper process to update the page, and causes the helper process to execute the processes of steps S23 and S24.
  • the back-end process receives a notification from the helper process after the process of step S24 is completed, the back-end process executes the search process of step S25.
  • the back-end process leaves the page update process to the helper process, whereby the page update process can be centralized in the helper process. Thereby, the division of roles of each process can be clarified, and the structure of each process can be simplified.
  • the main process immediately executes an update command for a page that may be subject to processing at any time because it has already been read into the RAM when the target record is referenced.
  • the main process since the main process does not exist in the RAM when the target record is referred to, the main process waits for execution of an update instruction for a page that is not likely to be processed.
  • the update instruction waited by the main process is read by the operation of the helper process or the back-end process as described above until the target of the update instruction is read out on the RAM and becomes the processing target, or This is executed when the target of the update instruction is read out on the RAM and becomes the target of processing.
  • the update command for inserting the tuple is an update command indicated by the record before the synchronization point related to the search processing according to the received query.
  • the update instruction has already been executed by the back-end process (or helper process). Therefore, the tuple with the line number 205 is a target of the search process without any problem.
  • the main process sequentially refers to the records of the transaction log from the top, and immediately executes an update command for a page that may be a target of processing when the target record is referred to.
  • execution of an update command for a page that is not likely to be processed is put on standby.
  • the waiting update instruction is executed by the helper process or the back-end process until it is requested that the update instruction is executed.
  • the update instruction to be waited for is an instruction for a page that needs to access the storage device.
  • the speed of accessing the storage device is much slower than the speed of accessing the RAM, and the database update processing becomes slower as the number of accesses to the storage device increases.
  • the transaction log can be processed without executing an update command that needs to access such a storage device. Therefore, the main process can be executed at a very high speed without accessing the storage device.
  • the transaction log up to the synchronization point can be processed at a high speed, and the search waiting time by the back-end process can be extremely shortened.
  • the waiting update command is executed until it is requested by the helper process or the back-end process that the update command is being executed. Therefore, in the search by the back-end process, even if there is a waiting update command, the search processing target can refer to the update by the update command up to the record number where the synchronization is completed. Therefore, even during replication, the back-end process can perform a search in a state where the consistency of the database is ensured.
  • the transaction log up to the synchronization point is shown. It was necessary to execute all the update instructions.
  • helper process or the back-end process executes the update commands in the order indicated by the transaction log when executing a plurality of update commands for the page. Therefore, it is possible to improve the efficiency of the exchange between the storage device and the RAM while maintaining the consistency of the database.
  • the information processing apparatus 1 uses the map information to manage the update command skipped by the main process in units of pages. Since the database update process is performed for each page, the execution of the update instruction skipped by the main process can be processed in parallel in separate processes for each page.
  • the information processing apparatus 1 can increase or decrease the degree of parallel processing, in other words, the number of helper processes or back-end processes to be activated as necessary.
  • the control unit of the information processing apparatus 1 operates the same number of helper processes as the number of pages recorded in the map information, thereby executing the update command that is kept waiting for each page recorded in the map information. Can be processed in parallel.
  • the degree of parallel execution of the waited update instruction can be increased or decreased depending on the situation, so there is no difference between the number of transactions that can be processed in parallel and the number of transaction logs. It can solve the problem of equilibrium.
  • the processing speed for applying the transaction log to the database can be increased.
  • transaction logs created in series are used for updating the database. Therefore, according to the present embodiment, it is possible to improve the processing speed of applying the transaction log to the database without changing the technology related to the creation of the transaction log from the conventional system.
  • an update command (INSERT command, DELETE command) for processing one tuple is given as an example of a database update command.
  • the database update command is not limited to the update command for processing such one tuple.
  • the main process executes the instruction part for the tuple read out to the RAM among the UPDATE instructions, and records the instruction part for the tuple not read into the RAM in the map information.
  • an update instruction for processing a plurality of tuples is handled as a collection of a plurality of update instructions for processing a single tuple, and the control unit is similar to an update instruction for processing a single tuple.
  • the control unit of the information processing apparatus 1 determines that the tuple is the processing target when the tuple that is the target of the update instruction is read into the RAM.
  • the stage at which the control unit determines that the target of the update command is the processing target is not limited to such an example.
  • the control unit of the information processing device 1 does not determine that the tuple that is the target of the update instruction is read into the RAM, but does not determine that the tuple has been processed. When the lock is acquired, it may be determined that the tuple has been processed.
  • the control unit of the information processing apparatus 1 may detect that the locked target has become a processing target when the lock is applied.
  • the second embodiment of the present invention can be described in substantially the same manner as the first embodiment except for some processes. Therefore, portions that can be described in the same manner as in the first embodiment are omitted as appropriate.
  • the information processing apparatus 1 refers to the records of the acquired transaction log in order from the top, and among the records included in the transaction log, the record related to the update command for updating the data included in the database. Then, by waiting for execution of the update command, the acquired record of the transaction log is processed. The skipped update command is executed before the target data becomes a processing target or when the target data becomes a processing target.
  • the information processing apparatus 1 updates the tuple read to the RAM when referring to the transaction log, in that it waits for all update instructions once in the transaction log record processing. This is different from the first embodiment in which an instruction is executed.
  • the main process according to the second embodiment refers to the acquired transaction log records in order from the top. Unlike the first embodiment, the main process according to the second embodiment waits for execution of all update instructions for the update instruction for updating the data included in the database among the records included in the transaction log. To process the transaction log record. On the other hand, for a record other than an update command, for example, a record related to transaction management, the main process executes a command (for example, update of management information) indicated by the record, as in the first embodiment.
  • a command for example, update of management information
  • the waiting update command is recorded in the map information.
  • the map information at least one of the contents of the update command that has been waited and the record number is recorded in association with the target (tuple) of the update command.
  • each tuple of the database is managed in units of pages on the storage device, and data exchange between the storage device and the RAM is performed in units of the pages. Therefore, the main process according to the second embodiment associates at least one of the contents of the update instruction that is waited and the number of the record with the page including the tuple that is the target of the waited update instruction in the map information. Record. That is, the page corresponds to the “predetermined set” of the present invention.
  • the main process according to the second embodiment refers to the record related to the database update command such as the record No. 33 and the record No. 35
  • the contents of the update command indicated by the referenced record At least one of the record numbers is recorded in the map information in association with the page including the tuple to be updated. 12 to 15 described later exemplify a scene in which either the content of the update command or the record number is recorded in the map information.
  • the main process according to the second embodiment when the record referred to is a record related to the management of a transaction, management information for managing the transaction according to the content indicated by the record. Update.
  • the replication method applied to the second embodiment is not limited to the second method, and the first method illustrated in FIG. 1 is adopted in the second embodiment. May be.
  • the replication method executed in the second embodiment may be asynchronous replication instead of synchronous replication.
  • FIG. 12 illustrates the operation state of the information processing apparatus 1 at the time when the main process is completed up to the 36th record after the state illustrated in FIG. 7 in the second embodiment.
  • the No. 33, No. 35 and No. 36 records are records related to the database update command.
  • the 32nd and 34th records are records related to transaction management, and are records related to instructions other than update instructions.
  • the main process first refers to the record No. 32 and executes the command indicated by the record No. 32 as in the first embodiment. Specifically, the main process updates the management information so as to indicate that the state of the first transaction is being executed, for example.
  • the main process refers to the next 33rd record.
  • the target of the update command (D1 — 101 — 5) indicated by the 33rd record is read out on the RAM.
  • the main process waits for execution of the update instruction (D1_101_5) indicated by the 33rd record. Then, the main process records the contents (D1_101_5) or the record number (33) of the update command indicated by the 33rd record in the map information in association with the page number (P5).
  • the main process refers to the next 34th record, and executes the command indicated by the 34th record as in the first embodiment. Specifically, the main process updates the management information so as to indicate that the state of the second transaction is being executed, for example.
  • the main process refers to the next 35th record and waits for the execution of the update command (I2 — 205_2) indicated by the 35th record. Then, the main process stores the contents of the update command (I2_205_2) indicated by the 35th record or the record number (35) in the map information in association with the page number (P2).
  • the main process refers to the next 36th record and waits for the execution of the update command (D1_103_2) indicated by the 36th record. Then, the main process stores the contents of the update command (D1_103_2) indicated by the 36th record or the record number (36) in the map information in association with the page number (P2). This completes the processing of records up to number 36.
  • the back-end process waits for execution because the main process has not been completed up to the 40th record, which is the synchronization point that was set when the query was received. .
  • FIG. 13 illustrates the operation state of the information processing apparatus 1 at the time when the processing of the main process is completed up to the record of the synchronization point (number 40) set at the time of FIG. 7 after the state illustrated in FIG. To do.
  • the 38th and 39th records are records relating to database update instructions.
  • the 37th and 40th records are records related to transaction management, and are records related to commands other than the update command.
  • the main process first refers to the 37th record and executes the command indicated by the 37th record as in the first embodiment. Specifically, the main process updates the management information to indicate that the first transaction has been committed, for example.
  • the main process refers to the next 38th record and waits for the execution of the update command (D2_104_9) indicated by the 38th record. Then, the main process records the contents of the update command (D2_104_9) indicated by the 38th record or the record number (38) in the map information in association with the page number (P9).
  • the main process refers to the next 39th record.
  • the target of the update instruction (I2_206_8) indicated by the 39th record is read out on the RAM.
  • the main process waits for execution of the update instruction (I2_206_8) indicated by the 39th record. Then, the main process records the contents of the update command (I2_206_8) indicated by the 39th record or the record number (39) in the map information in association with the page number (P8).
  • the main process refers to the next 40th record and executes the command indicated by the 40th record as in the first embodiment. Specifically, for example, the main process updates the management information so as to indicate that the second transaction has been committed.
  • the processing of the main process is completed up to the 40th record that is the synchronization point set at the time of receiving the query, so the back-end process can execute the search processing for the target query. .
  • helper process refers to the map information and executes the update command that has been put on standby.
  • FIG. 14 illustrates the processing procedure of the helper process in the second embodiment.
  • FIG. 14 illustrates a scene in which processing by the helper process is started before search processing by the back-end process in FIG. 13 is started.
  • step S51 the helper process refers to the map information and determines whether there is a waiting update command. If the waiting update instruction is not recorded in the map information, the helper process ends the process. On the other hand, if the waiting update command is recorded in the map information, the target to be processed is selected according to the management unit, and the process proceeds to step S52. In the scene illustrated in FIG. 14, the helper process selects the page P5 as a target to be processed by itself.
  • step S52 the helper process determines whether or not the selected page exists on the RAM.
  • the helper process executes the waiting update command (update command recorded in the map information).
  • the helper process reads the selected page from the storage device onto the RAM as illustrated in FIG. 10 according to the first embodiment, and the read page is read.
  • the standby update command (update command recorded in the map information) is executed.
  • the page (P5) selected by the helper process exists on the RAM. Therefore, the helper process executes an update instruction (D1_101_5) waiting for P5, and assigns a deletion pointer to the tuple of line number 101. And a helper process deletes the record regarding the processed update instruction from map information, and complete
  • the helper process executes the standby update commands in the order recorded in the map information, and the helper process is generated, deleted, or started.
  • the number of helper processes that can be operated by stopping them may be increased or decreased, a certain number of helper processes may be started in advance, and the helper processes are processed appropriately other than the timing shown in this operation example.
  • the second embodiment is common to the first embodiment in that may be executed. Therefore, explanation is omitted.
  • the back-end process executes a search process in response to a search request (query) to the database from the client PC.
  • the back-end process refers to the map information and determines whether or not there is a standby update command for the search target page. Then, when there is no update command waiting for the search target page, the back-end process executes a search process for the page.
  • the back-end process executes the search process for the page after executing the standby update instruction.
  • the process which applies the update command recorded on the said map information in a back end process may be performed by the helper process similarly to 1st Embodiment.
  • FIG. 15 illustrates the processing procedure of the back-end process in the second embodiment.
  • FIG. 15 illustrates a scene where search processing by the back-end process has started after the state illustrated in FIGS. 13 and 14.
  • step S61 in order to extract a tuple that matches the content of the received query, the back-end process accesses a page included in an area related to the query and sets the accessed page as a search processing target.
  • FIG. 15 illustrates a scene in which the back-end process accesses a page (P8) existing on the RAM.
  • the storage device is accessed and the target page is read from the storage device onto the RAM.
  • the back-end process acquires a lock for the page to be accessed.
  • the control unit of the information processing apparatus 1 according to the second embodiment may treat the acquisition of the lock for the target page as an example of a factor that determines that the target page has been processed. That is, the control unit of the information processing apparatus 1 according to the second embodiment may determine that the target page has become a processing target by acquiring a lock on the target page.
  • the operation for determining that the target page is a processing target may be appropriately set according to the embodiment, and is not limited to acquisition of a lock.
  • step S62 the back-end process refers to the map information and determines whether there is an update command waiting for the accessed page. If the update instruction waiting for the accessed page is not recorded in the map information, the back-end process proceeds to step S64. On the other hand, if an update command waiting for the accessed page is recorded in the map information, the process proceeds to step S63. In FIG. 15, since there is an update command (I2_206_8) waiting for the accessed page (P8), the process proceeds to step S63.
  • step S63 the back-end process executes an update command waiting for the accessed page on the RAM.
  • the backend process executes an update instruction (I2_206_8) waiting for P8. That is, the back-end process inserts the tuple with the line number 206 into P8. Then, the back-end process deletes the record relating to the processed update command from the map information after executing all the update commands waiting for the accessed page.
  • step S64 the back-end process executes a search process corresponding to the received query for the accessed page on the RAM. If there is an area that has not been accessed in the search range, the back-end process returns to step S61 and repeats the process. On the other hand, if there is no area that is not accessed in the search range, the back-end process returns the result of the search process to the client PC as a response to the query, and ends the process.
  • the back-end process may access the target page one by one, or may access a plurality of pages at once, and a plurality of update instructions are waiting for the accessed page.
  • the back-end process executes the waiting update instruction in the order recorded in the map information, and the number of back-end processes that operate is increased or decreased by creating, deleting, starting, or stopping the back-end process.
  • the second embodiment is common to the first embodiment in that the back-end process may leave the processing related to page update to the helper process. Therefore, explanation is omitted.
  • the second embodiment focusing on the tuple of the row number 206, the same explanation as the tuple of the row number 205 illustrated in FIG. 11 according to the first embodiment is possible. That is, at the time when the search process is performed by the back-end process (step S61), the update instruction related to the tuple indicated by the record before the synchronization point (39th record) related to the search process is still executed. Not waiting. However, the update command indicated by the 39th record is executed by the back-end process (or helper process) by the time point when the search process is executed (step S64). Therefore, the tuple with the line number 206 becomes a target of the search process without any problem.
  • the search waiting time can be shortened while ensuring the consistency of the database, and the processing speed of applying the transaction log to the database Can be speeded up.
  • the transaction log created in series is used to update the database. Therefore, the process for applying the transaction log to the database without changing the technology related to the creation of the transaction log from the conventional system. Speed can be improved.
  • the page of P8, which is the target of the update command for adding the tuple with the row number 206 recorded in the map information is already in the RAM when the main process references the 39th record. Existing.
  • a page existing in the RAM may be subject to processing at any time.
  • the main process may wait for an update instruction for those pages.
  • the main process may wait for an update instruction for those pages. Therefore, the main process according to the second embodiment causes an update command for a page existing on the RAM to wait in the same manner as an update command for a page not existing on the RAM, and records it once in the map information. .
  • the main process according to the second embodiment issues an update instruction for a page that exists on the RAM and an update instruction for a page that does not exist on the RAM, whether or not they exist on the RAM. Treat in the same way.
  • the main process according to the second embodiment includes a page related to the tuple that is the target of the update instruction indicated by the transaction log record included in the operation of the main process according to the first embodiment on the RAM. The process of determining whether or not can be omitted.
  • the main process does not execute the database update command indicated by the record of the transaction log, and therefore does not change the state of the page read on the RAM. Therefore, the main process according to the second embodiment is different from the main process according to the first embodiment, and other processes (for example, a helper process, a back-end process, etc.) that change the state of the page read on the RAM. The processing can be executed without hindering the operation.
  • the main process refers to an update instruction
  • the page related to the tuple that is the target of the update instruction exists on the RAM and is subject to processing by the back-end process
  • the back-end process A lock on the page has been acquired. Therefore, when the main process immediately executes the update command, the main process waits until the back-end process completes the search process for the page and releases the lock.
  • the main process since the main process does not have to wait for such a lock, the process can be executed without being interrupted by other processes.
  • the back-end process that processes the page performs search processing based on the state of the database at the time when the lock is acquired. Therefore, the update command may be executed after the lock is released and before the page becomes the next processing target. Therefore, even when the page related to the tuple that is the target of the update command is the target of processing, the main process can wait for the update command without impairing the consistency of the database in the search.
  • the processing of the main process can be executed easily and at a higher speed than in the first embodiment. Therefore, when applying the database update method to synchronous replication, according to the second embodiment, it is possible to shorten the time from when a query is received until the search process is started, compared to the first embodiment. is there.
  • the update command when waiting for an update command, the update command is referred to when the update command is waited and when the update command is executed. That is, as compared with the case where the update command is executed immediately, the number of times the update command is referred to increases when the update command is made to wait. Therefore, in the second embodiment, as compared with the first embodiment, the amount of processing related to the reference of the update instruction increases as the number of update instructions to wait increases.
  • the processing of the increasing part can be processed in parallel as described in the above operation example. Therefore, in a system with a high degree of parallelism, the time until the processing of the main process is completed becomes a bottleneck for search processing execution, so the second embodiment that can execute the main process at a higher speed than the first embodiment is better. . That is, when the amount of processing that increases with respect to the reference of the update instruction is smaller than the amount that can be shortened by being able to process in parallel, a better result is obtained by using the second embodiment than the first embodiment. .
  • the database update command is not limited to the update command for processing one tuple as in the first embodiment.

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)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

 トランザクションログを適用してデータベースを更新する処理の速度を改善する技術を提供する。トランザクションログを利用して自身のデータベースを更新するコンピュータが、トランザクションログを取得し、取得したトランザクションログのレコードを先頭から順に参照し、トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、更新命令の対象がメモリ上に読み出されている場合は該更新命令を実行し、更新命令の対象がメモリ上に読み出されていない場合は該更新命令の実行を待機させることで、トランザクションログのレコードを処理し、待機させた更新命令の対象が前記メモリ上に読み出されて処理の対象になるまでに、又は、待機させた更新命令の対象が前記メモリ上に読み出されて処理の対象となった際に、該対象について待機させた更新命令を実行する。

Description

情報処理方法、情報処理装置、及び、プログラム
 本発明は、情報処理方法、情報処理装置、及び、プログラムに関する。
 近年、マスタで作成されたトランザクションログを利用して、他のマスタ又はスレーブにおいてレプリケーションを行う技術が提案されている。特に、他のマスタ又はスレーブとマスタとを同期させてレプリケーションを行う技術が提案されている。なお、トランザクションログは、データベースに加えられた変更履歴を示す。
 図1には、他のマスタ又はスレーブとマスタとを同期させてレプリケーションを行う2つの方法が示されている。第1の方法(実線で示される方法)では、マスタにおいて生成されたトランザクションログが他のマスタ又はスレーブに送信され、他のマスタ又はスレーブにおいてデータベースの更新が完了した後に、マスタにACKが返される。そして、対象のトランザクションのコミットが完了する。
 第1の方法では、他のマスタ又はスレーブにおけるデータベースの更新が完了するまで、対象のトランザクションのコミットが完了せず、システム全体の処理が遅くなってしまう。これを改良した方法として、図1には、第2の方法(点線で示される方法)が示されている。
 第2の方法では、他のマスタ又はスレーブにおいて、トランザクションログの受信が完了した時点で、トランザクションログの適用の有無に関わらず、マスタにACKが返される。そのため、第2の方法では、トランザクションのコミットが完了するまでの時間を短縮することができ、システム全体のパフォーマンスを向上させることが可能である。
 ただし、第2の方法では、レプリケーションが完了する前に他のマスタ又はスレーブにおいて検索処理が発生すると、マスタと異なるデータ内容を参照してしまう可能性がある。これに対応する方法として、他のマスタ又はスレーブにおいて発生した検索処理の実行をレプリケーションが完了するまで待機させる方法が用いられる場合がある(特許文献1)。
国際公開第2010/106991号 特開2012-133417号公報
 マスタで作成されたトランザクションログを利用してレプリケーションを行う際の根本的な問題として、他のマスタ又はスレーブにおいて、トランザクションログをデータベースに適用する処理に時間がかかってしまうという問題点がある。なぜなら、従来のトランザクションログは、マスタにおいて並列処理されたトランザクションを処理された順に直列状態で記録しており、他のマスタ又はスレーブは、そのようなトランザクションログのレコードを前から順にひとつひとつデータベースに適用しなければならず、マスタにおいて並列で実行された処理を直列で実行しなければならないからである。
 そのため、第2の方法を用いたとしても、トランザクションログをデータベースに適用する処理に時間がかかってしまい、他のマスタ又はスレーブにおいて発生した検索処理の実行が遅れ、パフォーマンスを十分に向上させられない可能性があった。
 この問題点に対応する方法として、図2に示される第3の方法が提案されている(一例として、特許文献2が挙げられる)。第3の方法では、マスタは、複数のトランザクションログを並列に作成し、並列に作成した複数のトランザクションログを他のマスタ又はスレーブに送信する。そして、他のマスタ又はスレーブでは、当該複数のトランザクションログがデータベースに並列に適用される。
 第3の方法によると、他のマスタ又はスレーブのデータベースにトランザクションログを並列に適用することが可能になるため、トランザクションログをデータベースに適用する処理の速度が改善されるように見える。しかしながら、第3の方法には、以下のような問題点が存在する。
 第1の問題点として、トランザクションログに関する技術は、障害時の復旧に用いられる等、データベースの根幹に関わる技術である。そして、従来のシステムでは、トランザクションログは直列状態で作成されている。そのため、従来のシステムにおいて第3の方法を実施するためには、データベースの根幹に関わる部分のシステム変更という危険を伴うことになる。
 第2の問題点として、従来のトランザクションログでは、データベースに適用された順に記録が残る。そのため、トランザクションログをその順序のままデータベースに適用すれば、レプリケーション実行中であっても、他のマスタ又はスレーブは、マスタのデータベースと整合性を取ることが可能であった。
 一方、トランザクションログを並列化すると、他のマスタ又はスレーブでは、必ずしも同じ処理が同じ順序で実行されるとは限らない。そのため、他のマスタ又はスレーブは、レプリケーション実行中において、マスタのデータベースと整合性を取ることができなくなってしまう。
 そこで、他のマスタ又はスレーブにおいてレプリケーションが実行されている最中に検索処理が実行されるような場面では、マスタのデータベースと整合性を取るために、並列化されたトランザクションログの適用順を定める機構が他のマスタ又はスレーブに設けられることになる。従って、第3の方法を実施する場合、システムが複雑になってしまう。
 第3の問題点として、並列に処理されるトランザクションの数は状況によって変化するのに対して、並列に作成されるトランザクションログの数は固定される。そのため、第3の方法では、トランザクションの数とトランザクションログの数との不均衡の問題は根本的には解決せず、トランザクションログをデータベースに適用する処理の速度が改善されるとは限らない。
 本発明は、一側面では、このような点を考慮してなされたものであり、トランザクションログを適用してデータベースを更新する処理の速度を改善することを目的とする。
 本発明の第1形態は、トランザクションログを利用して自身のデータベースを更新するコンピュータが、前記トランザクションログを取得するステップと、取得した前記トランザクションログのレコードを先頭から順に参照し、前記トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、該レコードにより示される更新命令の対象が前記コンピュータのメモリ上に読み出されている場合は該更新命令を実行し、該レコードにより示される更新命令の対象が前記コンピュータのメモリ上に読み出されていない場合は該更新命令の実行を待機させることで、取得した前記トランザクションログのレコードを処理するステップと、待機させた更新命令の対象が前記メモリ上に読み出されて処理の対象になるまでに、又は、待機させた更新命令の対象が前記メモリ上に読み出されて処理の対象となった際に、該対象について待機させた更新命令を実行するステップと、を実行する情報処理方法である。
 本発明の第1形態によれば、取得されるトランザクションログは、レコードの先頭から順に参照されて、処理される。この処理において、トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、更新命令の対象がコンピュータのメモリ上に読み出されている場合は、そのレコードにより示される更新命令は実行される。他方、更新命令の対象がメモリ上に読み出されていない場合は、そのレコードにより示される更新命令の実行は待機させられる。そして、待機させられた更新命令の対象がメモリ上に読み出されて処理の対象になるまでに、又は、待機させられた更新命令の対象がメモリ上に読み出されて処理の対象となった際に、当該対象について待機させられた命令は実行される。
 トランザクションログを適用してデータベースを更新する処理の速度を改善することが困難である1つの原因として、データベースを更新する際のデータの読み出し及び書き込みの処理が他の処理に比べて比較的に遅いことが挙げられる。本発明の第1形態は、データベースからデータを読み出す必要のない更新命令については、処理を実行する。他方、本発明の第1形態は、データベースからデータを読み出す必要のある更新命令については、処理を遅延させる。そのため、本発明の第1形態によれば、トランザクションログを適用してデータベースを更新する際のデータの読み出し及び書き込みの処理を効率的に行うことが可能になる。また、待機させた更新命令については、並列に処理することが可能である。
 従って、本発明の第1形態によれば、トランザクションログをデータベースに適用する処理の速度を改善することが可能になる。
 本発明の第2形態は、前記コンピュータが、前記トランザクションログを取得するステップにおいて、他のコンピュータのデータベースと前記自身のデータベースとの間でレプリケーションを行うために、前記他のコンピュータにおいて直列的に作成されたトランザクションログを取得する、第1形態の情報処理方法である。
 本発明の第3形態は、前記コンピュータが、前記レコードにより示される更新命令の実行を待機させる際、前記更新命令の対象に待機させた更新命令が存在することを示すために、待機させた前記更新命令の内容及び前記レコードの番号のうちの少なくとも一方を、前記更新命令の対象に関連付けてマップ情報に記録し、前記マップ情報を参照して、前記対象について待機させた更新命令を実行する、第1形態又は第2形態の情報処理方法である。
 本発明の第4形態は、前記コンピュータが、処理の対象の前記メモリへの読み込みを所定の集合ごとに行い、前記レコードにより示される更新命令の実行を待機させる際、前記更新命令の対象に待機させた更新命令が存在することを示すために、待機させた前記更新命令の内容及び前記レコードの番号のうちの少なくとも一方を、前記更新命令の対象を含む所定の集合に関連付けてマップ情報に記録し、前記所定の集合が前記メモリ上に読み出されて処理の対象になるまでに、又は、前記所定の集合が前記メモリ上に読み出されて処理の対象となった際に、前記マップ情報を参照して、前記所定の集合に含まれる対象について待機させた更新命令を実行する、第1形態又は第2形態の情報処理方法である。
 本発明の第5形態は、前記コンピュータが、前記自身のデータベースに対する検索処理を、該検索処理に関して処理されていることが求められる前記トランザクションログのレコードに対する処理が完了するまで、待機させる、第1形態から第4形態のいずれかの形態の情報処理方法である。
 本発明の第6形態は、トランザクションログを利用して自身のデータベースを更新するコンピュータが、前記トランザクションログを取得するステップと、取得した前記トランザクションログのレコードを先頭から順に参照し、前記トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、該更新命令の実行を待機させることで、取得した前記トランザクションログのレコードを処理するステップと、待機させた更新命令の対象が処理の対象になるまでに、又は、待機させた更新命令の対象が処理の対象となった際に、該対象について待機させた更新命令を実行するステップと、を実行する情報処理方法である。
 本発明の第7形態は、前記コンピュータが、前記トランザクションログを取得するステップにおいて、他のコンピュータのデータベースと前記自身のデータベースとの間でレプリケーションを行うために、前記他のコンピュータにおいて直列的に作成されたトランザクションログを取得する、第6形態の情報処理方法である。
 本発明の第8形態は、前記コンピュータが、前記更新命令を待機させる際に、前記更新命令の対象に待機させた更新命令が存在することを示すために、前記更新命令の内容と前記更新命令に係るレコードの番号のうち少なくとも一方を前記更新命令の対象に関連付けてマップ情報に記録し、前記マップ情報を参照して、前記対象について待機させた前記更新命令を実行する、第6形態又は第7形態の情報処理方法である。
 本発明の第9形態は、前記コンピュータが、処理の対象の前記メモリへの読み込みを所定の集合ごとに行い、前記更新命令の実行を待機させる際、前記更新命令の対象に待機させた更新命令が存在することを示すために、待機させた前記更新命令の内容及び前記レコードの番号のうちの少なくとも一方を、前記更新命令の対象を含む所定の集合に関連付けてマップ情報に記録し、前記所定の集合が処理の対象になるまでに、又は、前記所定の集合が処理の対象となった際に、前記マップ情報を参照して、前記所定の集合に含まれる対象について待機させた更新命令を実行する、第6形態又は第7形態の情報処理方法である。
 本発明の第10形態は、前記コンピュータが、前記自身のデータベースに対する検索処理を、該検索処理に関して処理されていることが求められる前記トランザクションログのレコードに対する処理が完了するまで、待機させる、第6形態から第9形態のいずれかの形態の情報処理方法である。
 なお、上記各形態に係る情報処理方法の別の態様として、以上の各構成を実現する情報処理装置であってもよいし、情報処理システムであってもよいし、プログラムであってもよいし、このようなプログラムを記録したコンピュータその他装置、機械等が読み取り可能な記憶媒体であってもよい。ここで、コンピュータ等が読み取り可能な記録媒体とは、プログラム等の情報を、電気的、磁気的、光学的、機械的、又は、化学的作用によって蓄積する媒体である。また、情報処理システムは、1又は複数の情報処理装置によって実現されてもよい。
 例えば、本発明の第11形態は、トランザクションログを利用して自身のデータベースを更新する情報処理装置であって、前記トランザクションログを取得する手段と、取得した前記トランザクションログのレコードを先頭から順に参照し、前記トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、該レコードにより示される更新命令の対象が前記コンピュータのメモリ上に読み出されている場合は該更新命令を実行し、該レコードにより示される更新命令の対象が前記コンピュータのメモリ上に読み出されていない場合は該更新命令の実行を待機させることで、取得した前記トランザクションログのレコードを処理する手段と、待機させた更新命令の対象が前記メモリ上に読み出されて処理の対象になるまでに、又は、待機させた更新命令の対象が前記メモリ上に読み出されて処理の対象となった際に、該対象について待機させた更新命令を実行する手段と、を備える情報処理装置である。
 また、例えば、本発明の第12形態は、トランザクションログを利用して自身のデータベースを更新するコンピュータに、前記トランザクションログを取得するステップと、取得した前記トランザクションログのレコードを先頭から順に参照し、前記トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、該レコードにより示される更新命令の対象が前記コンピュータのメモリ上に読み出されている場合は該更新命令を実行し、該レコードにより示される更新命令の対象が前記コンピュータのメモリ上に読み出されていない場合は該更新命令の実行を待機させることで、取得した前記トランザクションログのレコードを処理するステップと、待機させた更新命令の対象が前記メモリ上に読み出されて処理の対象になるまでに、又は、待機させた更新命令の対象が前記メモリ上に読み出されて処理の対象となった際に、該対象について待機させた更新命令を実行するステップと、を実行させるためのプログラムである。
 また、例えば、本発明の第13形態は、トランザクションログを利用して自身のデータベースを更新する情報処理装置であって、前記トランザクションログを取得する手段と、取得した前記トランザクションログのレコードを先頭から順に参照し、前記トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、該更新命令の実行を待機させることで、取得した前記トランザクションログのレコードを処理する手段と、待機させた更新命令の対象が処理の対象になるまでに、又は、待機させた更新命令の対象が処理の対象となった際に、該対象について待機させた更新命令を実行する手段と、を備える情報処理装置である。
 また、例えば、本発明の第14形態は、トランザクションログを利用して自身のデータベースを更新するコンピュータに、取得した前記トランザクションログのレコードを先頭から順に参照し、前記トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、該更新命令の実行を待機させることで、取得した前記トランザクションログのレコードを処理するステップと、待機させた更新命令の対象が処理の対象になるまでに、又は、待機させた更新命令の対象が処理の対象となった際に、該対象について待機させた更新命令を実行するステップと、を実行させるためのプログラムである。
 本発明によれば、トランザクションログをデータベースに適用する処理の速度を改善することができる。
図1は、他のマスタ又はスレーブとマスタとを同期させてレプリケーションを行う従来方法を例示する。 図2は、他のマスタ又はスレーブとマスタとを同期させてレプリケーションを行う従来方法を例示する。 図3は、実施の形態に係る情報処理装置を例示する。 図4は、実施の形態に係る情報処理装置において実行される各プロセスの関係を例示する。 図5は、実施の形態に係るデータベースの更新例を示す。 図6は、実施の形態に係る情報処理装置において取得されるトランザクションログを例示する。 図7は、クエリを受信した時点における実施の形態に係る情報処理装置の動作状態を例示する。 図8は、実施の形態に係るメインプロセスの処理が36番のレコードまで完了した時点における情報処理装置の動作状態を例示する。 図9は、実施の形態に係るメインプロセスの処理が同期点のレコードまで完了した時点における情報処理装置の動作状態を例示する。 図10は、実施の形態に係るヘルパープロセスの処理手順を例示する。 図11は、実施の形態に係るバックエンドプロセスの処理手順を例示する。 図12は、実施の形態に係るメインプロセスの処理が36番のレコードまで完了した時点における情報処理装置の動作状態を例示する。 図13は、実施の形態に係るメインプロセスの処理が同期点のレコードまで完了した時点における情報処理装置の動作状態を例示する。 図14は、実施の形態に係るヘルパープロセスの処理手順を例示する。 図15は、実施の形態に係るバックエンドプロセスの処理手順を例示する。
 以下、本発明の一側面に係る実施の形態(以下、「本実施形態」とも表記する)を、図面に基づいて説明する。ただし、以下で説明する本実施形態は、あらゆる点において本発明の例示に過ぎず、その範囲を限定しようとするものではない。本発明の範囲を逸脱することなく種々の改良や変形を行うことができることは言うまでもない。つまり、本発明の実施にあたって、それぞれの実施形態に応じた具体的構成が適宜採用されてもよい。
 なお、本実施形態において登場するデータを自然言語により説明しているが、より具体的には、コンピュータが認識可能な疑似言語、コマンド、パラメタ、マシン語等で指定される。
 §1 第1実施形態
 [構成例]
 図3は、本実施形態に係る情報処理装置1のハードウェア構成を例示する。図3で例示されるように、本実施形態に係る情報処理装置1は、制御部、記憶装置、及び、ネットワークを介した通信を行うための通信インタフェース、が電気的に接続されたコンピュータである。制御部は、CPU(Central Processing Unit)、RAM(Random Access Memory)、及び、ROM(Read Only Memory)等を含む。また、記憶装置は、制御部で実行されるプログラム等を記憶し、かつ、データベース(図の「DB」)を格納する。
 なお、図3では、通信インタフェースは、「通信I/F」と記載される。制御部に含まれるRAM及びROMは主記憶装置と称され、記憶装置は補助記憶装置と称されてもよい。制御部に含まれるCPUは、処理装置と称されてもよい。情報処理装置1は、PC(Personal Computer)、サーバマシン等であってもよい。
 また、情報処理装置1のハードウェア構成に関して、実施の形態に応じて適宜構成要素の省略、置換、及び、追加が行われてもよい。例えば、制御部は、複数のプロセッサを含んでもよい。
 図4は、情報処理装置1において実行される各プロセスの関係を例示する。情報処理装置1は、トランザクションログを取得し、取得したトランザクションログを利用して自身の記憶装置に格納されたデータベースを更新するコンピュータである。情報処理装置1は、取得したトランザクションログのレコードを先頭から順に参照して、自身のデータベースに適用していく。このとき、情報処理装置1は、RAMに読み出されているデータ(タプル)に対する更新命令は実行し、RAMに読み出されていないデータに対する更新命令はスキップする。そして、スキップされた更新命令は、対象となるデータがRAMに読み出されるまでに、又は、読み出された際に、実行される。これにより、トランザクションログを利用したデータベースの更新が完了する。
 図4で例示されるように、本実施形態に係る情報処理装置1の制御部は、記憶装置に格納されたプログラム等をRAM等に展開し、その内容を解釈することで、メインプロセス(図の「MAIN」)、バックエンドプロセス(図の「BACKEND」)、及び、ヘルパープロセス(図の「HELPER」)を実行する。
 メインプロセスは、取得したトランザクションログのレコードを先頭から順に参照して、自身のデータベースに適用するプロセスである。トランザクションログには、データベースに含まれるデータを更新する更新命令に関するレコードとトランザクションの管理に関するレコードとが含まれている。メインプロセスは、取得したトランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、更新命令の対象がRAM上に読み出されている場合は当該更新命令を実行し、更新命令の対象がRAM上に読み出されていない場合は当該更新命令の実行を待機させることで、取得したトランザクションログのレコードを処理する。待機させられた更新命令は、ヘルパープロセス又はバックエンドプロセスにより処理され、トランザクションログを利用したデータベースの更新が完了する。
 ヘルパープロセスは、メインプロセス及び後述するバックエンドプロセスの補助的なプロセスである。本実施形態では、ヘルパープロセスは、メインプロセスが待機させた更新命令を実行する。
 バックエンドプロセスは、クライアントPC(図の「CL」)からのデータベースに対する検索リクエスト(クエリ)に応じて、検索処理を実行するプロセスである。本実施形態では、ヘルパープロセスだけではなく、バックエンドプロセスによっても、メインプロセスにより待機させられた更新命令が実行される場合がある。なお、本実施形態に係るバックエンドプロセスは、検索処理に関して処理されていることが求められるトランザクションログのレコードに対するメインプロセスの処理が完了するまで、当該検索処理の実行を待機する。ただし、バックエンドプロセスは、検索処理以外の処理を実行してもよい。バックエンドプロセスが実行する処理は、検索処理に限定されない。
 なお、本実施形態においてデータベースの更新に利用されるトランザクションログは、自身のデータベースのリカバリーを行うために、自身において作成されたものであってよい。この場合、情報処理装置1は、自身又は他のコンピュータの記憶装置から、当該トランザクションログを取得する。
 また、本実施形態においてデータベースの更新に利用されるトランザクションログは、他のコンピュータのデータベースと自身のデータベースとの間でレプリケーションを行うために、他のコンピュータにおいて作成されたものでもよい。この場合、情報処理装置1は、他のコンピュータから当該トランザクションログを取得する。
 更に、本実施形態においてデータベースの更新に利用されるトランザクションログは、直列的に作成されたものでもよいし、並列的に作成されたものでもよい。ただし、トランザクションログに関する技術を従来システムから変更しないためには、本実施形態で利用されるトランザクションログは直列的に作成されたものであるほうがよい。
 本実施形態は、トランザクションログを利用してデータベースを更新するシステムに広く適用することができる。
 [動作例]
 次に、情報処理装置1の具体的な動作例を示す。図5は、本動作例におけるデータベースの更新例を示す。また、図6は、本動作例において取得されるトランザクションログを例示する。
 図5は、行番号、命令内容、及び、ポインタを含む、テーブル形式のデータベースの一部が更新される場面を例示している。具体的には、図5は、行番号101、103、及び104のタプルが削除(DELETE)され、行番号205及び206のタプルが挿入(INSERT)される場面を示している。ただし、データベースの形式は、テーブル形式に限定される訳ではなく、実施の形態に応じて適宜選択されてよい。
 なお、本実施形態では、後述する図7等に示されるように、データベースの各タプルは、記憶装置上においてページ単位で管理されており、記憶装置とRAMとの間のデータのやり取りは、当該ページ単位で行われる。換言すると、データベースの内容を更新する場合、制御部は、更新対象のタプルを含むページを記憶装置からRAMに読み出して、対象のタプルの更新を行う。そして、制御部は、対象のタプルの更新を行った後に、当該タプルを含むページをRAMから記憶装置に書き込むことで、データベースの更新を保存する。なお、RAMから記憶装置にページが書き込まれるタイミングは、実施の形態に応じて適宜決定される。また、ページには、1又は複数のタプルが格納される。ページは、ブロックと称されてもよく、本発明の「所定の集合」に相当する。
 図6は、図5に示されるデータベースの更新が生じた際に直列的に作成されたトランザクションログを例示している。トランザクションログには、少なくとも命令内容とその命令の対象とが時系列で連続的に記録される。
 図6で例示されるトランザクションログは、1番目のトランザクションが開始され(XB1)、1番目のトランザクションによりページ番号5のページに格納された行番号101のタプルが削除され(D1_101_5)、2番目のトランザクションが開始され(XB2)、2番目のトランザクションによりページ番号2のページに行番号205のタプルが挿入され(I2_205_2)、1番目のトランザクションによりページ番号2のページに格納された行番号103のタプルが削除され(D1_103_2)、1番目のトランザクションがコミットされ(XC1)、2番目のトランザクションによりページ番号9のページに格納された行番号104のタプルが削除され(D2_104_9)、2番目のトランザクションによりページ番号8のページに行番号206のタプルが挿入され(I2_206_8)、2番目のトランザクションがコミットされた(XC2)ことを示している。
 ここで、図6で例示されるトランザクションログのレコードは、データベースに含まれるデータを更新する更新命令に関するレコード(D1_101_5、D1_103_2、I2_205_2、D2_104_9、I2_206_8)と、トランザクションの管理に関するレコード(XB1、XB2、XC1、XC2)とに分けることができる。また、図6で例示されるトランザクションログでは、各レコードを特定するための番号(LSN:log sequence number)が与えられている。
 <メインプロセス>
 図7~9は、メインプロセスの動作を例示する。
 図7は、クエリを受信した時点における情報処理装置1の動作状態を例示する。図7では、行番号103のタプルはページ番号2(P2)のページに格納され、行番号101のタプルはページ番号5(P5)のページに格納され、行番号102及び104のタプルはページ番号9(P9)のページに格納されている。そして、ページ番号1、5、及び、8(P1、P5、及び、P8)のページがRAM上に読み出されている。
 また、図7の場面では、40番のレコードまでトランザクションログを取得し、32番の手前のレコードまでメインプロセスの処理が完了している。そして、クライアントPCからのクエリに応じてバックエンドプロセスが起動している。
 メインプロセスは、取得したトランザクションログのレコードを先頭から順に参照する。そして、メインプロセスは、参照したレコードがデータベースの更新命令に関するレコードである場合、当該レコードを参照した時点でその対象(タプル)がデータベース内に存在するような更新命令(例えば、DELETE命令)については、当該更新命令の対象(タプル)がRAM上に読み出されているか否かを判定する。他方、当該レコードを参照した時点でその対象(タプル)がデータベース内に存在しないような更新命令(例えば、INSERT命令)については、当該更新命令の対象(タプル)が挿入される領域がRAM上に読み出されているか否かを判定することで、当該更新命令の対象がRAM上に読み出されているか否かを判定する。なお、本実施形態では、タプルはページ単位で管理されているため、メインプロセスは、レコードにより示される更新命令の対象であるタプルを含むページがRAM上に読み出されているか否かを判定する。
 対象のページがRAM上に読み出されている場合、メインプロセスは、対象のレコードにより示される更新命令を実行する。他方、対象のページがRAM上に読み出されていない場合、メインプロセスは、対象のレコードにより示される更新命令の実行を待機させる。
 また、メインプロセスは、参照したレコードがトランザクションの管理に関するレコードである場合、当該レコードが示す内容に合わせて、トランザクションを管理するための管理情報を更新する。管理情報は、例えば、実行中のトランザクションやコミットされたトランザクションを示す。
 なお、メインプロセスは、参照したレコードにより示される更新命令の実行を待機させる際に、待機させた更新命令の内容を当該タプルに関連付けて記録するマップ情報を作成する。マップ情報には、待機させた更新命令の内容及びレコードの番号のうちの少なくとも一方が、更新命令の対象であるタプルに関連付けられて記録される。ヘルパープロセス又はバックエンドプロセスは、当該マップ情報を参照して、待機させられた更新命令を実行する。
 ここで、命令の内容を記録したトランザクションログは、情報処理装置1のRAM又は記憶装置に保持されている。そのため、トランザクションログのレコード番号がマップ情報に記録される場合、ヘルパープロセス又はバックエンドプロセスは、当該マップ情報に記録されるレコード番号に基づいてRAM又は記憶装置に保持されているトランザクションログにアクセスし、実行する更新命令の内容を特定する。
 また、本実施形態では、更新命令の対象であるタプルは、ページ単位で管理されている。そのため、マップ情報には、更新命令の内容及びトランザクションログのレコードの番号のうちの少なくとも一方が、更新命令の対象であるタプルを含むページ(具体的にはページ番号)に関連付けられて記録される。本実施形態では、ページ番号に関連付けられて更新命令の内容又はレコード番号が記録される例を示す。
 なお、図7で示される時点では、マップ情報には、何ら記録されていないとする。
 ここで、本実施形態では、図1に例示される第2の方法のように、トランザクションログの適用の有無に関わらず、情報処理装置1がACKを返し、情報処理装置1と他のコンピュータとを同期させてレプリケーションを行う場面を想定している。そのため、図7で示されるトランザクションログでは、同期点が設定されている。同期点は、情報処理装置1のデータベースに対する検索処理に関して処理されていることが求められるレコードを示す。バックエンドプロセスは、クエリを受信した時点において設定されている同期点にメインプロセスの処理が達するまで、すなわち、本動作例では40番のレコードに対するメインプロセスの処理が完了するまで、検索処理の実行を待機する。
 処理完了点を示す情報及び同期点を示す情報は、例えば、RAM上に保持される。そして、処理完了点は、例えば、メインプロセスが処理を完了させるたびに、処理が完了したレコードを示すように更新される。また、同期点は、例えば、トランザクションログを受信したことを示すACKを返すたびに、ACKを返したレコードを示すように更新される。
 なお、本実施形態において適用される同期レプリケーションの方法は、図1に例示される第2の方法に限定される訳ではなく、例えば、図1に例示される第1の方法のように、トランザクションログをデータベースに適用した後に情報処理装置1がACKを返す方法が本実施形態に適用されてもよい。また、情報処理装置1において実行されるレプリケーションの方式は、同期レプリケーションではなく、非同期レプリケーションであってもよい。これらの場合、同期点は設定されないため、本実施形態に係るバックエンドプロセスの動作のうち、同期点まで検索処理を待機させる動作は不要になる。
 図8は、図7で例示される状態の後に、メインプロセスの処理が36番のレコードまで完了した時点における情報処理装置1の動作状態を例示する。
 32番から36番のレコードのうち、33番、35番及び36番のレコードは、データベースの更新命令に関するレコードである。また、32番及び34番のレコードは、トランザクションの管理に関するレコードであり、更新命令以外の命令に関するレコードである。
 ここで、データベースの更新命令に関する33番、35番及び36番のレコードのうち、33番のレコードにより示される更新命令の対象は、P5のページに格納された行番号101のタプルであり、当該行番号101のタプルを含むP5のページはRAM上に読み出されている。他方、35番のレコードにより示される更新命令の対象は、P2のページに挿入される行番号205のタプルであり、当該行番号205のタプルが挿入される領域であるP2のページはRAM上に読み出されていない。また、36番のレコードにより示される更新命令の対象は、P2のページに格納された行番号103のタプルであり、35番のレコードと同様に、当該行番号103のタプルを含むP2のページはRAM上に読み出されていない。
 そこで、メインプロセスは、まず、32番のレコードを参照し、32番のレコードにより示される命令を実行する。具体的には、32番のレコードは1番目のトランザクションの開始を示す。そのため、メインプロセスは、例えば、1番目のトランザクションの状態が実行中であることを示すように、管理情報を更新する。
 32番のレコードを処理すると、メインプロセスは、次の33番のレコードを参照する。33番のレコードにより示される更新命令(D1_101_5)の対象はRAM上に読み出されているため、メインプロセスは、33番のレコードにより示される更新命令(D1_101_5)を実行する。具体的には、メインプロセスは、RAM上に読み出されているP5の行番号101のタプルに削除ポインタを付与する。
 33番のレコードを処理すると、メインプロセスは、次の34番のレコードを参照し、34番のレコードにより示される命令を実行する。具体的には、34番のレコードは、2番目のトランザクションの開始を示す。そのため、メインプロセスは、例えば、2番目のトランザクションの状態が実行中であることを示すように、管理情報を更新する。
 34番のレコードを処理すると、メインプロセスは、次の35番のレコードを参照する。35番のレコードにより示される更新命令(I2_205_2)の対象はRAM上に読み出されていないため、メインプロセスは、35番のレコードにより示される更新命令(I2_205_2)の実行を待機させる。そして、メインプロセスは、35番のレコードにより示される更新命令(I2_205_2)の内容又はレコード番号(35)をページ番号(P2)に関連付けてマップ情報に記憶する。
 35番のレコードを処理すると、メインプロセスは、次の36番のレコードを参照する。36番のレコードにより示される更新命令(D1_103_2)の対象は、35番のレコードと同様、RAM上に読み出されていない。そのため、メインプロセスは、36番のレコードにより示される更新命令(D1_103_2)についても、その実行を待機させる。そして、メインプロセスは、36番のレコードにより示される更新命令(D1_103_2)の内容又はレコード番号(36)をページ番号(P2)に関連付けてマップ情報に記憶する。これにより、36番までのレコードの処理が完了する。
 なお、メインプロセスは、参照した順番に応じて、更新命令の内容又はレコード番号をマップ情報に記録する。これにより、後述するヘルパープロセス又はバックエンドプロセスは、待機させられた更新命令の実行順序を認識することができる。ただし、仮に、更新命令の内容又はレコード番号が参照された順番に応じてマップ情報に記録されなかったとしても、ヘルパープロセス又はバックエンドプロセスは、待機させられた更新命令のレコード番号により、当該更新命令の実行順序を認識することができる。
 なお、バックエンドプロセスは、クエリを受信した時点で設定されていた同期点である40番のレコードまでメインプロセスの処理が完了していないため、実行を待機している。
 図9は、図8で例示される状態の後に、図7の時点で設定されていた同期点(40番)のレコードまでメインプロセスの処理が完了した時点における情報処理装置1の動作状態を例示する。
 37番から40番のレコードのうち、38番と39番のレコードは、データベースの更新命令に関するレコードである。また、37番と40番のレコードは、トランザクションの管理に関するレコードであり、更新命令以外の命令に関するレコードである。
 ここで、データベースの更新命令に関する38番と39番のレコードのうち、38番のレコードにより示される更新命令の対象は、P9のページに格納された行番号104のタプルであり、当該行番号104のタプルを含むP9のページはRAM上に読み出されていない。他方、39番のレコードにより示される更新命令の対象は、P8のページに挿入される行番号206のタプルであり、当該行番号206のタプルが挿入される領域であるP8のページはRAM上に読み出されている。
 そこで、メインプロセスは、まず、37番のレコードを参照し、37番のレコードにより示される命令を実行する。具体的には、37番のレコードは1番目のトランザクションのコミットを示す。そのため、メインプロセスは、例えば、1番目のトランザクションがコミットされたことを示すように、管理情報を更新する。
 37番のレコードを処理すると、メインプロセスは、次の38番のレコードを参照する。38番のレコードにより示される更新命令(D2_104_9)の対象はRAM上に読み出されていないため、メインプロセスは、38番のレコードにより示される更新命令(D2_104_9)の実行を待機させる。そして、メインプロセスは、38番のレコードにより示される更新命令(D2_104_9)の内容又はレコード番号(38)をページ番号(P9)に関連付けてマップ情報に記録する。
 38番のレコードを処理すると、メインプロセスは、次の39番のレコードを参照する。39番のレコードにより示される更新命令(I2_206_8)の対象はRAM上に読み出されているため、メインプロセスは、39番のレコードにより示される更新命令(I2_206_8)を実行する。具体的には、メインプロセスは、RAM上に読み出されているP8のページに行番号206のタプルを挿入する。
 39番のレコードを処理すると、メインプロセスは、次の40番のレコードを参照し、40番のレコードにより示される命令を実行する。具体的には、40番のレコードは2番目のトランザクションのコミットを示す。そのため、メインプロセスは、例えば、2番目のトランザクションがコミットされたことを示すように、管理情報を更新する。
 これにより、クエリを受信した時点で設定されていた同期点である40番のレコードまでメインプロセスの処理が完了するため、バックエンドプロセスは、対象のクエリに対する検索処理を実行することが可能になる。
 <ヘルパープロセス>
 メインプロセスにより待機させられた更新命令は、以下の通りに、ヘルパープロセスにより処理される。
 図10は、本実施形態におけるヘルパープロセスの処理手順を例示する。なお、図10は、図9におけるバックエンドプロセスによる検索処理が開始する前に、ヘルパープロセスによる処理が開始した場面を例示する。
 ステップS11では、ヘルパープロセスは、マップ情報を参照し、待機している更新命令があるか否かを判定する。待機している更新命令がマップ情報に記録されていない場合、ヘルパープロセスは処理を終了する。他方、待機している更新命令がマップ情報に記録されている場合、自身が処理する対象を管理単位に応じて選択して、処理をステップS12に進める。図10に示される例では、待機させられた更新命令はページ単位で管理されており、ヘルパープロセスは、自身が処理する対象としてP9のページを選択している。
 ステップS12では、ヘルパープロセスは、自身が処理する対象を、記憶装置からRAMに読み出す。本動作例では、ヘルパープロセスの処理対象としてP9のページが選択されているため、P9のページが記憶装置からRAMに読み出される。
 ステップS13では、ヘルパープロセスは、自身が選択した処理対象に関連付けられ、待機している更新命令を実行する。本動作例では、ヘルパープロセスは、P9について待機している更新命令(D2_104_9)を実行して、行番号104のタプルに削除ポインタを付与する。そして、ヘルパープロセスは、自身が選択した処理対象(P9)について待機している更新命令を実行した後に、処理した更新命令に関する記録をマップ情報から削除して、処理を終了する。
 なお、ヘルパープロセスは、上述のとおり、処理対象として選択したページに複数の更新命令が待機している場合、マップ情報に記録されている順(番号順)に、当該待機している更新命令を実行する。これにより、そのページに関して、情報処理装置1とレプリケーション元のコンピュータとの間で、レプリケーションが実行されている最中におけるデータベースの整合性を保つことができる。
 なお、情報処理装置1の制御部は、ヘルパープロセスを複数実行してもよく、ヘルパープロセスを生成若しくは削除又は起動若しくは停止することで、動作するヘルパープロセスの数を増減させてもよい。例えば、制御部は、マップ情報で記録されている待機させられている更新命令の管理単位に応じて、本動作例では、待機させられた更新命令がマップ情報に記録されているページの数に応じて、起動するヘルパープロセスの数を増減させてもよい。この場合は、ヘルパープロセスの処理能力を要求に応じて可変にでき、無駄なヘルパープロセスが存在することを避けることができるため、リソースを効率よく活用することが可能になる。
 また、例えば、一定数のヘルパープロセスを予め起動させておいてもよい。この場合は、処理の状況により、無駄なヘルパープロセスが存在してしまう可能性がある。しかしながら一方で、処理の要求が生じた場合に改めてヘルパープロセスを起動しなくて済み、生じた要求に迅速に対応することが可能になる。
 なお、ヘルパープロセスは、本動作例に示されるタイミング以外に、実施の形態に応じて、適宜処理を実行してもよい。マップ情報の状態を考慮すると、例えば、38番のレコードに対するメインプロセスの処理が完了した後であれば、ヘルパープロセスは、図10で例示される動作を実行することができる。
 <バックエンドプロセス>
 図11は、本実施形態におけるバックエンドプロセスの処理手順を例示する。なお、図11は、図9及び10で例示した状態の後に、バックエンドプロセスによる検索処理が開始した場面を例示する。
 ステップS21では、バックエンドプロセスは、受信したクエリの内容に適合するタプルを抽出するために、記憶装置の記憶領域のうち、当該クエリにより検索範囲に指定された領域にアクセスする。そして、ステップS22では、バックエンドプロセスは、アクセスした領域に含まれるページがRAMに存在しない場合、そのページを記憶装置からRAMに読み出し、検索処理の対象とする。例えば、データベースに複数のテーブルが含まれている場合に、検索範囲として特定のテーブルが指定される場合がある。この場合、バックエンドプロセスは、検索範囲として指定されているテーブルに関するデータを保持する領域にアクセスし、検索範囲となるテーブルのデータを、そのデータがRAMに存在しない場合、記憶装置からRAMに読み出す。記憶装置からRAMに読み出す領域、クエリにより指定される検索範囲等は、実施の形態に応じて、適宜決定されてよい。アクセスした領域に含まれるページをRAMに読み出すと、バックエンドプロセスは、ステップS23に処理を進める。
 なお、バックエンドプロセスは、検索範囲に含まれるページを記憶装置からRAMに読み出す場合に、例えば、1つ1つ対象のページを読み出してもよいし、複数のページを一度に読み出してもよい。この場合に、バックエンドプロセスは、1又は複数のページを読み出す毎に、読み出した1又は複数のページに対して、後述する処理を実行する。図11では、ステップS22の処理により、P2のページが記憶装置からRAMに読み出された場面を例示する。
 バックエンドプロセスがアクセスした領域に含まれるページが既にRAMに存在する場合、バックエンドプロセスは、記憶領域からの読み出しを行わず、既にRAMに存在しているページを検索処理の対象とし、ステップS23ではなく、ステップS25に処理を進める。
 ステップS23では、バックエンドプロセスは、マップ情報を参照し、RAMに読み出したページについて待機している更新命令があるか否かを判定する。RAMに読み出したページについて待機している更新命令がマップ情報に記録されていない場合、バックエンドプロセスは、ステップS25に処理を進める。他方、RAMに読み出したページについて待機している更新命令がマップ情報に記録されている場合、処理はステップS24に進む。本動作例では、ステップS22においてP2のページがRAMに読み出されており、当該P2のページに格納されたタプルについて待機している更新命令(I2_205_2及びD1_103_2)が存在するため、処理はステップS24に進む。
 ステップS24では、バックエンドプロセスは、RAMに読み出したページについて待機している更新命令を実行する。本動作例では、バックエンドプロセスは、P2について待機している更新命令(I2_205_2及びD1_103_2)を実行する。ここで、バックエンドプロセスは、マップ情報に記録されている順に、待機している更新命令を実行する。すなわち、本動作例では、バックエンドプロセスは、行番号205のタプルをP2に挿入した後に、行番号103のタプルに削除ポインタを付与する。そして、バックエンドプロセスは、RAMに読み出したページ(P2)について待機している更新命令を全て実行した後に、処理した更新命令に関する記録をマップ情報から削除する。
 このように、バックエンドプロセスは、ヘルパープロセス同様、処理対象として選択したページに複数の更新命令が待機している場合、マップ情報に記録されている順(番号順)に、当該待機している更新命令を実行する。これにより、そのページに関して、情報処理装置1とレプリケーション元のコンピュータとの間で、レプリケーションが実行されている最中におけるデータベースの整合性を保つことができる。
 ステップS25では、バックエンドプロセスは、検索処理の対象としたページに対して、受信したクエリに応じた検索処理を実行する。そして、検索範囲において検索処理の対象としていないページが残っている場合、バックエンドプロセスは、ステップS22に戻って処理を繰り返す。他方、検索範囲において検索処理の対象としていないページが残っていない場合、バックエンドプロセスは、クエリに対する応答として検索処理の結果をクライアントPCに返信し、処理を終了する。
 本実施形態では、ページがRAMに読み出された段階で、当該ページに対して、待機させられた更新命令が実行される。また、RAM上に存在するページに対する更新命令は即座に実行される。そのため、本実施形態において、検索範囲に含まれるページが既にRAMに読み出されている場合、当該ページに対する更新命令の実行が待機されていることはない。従って、本実施形態に係るバックエンドプロセスは、ステップS22において、読み出そうとしたページが既にRAMに存在する場合、記憶領域からの読み出しを行わず、既にRAMに存在しているページを検索の処理対象とし、ステップS23及びS24の処理を省略して、ステップS25に処理を進めてよい。
 なお、情報処理装置1の制御部は、バックエンドプロセスを複数実行してもよく、バックエンドプロセスを生成若しくは削除又は起動若しくは停止することで、動作するバックエンドプロセスの数を増減させてもよい。例えば、制御部は、クライアントPCから受け付けたクエリの数に応じて起動するバックエンドプロセスの数を増減させてもよい。この場合、バックエンドプロセスの処理能力を要求に応じて可変にでき、無駄なバックエンドプロセスが存在することを避けることができるため、リソースを効率よく活用することが可能になる。
 また、バックエンドプロセスは、少なくともステップS23及びS24のページの更新に関する処理をヘルパープロセスに任せてもよい。この場合、例えば、バックエンドプロセスは、記憶装置にアクセスした後に、ヘルパープロセスにページの更新を依頼して、ステップS23、S24の処理をヘルパープロセスに実行させる。そして、バックエンドプロセスは、ステップS24の処理が完了した後にヘルパープロセスから通知を受け取ると、ステップS25の検索処理を実行する。このようにバックエンドプロセスがページの更新処理をヘルパープロセスに任せることで、ページの更新処理をヘルパープロセスに一元化することができる。これによって、各プロセスの役割分担を明確にすることができ、各プロセスの構造を単純にすることができる。
 <第1実施形態の作用・効果>
 バックエンドプロセスによる検索処理などにおいてページ(タプル)が処理の対象になる際には、当該ページ(タプル)はRAMに読み出される。既にRAMに読み出されているページ(タプル)については、いつでも処理の対象になる可能性がある。他方、RAMに読み出されていないページ(タプル)は、RAMに読み出されるまで、処理の対象になる可能性がない。
 そこで、メインプロセスは、対象のレコードを参照した時点において、既にRAMに読み出されていることで、いつでも処理の対象になる可能性のあるページに対する更新命令については即座に実行する。他方、メインプロセスは、対象のレコードを参照した時点では、RAM上に存在しないために、処理の対象になる可能性のないページに対する更新命令については実行を待機させる。
 そして、メインプロセスにより待機させられた更新命令は、上記のようなヘルパープロセス又はバックエンドプロセスの動作によって、当該更新命令の対象がRAM上に読み出されて処理の対象になるまでに、又は、当該更新命令の対象がRAM上に読み出されて処理の対象になる際に、実行される。
 ここで、行番号205のタプルに着目すると、当該タプルを挿入する更新命令は、受信したクエリに応じた検索処理に係る同期点以前のレコードにより示される更新命令であるが、当該検索処理に関する動作をバックエンドプロセスが開始したステップS21の時点では、待機しており、実行されていない。しかしながら、検索処理を実行するステップS25の時点では、バックエンドプロセス(又は、ヘルパープロセス)によって、当該更新命令は既に実行されている。そのため、行番号205のタプルは、問題なく、当該検索処理の対象になる。
 すなわち、本実施形態では、メインプロセスは、トランザクションログのレコードを先頭から順に参照し、対象のレコードを参照した時点で処理の対象になる可能性のあるページに対する更新命令については即座に実行し、対象のレコードを参照した時点では処理の対象になる可能性のないページに対する更新命令については実行を待機させる。そして、待機させられた更新命令は、ヘルパープロセス又はバックエンドプロセスによって、その更新命令が実行されていることが要求されるまでには、実行される。
 待機させられる更新命令は、記憶装置にアクセスする必要のあるページを対象とする命令である。ここで、記憶装置にアクセスする速度はRAMにアクセスする速度に比べて非常に遅く、データベースの更新処理は、記憶装置にアクセスする回数が増えるほど、遅くなる。本実施形態に係るメインプロセスの処理では、このような記憶装置にアクセスする必要のある更新命令を実行せずにトランザクションログを処理することができる。そのため、メインプロセスの処理は、記憶装置にアクセスせずに、非常に高速に実行することができる。その結果、本実施形態によれば、同期点までのトランザクションログを高速に処理することができ、バックエンドプロセスによる検索の待機時間を非常に短くすることができる。
 そして、待機させられた更新命令は、ヘルパープロセス又はバックエンドプロセスによって、その更新命令が実行されていることが要求されるまでには、実行される。そのため、バックエンドプロセスによる検索では、待機させられた更新命令が存在しても、検索処理の対象については、同期が完了しているレコード番号までの更新命令による更新を参照することができる。そのため、レプリケーション実行中においても、バックエンドプロセスは、データベースの整合性が確保された状態で、検索を行うことができる。
 また、従来では、上記図2に示される第3の方法のように並列処理可能である場合も含めて、データベースの整合性を保って検索を行うためには、同期点までのトランザクションログに示される全ての更新命令を実行する必要があった。これに対して、本実施形態によれば、待機させられた更新命令のうち、検索処理と関係が無い更新命令については実行を待機したまま、検索処理を実行することができる。すなわち、本実施形態によれば、トランザクションログのレコードにより示される更新命令のうち、実行されていることが要求されている更新命令を優先的に実行し、実行されていることが要求されていない更新命令の実行をスキップ(後回しに)することができるようになる。この点からも、本実施形態によれば、検索の待機時間を短縮することができる。
 従って、本実施形態によれば、これらの理由から、検索処理におけるデータベースの整合性を確保しつつ、検索の待機時間を短縮することができる。
 また、本実施形態では、アクセスが必要になった時に対象の更新命令を実行すればよいため、記憶装置からRAMへの余計なデータの読み込みを抑えることができる。その上、本実施形態では、1回のページの読み込みで、当該ページに対する複数の更新命令を実行することができる。そのため、本実施形態によれば、データベースの更新における記憶装置とRAMとの間のやりとりの効率化を図ることができる。
 なお、ヘルパープロセス又はバックエンドプロセスは、当該ページに対する複数の更新命令を実行する際に、トランザクションログにより示される順序のままに更新命令を実行する。そのため、データベースの整合性を保ちながら、記憶装置とRAMとの間のやりとりの効率化を図ることができる。
 そして、本実施形態に係る情報処理装置1は、マップ情報を利用することで、メインプロセスがスキップした更新命令をページ単位で管理している。データベースの更新処理はページ毎に行われるので、メインプロセスがスキップした更新命令の実行は、ページ単位で、それぞれ別個のプロセスで並列に処理することができる。
 更に、本実施形態に係る情報処理装置1は、並列に処理する度合い、換言すると、起動するヘルパープロセス又はバックエンドプロセスの数、を必要に応じて増減させることができる。例えば、情報処理装置1の制御部は、マップ情報に記録されたページの数と同じ数のヘルパープロセスを動作させることで、マップ情報に記録されたページ毎に待機させられた更新命令の実行を並列に処理することができる。すなわち、本実施形態によれば、待機させた更新命令の実行を並列に処理する度合いを状況に応じて増減させることができるため、並列に処理可能なトランザクションの数とトランザクションログの数との不均衡の問題を解決することができる。
 従って、本実施形態によれば、これらの理由から、トランザクションログをデータベースに適用する処理の速度を高速化することができる。
 なお、本実施形態では、直列的に作成されたトランザクションログが、データベースの更新に利用される。従って、本実施形態によれば、トランザクションログの作成に関する技術を従来システムから変更せずに、トランザクションログをデータベースに適用する処理の速度を改善することができる。
 なお、以上の動作例では、1つのタプルを処理対象とする更新命令(INSERT命令、DELETE命令)をデータベースの更新命令の一例として挙げた。しかしながら、データベースの更新命令は、このような1つのタプルを処理対象とする更新命令に限定されない。例えば、追記型のデータベースでUPDATE命令を実行する場合、更新対象タプルの削除と更新後のタプルの挿入という複数のタプルを処理することになる。この場合、メインプロセスは、UPDATE命令のうち、RAMに読み出されているタプルに対する命令部分については実行し、RAMに読み出されていないタプルに対する命令部分についてはマップ情報に記録する。つまり、複数のタプルを処理対象とする更新命令は、1つのタプルを処理対象とする更新命令が複数集まったものとして扱うことで、制御部は、1つのタプルを処理対象とする更新命令と同様に当該複数のタプルを処理対象とする更新命令を処理することができる。
 また、以上の動作例では、情報処理装置1の制御部は、更新命令の対象であるタプルがRAMに読み出された段階で、当該タプルが処理対象となったと判断している。しかしながら、更新命令の対象が処理対象になったと制御部が判断する段階は、このような例に限定される訳ではない。その他の例として、例えば、情報処理装置1の制御部は、更新命令の対象であるタプルがRAMに読み出されただけでは、当該タプルが処理対象になったとは判断せず、当該タプルに対してロックが獲得された段階で、当該タプルが処理対象となったと判断してもよい。複数のプロセスが対象のページにアクセスしようとする場合、あるプロセスによる対象のページに対する処理が完了するまでに、他のプロセスによって当該ページの内容が変更されてしまう可能性がある。これを避けるために、プロセスは、アクセスするページに対してロックをかける。情報処理装置1の制御部は、このロックがかけられたことをもって、ロックされた対象が処理対象になったと検出してもよい。
 §2 第2実施形態
 本発明の第2実施形態は、一部の処理を除き、第1実施形態とほぼ同様に説明可能である。そのため、第1実施形態と同様に説明できる部分については、適宜省略する。
 [構成例]
 第2実施形態において、図3により例示されるハードウェア構成、図4により例示される各プロセスの関係、及び、取得されるトランザクションログに関する事項は、第1実施形態と同様である。ただし、第2実施形態に係る情報処理装置1は、取得したトランザクションログのレコードを先頭から順に参照し、当該トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、当該更新命令の実行を待機させることで、取得した前記トランザクションログのレコードを処理する。そして、スキップされた更新命令は、対象となるデータが処理対象になるまでに、又は、対象となるデータが処理対象となった際に、実行される。
 すなわち、第2実施形態に係る情報処理装置1は、トランザクションログのレコードの処理において、全ての更新命令について一度待機させる点で、トランザクションログを参照した際にRAMに読み出されているタプルに対する更新命令を実行する第1実施形態とは異なる。
 [動作例]
 次に、図5により示されるデータベースの更新例、図6により示される取得されるトランザクションログの例、及び、図7により示されるクエリを受信した時点における情報処理装置1の動作状態の例を利用して、第2実施形態に係る情報処理装置1の具体的な動作例を説明する。
 <メインプロセス>
 第2実施形態に係るメインプロセスは、取得したトランザクションログのレコードを先頭から順に参照する。そして、第2実施形態に係るメインプロセスは、トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令については、第1実施形態とは異なり、全ての更新命令の実行を待機させることで、当該トランザクションログのレコードを処理する。一方、更新命令以外のレコード、例えば、トランザクションの管理に関するレコードについては、メインプロセスは、第1実施形態と同様、当該レコードにより示される命令(例えば、管理情報の更新)を実行する。
 なお、第2実施形態では、第1実施形態と同様、待機させた更新命令はマップ情報に記録される。マップ情報には、待機させた更新命令の内容とレコードの番号のうち少なくとも一方が当該更新命令の対象(タプル)に関連付けて記録される。ただし、本実施形態では、データベースの各タプルは、記憶装置上においてページ単位で管理されており、記憶装置とRAMとの間のデータのやり取りは、当該ページ単位で行われる。そこで、第2実施形態に係るメインプロセスは、マップ情報において、待機させた更新命令の内容とレコードの番号のうち少なくとも一方を、当該待機させた更新命令の対象となるタプルを含むページに関連付けて記録する。すなわち、ページは、本発明の「所定の集合」に相当する。
 具体的には、第2実施形態に係るメインプロセスは、33番のレコード、35番のレコード等のデータベースの更新命令に係るレコードを参照する度に、参照したレコードにより示される更新命令の内容とレコードの番号のうちの少なくとも一方を、当該更新命令の対象となるタプルを含むページに関連付けてマップ情報に記録する。なお、後述する図12~15は、更新命令の内容又はレコードの番号のいずれかがマップ情報に記録される場面を例示する。
 なお、第2実施形態に係るメインプロセスは、第1実施形態と同様、参照したレコードがトランザクションの管理に関するレコードである場合、当該レコードが示す内容に合わせて、トランザクションを管理するための管理情報を更新する。
 また、第2実施形態では、第1実施形態と同様、図1に例示される第2の方法のようにレプリケーションを行う場面を想定している。ただし、第1実施形態と同様に、第2実施形態に適用されるレプリケーションの方法は当該第2の方法に限定されず、図1に例示される第1の方法が第2実施形態において採用されてもよい。また、第2実施形態において実行されるレプリケーションの方式は、同期レプリケーションではなく、非同期レプリケーションであってもよい。
 図12は、第2実施形態において、図7で例示される状態の後に、メインプロセスの処理が36番のレコードまで完了した時点における情報処理装置1の動作状態を例示する。
 32番から36番のレコードのうち、33番、35番及び36番のレコードは、データベースの更新命令に関するレコードである。また、32番及び34番のレコードは、トランザクションの管理に関するレコードであり、更新命令以外の命令に関するレコードである。
 そこで、メインプロセスは、まず、32番のレコードを参照し、第1実施形態と同様に、32番のレコードにより示される命令を実行する。具体的には、メインプロセスは、例えば、1番目のトランザクションの状態が実行中であることを示すように、管理情報を更新する。
 32番のレコードを処理すると、メインプロセスは、次の33番のレコードを参照する。ここで、33番のレコードにより示される更新命令(D1_101_5)の対象はRAM上に読み出されている。しかしながら、メインプロセスは、第1実施形態とは異なり、33番のレコードにより示される更新命令(D1_101_5)の実行を待機させる。そして、メインプロセスは、33番のレコードにより示される更新命令の内容(D1_101_5)又はレコード番号(33)をページ番号(P5)に関連付けてマップ情報に記録する。
 33番のレコードを処理すると、メインプロセスは、次の34番のレコードを参照し、第1実施形態と同様に、34番のレコードにより示される命令を実行する。具体的には、メインプロセスは、例えば、2番目のトランザクションの状態が実行中であることを示すように、管理情報を更新する。
 34番のレコードを処理すると、メインプロセスは、次の35番のレコードを参照し、35番のレコードにより示される更新命令(I2_205_2)の実行を待機させる。そして、メインプロセスは、35番のレコードにより示される更新命令(I2_205_2)の内容又はレコード番号(35)をページ番号(P2)に関連付けてマップ情報に記憶する。
 35番のレコードを処理すると、メインプロセスは、次の36番のレコードを参照し、36番のレコードにより示される更新命令(D1_103_2)の実行を待機させる。そして、メインプロセスは、36番のレコードにより示される更新命令(D1_103_2)の内容又はレコード番号(36)をページ番号(P2)に関連付けてマップ情報に記憶する。これにより、36番までのレコードの処理が完了する。
 なお、バックエンドプロセスは、第1実施形態と同様、クエリを受信した時点で設定されていた同期点である40番のレコードまでメインプロセスの処理が完了していないため、実行を待機している。
 図13は、図12で例示される状態の後に、図7の時点で設定されていた同期点(40番)のレコードまでメインプロセスの処理が完了した時点における情報処理装置1の動作状態を例示する。
 37番から40番のレコードのうち、38番と39番のレコードは、データベースの更新命令に関するレコードである。また、37番と40番のレコードは、トランザクションの管理に関するレコードであり、更新命令以外の命令に関するレコードである。
 そこで、メインプロセスは、まず、37番のレコードを参照し、第1実施形態と同様に、37番のレコードにより示される命令を実行する。具体的には、メインプロセスは、例えば、1番目のトランザクションがコミットされたことを示すように、管理情報を更新する。
 37番のレコードを処理すると、メインプロセスは、次の38番のレコードを参照し、38番のレコードにより示される更新命令(D2_104_9)の実行を待機させる。そして、メインプロセスは、38番のレコードにより示される更新命令(D2_104_9)の内容又はレコード番号(38)をページ番号(P9)に関連付けてマップ情報に記録する。
 38番のレコードを処理すると、メインプロセスは、次の39番のレコードを参照する。ここで、39番のレコードにより示される更新命令(I2_206_8)の対象はRAM上に読み出されている。しかしながら、メインプロセスは、第1実施形態とは異なり、39番のレコードにより示される更新命令(I2_206_8)の実行を待機させる。そして、メインプロセスは、39番のレコードにより示される更新命令(I2_206_8)の内容又はレコード番号(39)をページ番号(P8)に関連付けてマップ情報に記録する。
 39番のレコードを処理すると、メインプロセスは、次の40番のレコードを参照し、第1実施形態と同様、40番のレコードにより示される命令を実行する。具体的には、メインプロセスは、例えば、2番目のトランザクションがコミットされたことを示すように、管理情報を更新する。
 これにより、クエリを受信した時点で設定されていた同期点である40番のレコードまでメインプロセスの処理が完了するため、バックエンドプロセスは、対象のクエリに対する検索処理を実行することが可能になる。
 <ヘルパープロセス>
 第2実施形態に係るヘルパープロセスは、第1実施形態と同様、マップ情報を参照して、待機させた更新命令を実行する。
 図14は、第2実施形態におけるヘルパープロセスの処理手順を例示する。なお、図14は、図13におけるバックエンドプロセスによる検索処理が開始する前に、ヘルパープロセスによる処理が開始した場面を例示する。
 ステップS51では、ヘルパープロセスは、マップ情報を参照し、待機している更新命令が存在するか否かを判定する。待機している更新命令がマップ情報に記録されていない場合、ヘルパープロセスは処理を終了する。他方、待機している更新命令がマップ情報に記録されている場合、自身が処理する対象を管理単位に応じて選択して、処理をステップS52に進める。なお、図14で例示される場面では、ヘルパープロセスは、自身が処理する対象としてP5のページを選択している。
 ステップS52では、ヘルパープロセスは、選択したページがRAM上に存在するか否かを判定する。そして、選択したページがRAM上に存在する場合、ヘルパープロセスは、待機している更新命令(マップ情報に記録されている更新命令)を実行する。他方、選択したページがRAM上に存在しない場合、ヘルパープロセスは、第1実施形態に係る図10で例示されるように、記憶装置から選択したページをRAM上に読み出し、読み出したページに対して待機している更新命令(マップ情報に記録されている更新命令)を実行する。
 図14で例示される場面では、ヘルパープロセスが選択したページ(P5)はRAM上に存在している。そのため、ヘルパープロセスは、P5について待機している更新命令(D1_101_5)を実行して、行番号101のタプルに削除ポインタを付与する。そして、ヘルパープロセスは、処理した更新命令に関する記録をマップ情報から削除して、処理を終了する。
 なお、選択したページに対して複数の更新命令が待機している場合にマップ情報に記録されている順にヘルパープロセスが当該待機している更新命令を実行する点、ヘルパープロセスを生成若しくは削除又は起動若しくは停止することで動作するヘルパープロセスの数を増減させてよい点、一定数のヘルパープロセスを予め起動させておいてもよい点、及び、ヘルパープロセスが本動作例に示されるタイミング以外に適宜処理を実行してもよい点については、第2実施形態は第1実施形態と共通する。そのため、説明を省略する。
 <バックエンドプロセス>
 第2実施形態に係るバックエンドプロセスは、第1実施形態と同様、クライアントPCからのデータベースに対する検索リクエスト(クエリ)に応じて、検索処理を実行する。バックエンドプロセスは、当該検索処理を実行する際に、マップ情報を参照し、検索対象となるページについて待機された更新命令が存在するか否かを判定する。そして、検索対象となるページについて待機された更新命令が存在しない場合、バックエンドプロセスは、当該ページに対する検索処理を実行する。他方、検索対象となるページについて待機された更新命令が存在する場合、バックエンドプロセスは、当該待機された更新命令を実行した後に、当該ページに対する検索処理を実行する。なお、バックエンドプロセスにおける当該マップ情報に記録された更新命令を適用する処理は、第1実施形態と同様にヘルパープロセスによって実行されてもよい。
 図15は、第2実施形態におけるバックエンドプロセスの処理手順を例示する。なお、図15は、図13及び14で例示した状態の後に、バックエンドプロセスによる検索処理が開始した場面を例示する。
 ステップS61では、バックエンドプロセスは、受信したクエリの内容に適合するタプルを抽出するために、当該クエリに関連する領域に含まれるページにアクセスし、アクセスしたページを検索の処理対象とする。図15では、バックエンドプロセスがRAM上に存在するページ(P8)にアクセスする場面が例示されている。一方、アクセスするページがRAM上に存在しない場合は、第1実施形態に係る図11で例示されるように、記憶装置にアクセスして、当該記憶装置から対象のページをRAM上に読み出す。
 なお、検索の処理対象とする際には、バックエンドプロセスは、アクセスするページに対してのロックを獲得する。第2実施形態に係る情報処理装置1の制御部は、対象のページについてのロックの獲得を、当該対象のページが処理対象になったと判断する要因の一例として取り扱ってよい。つまり、第2実施形態に係る情報処理装置1の制御部は、対象のページについてのロックが獲得されることで、当該対象のページが処理対象になったと判断してもよい。
 なお、対象のページが処理対象になったと判定される動作は、実施の形態に応じて適宜設定されてよく、ロックの獲得に限定されるものではない。
 ステップS62では、バックエンドプロセスは、マップ情報を参照し、アクセスしたページについて待機している更新命令があるか否かを判定する。アクセスしたページについて待機している更新命令がマップ情報に記録されていない場合、バックエンドプロセスは、ステップS64に処理を進める。他方、アクセスしたページについて待機している更新命令がマップ情報に記録されている場合は、処理はステップS63に進む。図15では、アクセスしたページ(P8)について待機している更新命令(I2_206_8)が存在するため、処理はステップS63に進む。
 ステップS63では、バックエンドプロセスは、アクセスしたRAM上のページについて待機している更新命令を実行する。図15では、バックエンドプロセスは、P8について待機している更新命令(I2_206_8)を実行する。すなわち、バックエンドプロセスは、行番号206のタプルをP8に挿入する。そして、バックエンドプロセスは、アクセスしたページについて待機している更新命令を全て実行した後に、処理した更新命令に関する記録をマップ情報から削除する。
 ステップS64では、バックエンドプロセスは、アクセスしたRAM上のページに対して、受信したクエリに応じた検索処理を実行する。そして、検索範囲においてアクセスしていない領域が残っている場合、バックエンドプロセスは、ステップS61に戻って処理を繰り返す。他方、検索範囲においてアクセスしていない領域が残っていない場合、バックエンドプロセスは、クエリに対する応答として検索処理の結果をクライアントPCに返信し、処理を終了する。
 なお、バックエンドプロセスが1つ1つ対象のページにアクセスしてもよく、又は、一度に複数のページにアクセスしてもよい点、アクセスしたページに対して複数の更新命令が待機している場合にマップ情報に記録されている順にバックエンドプロセスが当該待機している更新命令を実行する点、バックエンドプロセスを生成若しくは削除又は起動若しくは停止することで動作するバックエンドプロセスの数を増減させてよい点、及び、ページの更新に関する処理をバックエンドプロセスはヘルパープロセスに任せてもよい点については、第2実施形態は第1実施形態と共通する。そのため、説明を省略する。
 <第2実施形態の作用・効果>
 ここで、第2実施形態において、行番号206のタプルに着目すると、第1実施形態に係る図11で例示した行番号205のタプルと同様の説明が可能である。すなわち、バックエンドプロセスによる検索処理の対象となった時点(ステップS61)では、当該検索処理に係る同期点以前のレコード(39番のレコード)により示される、当該タプルに関する更新命令は、まだ実行されておらず、待機している。しかしながら、検索処理が実行される時点(ステップS64)までには、バックエンドプロセス(又は、ヘルパープロセス)によって、当該39番のレコードにより示される更新命令は実行される。そのため、行番号206のタプルは、問題なく、当該検索処理の対象となる。
 すなわち、第2実施形態によれば、第1実施形態と同様の理由により、データベースの整合性を確保しつつ、検索の待機時間を短縮することができ、トランザクションログをデータベースに適用する処理の速度を高速化することができる。また、第2実施形態においても、直列的に作成されたトランザクションログがデータベースの更新に利用されるため、トランザクションログの作成に関する技術を従来システムから変更せずに、トランザクションログをデータベースに適用する処理の速度を改善することができる。
 一方、第1実施形態とは異なり、マップ情報に記録された行番号206のタプルを追加する更新命令の対象であるP8のページは、メインプロセスが39番のレコードを参照する時点で既にRAMに存在している。第1実施形態の説明のとおり、RAMに存在しているページはいつでも処理の対象になる可能性がある。しかしながら、それらのページが直ちに処理の対象となるとは限らないため、メインプロセスは、それらのページに対する更新命令を待機させてもかまわない。また、後述するとおり、それらのページがちょうど処理の対象となっている場合も、メインプロセスは、それらのページに対する更新命令を待機させてもかまわない。そこで、第2実施形態に係るメインプロセスは、RAM上に存在しているページに対する更新命令も、RAM上に存在していないページに対する更新命令と同様に待機させて、一度、マップ情報に記録する。
 すなわち、第2実施形態に係るメインプロセスは、RAM上に存在しているか否かを問わず、RAM上に存在しているページに対する更新命令とRAM上に存在していないページに対する更新命令とを同様に取り扱う。そのため、第2実施形態に係るメインプロセスは、第1実施形態に係るメインプロセスの動作に含まれる、トランザクションログのレコードにより示される更新命令の対象となるタプルに関するページがRAM上に存在しているか否かを判定する処理を省略することができる。
 また、第2実施形態では、メインプロセスは、トランザクションログのレコードにより示されるデータベースの更新命令を実行しないため、RAM上に読み出されたページの状態を変更しない。そのため、第2実施形態に係るメインプロセスは、第1実施形態に係るメインプロセスとは異なり、RAM上に読み出されたページの状態を変更する他のプロセス(例えば、ヘルパープロセス、バックエンドプロセス等)に動作を妨げられることなく、処理を実行することができる。
 たとえば、メインプロセスが更新命令を参照した際に、当該更新命令の対象となるタプルに関するページが、RAM上に存在して、バックエンドプロセスにより処理の対象となっていた場合、バックエンドプロセスは当該ページに対するロックを獲得している。そのため、メインプロセスは、当該更新命令を即座に実行する場合は、バックエンドプロセスがそのページに対する検索処理を完了してロックを開放するまで、待機することになる。第2実施形態では、メインプロセスはこのようなロックの待機を行なわなくてよいため、他のプロセスに動作を妨げられることなく、処理を実行することができる。
 また、当該ページを処理の対象としているバックエンドプロセスは、ロックを取得した時点のデータベースの状態に基づいて検索処理を実行する。したがって、当該更新命令は、ロックが開放された後、当該ページがその次に処理の対象となるまでに実行されれば良い。そのため、更新命令の対象となるタプルに関するページがちょうど処理の対象となっている場合も、メインプロセスは、検索におけるデータベースの整合性を損なうことなく、当該更新命令を待機させることができる。
 これらの理由により、第2実施形態では、第1実施形態に比べて、メインプロセスの処理を簡単に、かつ、高速に実行することが可能になる。そのため、同期レプリケーションに当該データベースの更新方法を適用する場合、第2実施形態によれば、クエリを受信してから検索処理を開始するまでの時間を第1実施形態よりも短縮することが可能である。
 ここで、更新命令を待機させる場合、当該更新命令を待機させる際と当該更新命令を実行する際に、当該更新命令の参照が生じる。すなわち、更新命令を即座に実行する場合と比較して、更新命令を待機させる場合は更新命令を参照する回数が増加する。そのため、第2実施形態では、第1実施形態と比較して、待機させる更新命令が増加する分、当該更新命令の参照に関する処理の量が増加する。
 しかしながら、増加する部分の処理は、上記動作例で説明したとおりに、並列に処理可能である。そのため、並列度が高いシステムでは、メインプロセスの処理が終わるまでの時間は検索処理実行のボトルネックとなるため、第1実施形態よりもメインプロセスを高速に実行できる第2実施形態の方がよい。すなわち、更新命令の参照に関して増加する処理の量が並列に処理可能になることで短縮される量よりも少ない場合、第1実施形態よりも第2実施形態を利用した方がよい結果が得られる。
 なお、第2実施形態において、データベースの更新命令が1つのタプルを処理対象とする更新命令に限定されない点は、第1実施形態と同様である。
 1…情報処理装置

Claims (14)

  1.  トランザクションログを利用して自身のデータベースを更新するコンピュータが、
     前記トランザクションログを取得するステップと、
     取得した前記トランザクションログのレコードを先頭から順に参照し、前記トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、該レコードにより示される更新命令の対象が前記コンピュータのメモリ上に読み出されている場合は該更新命令を実行し、該レコードにより示される更新命令の対象が前記コンピュータのメモリ上に読み出されていない場合は該更新命令の実行を待機させることで、取得した前記トランザクションログのレコードを処理するステップと、
     待機させた更新命令の対象が前記メモリ上に読み出されて処理の対象になるまでに、又は、待機させた更新命令の対象が前記メモリ上に読み出されて処理の対象となった際に、該対象について待機させた更新命令を実行するステップと、
    を実行する情報処理方法。
  2.  前記コンピュータは、前記トランザクションログを取得するステップにおいて、他のコンピュータのデータベースと前記自身のデータベースとの間でレプリケーションを行うために、前記他のコンピュータにおいて直列的に作成されたトランザクションログを取得する、
    請求項1に記載の情報処理方法。
  3.  前記コンピュータは、
     前記レコードにより示される更新命令の実行を待機させる際、前記更新命令の対象に待機させた更新命令が存在することを示すために、待機させた前記更新命令の内容及び前記レコードの番号のうちの少なくとも一方を、前記更新命令の対象に関連付けてマップ情報に記録し、
     前記マップ情報を参照して、前記対象について待機させた更新命令を実行する、
    請求項1又は2に記載の情報処理方法。
  4.  前記コンピュータは、
     処理の対象の前記メモリへの読み込みを所定の集合ごとに行い、
     前記レコードにより示される更新命令の実行を待機させる際、前記更新命令の対象に待機させた更新命令が存在することを示すために、待機させた前記更新命令の内容及び前記レコードの番号のうちの少なくとも一方を、前記更新命令の対象を含む所定の集合に関連付けてマップ情報に記録し、
     前記所定の集合が前記メモリ上に読み出されて処理の対象になるまでに、又は、前記所定の集合が前記メモリ上に読み出されて処理の対象となった際に、前記マップ情報を参照して、前記所定の集合に含まれる対象について待機させた更新命令を実行する、
    請求項1又は2に記載の情報処理方法。
  5.  前記コンピュータは、前記自身のデータベースに対する検索処理を、該検索処理に関して処理されていることが求められる前記トランザクションログのレコードに対する処理が完了するまで、待機させる、
    請求項1から4のいずれか1項に記載の情報処理方法。
  6.  トランザクションログを利用して自身のデータベースを更新するコンピュータが、
     前記トランザクションログを取得するステップと、
     取得した前記トランザクションログのレコードを先頭から順に参照し、前記トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、該更新命令の実行を待機させることで、取得した前記トランザクションログのレコードを処理するステップと、
     待機させた更新命令の対象が処理の対象になるまでに、又は、待機させた更新命令の対象が処理の対象となった際に、該対象について待機させた更新命令を実行するステップと、
    を実行する情報処理方法。
  7.  前記コンピュータは、前記トランザクションログを取得するステップにおいて、他のコンピュータのデータベースと前記自身のデータベースとの間でレプリケーションを行うために、前記他のコンピュータにおいて直列的に作成されたトランザクションログを取得する、
    請求項6に記載の情報処理方法。
  8.  前記コンピュータは、
     前記更新命令を待機させる際に、前記更新命令の対象に待機させた更新命令が存在することを示すために、前記更新命令の内容と前記更新命令に係るレコードの番号のうち少なくとも一方を前記更新命令の対象に関連付けてマップ情報に記録し、
     前記マップ情報を参照して、前記対象について待機させた前記更新命令を実行する、
    請求項6又は7に記載の情報処理方法。
  9.  前記コンピュータは、
     処理の対象の前記メモリへの読み込みを所定の集合ごとに行い、
     前記更新命令の実行を待機させる際、前記更新命令の対象に待機させた更新命令が存在することを示すために、待機させた前記更新命令の内容及び前記レコードの番号のうちの少なくとも一方を、前記更新命令の対象を含む所定の集合に関連付けてマップ情報に記録し、
     前記所定の集合が処理の対象になるまでに、又は、前記所定の集合が処理の対象となった際に、前記マップ情報を参照して、前記所定の集合に含まれる対象について待機させた更新命令を実行する、
    請求項6又は7に記載の情報処理方法。
  10.  前記コンピュータは、前記自身のデータベースに対する検索処理を、該検索処理に関して処理されていることが求められる前記トランザクションログのレコードに対する処理が完了するまで、待機させる、
    請求項6から9のいずれか1項に記載の情報処理方法。
  11.  トランザクションログを利用して自身のデータベースを更新する情報処理装置であって、
     前記トランザクションログを取得する手段と、
     取得した前記トランザクションログのレコードを先頭から順に参照し、前記トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、該レコードにより示される更新命令の対象が前記コンピュータのメモリ上に読み出されている場合は該更新命令を実行し、該レコードにより示される更新命令の対象が前記コンピュータのメモリ上に読み出されていない場合は該更新命令の実行を待機させることで、取得した前記トランザクションログのレコードを処理する手段と、
     待機させた更新命令の対象が前記メモリ上に読み出されて処理の対象になるまでに、又は、待機させた更新命令の対象が前記メモリ上に読み出されて処理の対象となった際に、該対象について待機させた更新命令を実行する手段と、
    を備える情報処理装置。
  12.  トランザクションログを利用して自身のデータベースを更新するコンピュータに、
     前記トランザクションログを取得するステップと、
     取得した前記トランザクションログのレコードを先頭から順に参照し、前記トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、該レコードにより示される更新命令の対象が前記コンピュータのメモリ上に読み出されている場合は該更新命令を実行し、該レコードにより示される更新命令の対象が前記コンピュータのメモリ上に読み出されていない場合は該更新命令の実行を待機させることで、取得した前記トランザクションログのレコードを処理するステップと、
     待機させた更新命令の対象が前記メモリ上に読み出されて処理の対象になるまでに、又は、待機させた更新命令の対象が前記メモリ上に読み出されて処理の対象となった際に、該対象について待機させた更新命令を実行するステップと、
    を実行させるためのプログラム。
  13.  トランザクションログを利用して自身のデータベースを更新する情報処理装置であって、
     前記トランザクションログを取得する手段と、
     取得した前記トランザクションログのレコードを先頭から順に参照し、前記トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、該更新命令の実行を待機させることで、取得した前記トランザクションログのレコードを処理する手段と、
     待機させた更新命令の対象が処理の対象になるまでに、又は、待機させた更新命令の対象が処理の対象となった際に、該対象について待機させた更新命令を実行する手段と、
    を備える情報処理装置。
  14.  トランザクションログを利用して自身のデータベースを更新するコンピュータに、
     取得した前記トランザクションログのレコードを先頭から順に参照し、前記トランザクションログに含まれるレコードのうち、データベースに含まれるデータを更新する更新命令に関するレコードについて、該更新命令の実行を待機させることで、取得した前記トランザクションログのレコードを処理するステップと、
     待機させた更新命令の対象が処理の対象になるまでに、又は、待機させた更新命令の対象が処理の対象となった際に、該対象について待機させた更新命令を実行するステップと、
    を実行させるためのプログラム。
PCT/JP2012/083289 2012-12-21 2012-12-21 情報処理方法、情報処理装置、及び、プログラム WO2014097475A1 (ja)

Priority Applications (4)

Application Number Priority Date Filing Date Title
PCT/JP2012/083289 WO2014097475A1 (ja) 2012-12-21 2012-12-21 情報処理方法、情報処理装置、及び、プログラム
EP12890487.7A EP2937788A4 (en) 2012-12-21 2012-12-21 INFORMATION PROCESSING METHOD, INFORMATION PROCESSING DEVICE, AND PROGRAM
JP2014552858A JP6082029B2 (ja) 2012-12-21 2012-12-21 情報処理方法、情報処理装置、及び、プログラム
US14/744,877 US10437812B2 (en) 2012-12-21 2015-06-19 Information processing method, information processing device, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2012/083289 WO2014097475A1 (ja) 2012-12-21 2012-12-21 情報処理方法、情報処理装置、及び、プログラム

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/744,877 Continuation US10437812B2 (en) 2012-12-21 2015-06-19 Information processing method, information processing device, and medium

Publications (1)

Publication Number Publication Date
WO2014097475A1 true WO2014097475A1 (ja) 2014-06-26

Family

ID=50977851

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/083289 WO2014097475A1 (ja) 2012-12-21 2012-12-21 情報処理方法、情報処理装置、及び、プログラム

Country Status (4)

Country Link
US (1) US10437812B2 (ja)
EP (1) EP2937788A4 (ja)
JP (1) JP6082029B2 (ja)
WO (1) WO2014097475A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016120988A1 (ja) * 2015-01-27 2016-08-04 株式会社日立製作所 データベースシステム及びデータベース管理方法
CN110209732A (zh) * 2019-04-25 2019-09-06 深圳壹账通智能科技有限公司 关系型数据库到Hadoop数据库的数据同步方法和装置

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11188501B1 (en) * 2017-08-15 2021-11-30 Amazon Technologies, Inc. Transactional and batch-updated data store search

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03122729A (ja) * 1989-09-25 1991-05-24 Internatl Business Mach Corp <Ibm> データベース更新システム及び方法
JP2006106868A (ja) * 2004-09-30 2006-04-20 Toshiba Corp ファイル管理機能を備えたファイルシステム及びファイル管理方法
JP2007501449A (ja) * 2003-08-02 2007-01-25 インターナショナル・ビジネス・マシーンズ・コーポレーション メッセージのキューを処理するための方法、装置、およびコンピュータ・プログラム
JP2007264685A (ja) * 2006-03-27 2007-10-11 Fujitsu Ltd ミラーサイト運用プログラム、方法及びミラーサイトサーバコンピュータ
WO2010106991A1 (ja) 2009-03-19 2010-09-23 株式会社ココリンク データの複製管理方法及びシステム
JP2012133417A (ja) 2010-12-20 2012-07-12 Nec Corp 情報処理システム

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5353410A (en) * 1992-03-18 1994-10-04 International Business Machines Corporation Method and system for deferred read in lazy-write disk cache systems
US7257699B2 (en) * 2004-07-08 2007-08-14 Sun Microsystems, Inc. Selective execution of deferred instructions in a processor that supports speculative execution
JP4833734B2 (ja) 2006-05-19 2011-12-07 株式会社日立製作所 データベースシステム、ストレージ装置、初期コピー方法及びログ適用方法
KR100926880B1 (ko) * 2007-05-21 2009-11-16 엔에이치엔(주) Dbms에서의 데이터 복제 방법 및 시스템
JP5039891B2 (ja) 2009-10-19 2012-10-03 インターナショナル・ビジネス・マシーンズ・コーポレーション データベースの複製を生成する装置及び方法
US20110178984A1 (en) 2010-01-18 2011-07-21 Microsoft Corporation Replication protocol for database systems
CN101860797B (zh) 2010-05-21 2014-08-13 中兴通讯股份有限公司 数据信息的传输方法、装置及移动多媒体广播业务系统
US10430298B2 (en) 2010-10-28 2019-10-01 Microsoft Technology Licensing, Llc Versatile in-memory database recovery using logical log records
JP5741254B2 (ja) 2011-06-30 2015-07-01 富士通株式会社 送信制御方法、装置及びプログラム

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03122729A (ja) * 1989-09-25 1991-05-24 Internatl Business Mach Corp <Ibm> データベース更新システム及び方法
JP2007501449A (ja) * 2003-08-02 2007-01-25 インターナショナル・ビジネス・マシーンズ・コーポレーション メッセージのキューを処理するための方法、装置、およびコンピュータ・プログラム
JP2006106868A (ja) * 2004-09-30 2006-04-20 Toshiba Corp ファイル管理機能を備えたファイルシステム及びファイル管理方法
JP2007264685A (ja) * 2006-03-27 2007-10-11 Fujitsu Ltd ミラーサイト運用プログラム、方法及びミラーサイトサーバコンピュータ
WO2010106991A1 (ja) 2009-03-19 2010-09-23 株式会社ココリンク データの複製管理方法及びシステム
JP2012133417A (ja) 2010-12-20 2012-07-12 Nec Corp 情報処理システム

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2937788A4

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016120988A1 (ja) * 2015-01-27 2016-08-04 株式会社日立製作所 データベースシステム及びデータベース管理方法
CN110209732A (zh) * 2019-04-25 2019-09-06 深圳壹账通智能科技有限公司 关系型数据库到Hadoop数据库的数据同步方法和装置

Also Published As

Publication number Publication date
US10437812B2 (en) 2019-10-08
US20150286672A1 (en) 2015-10-08
JPWO2014097475A1 (ja) 2017-01-12
EP2937788A1 (en) 2015-10-28
EP2937788A4 (en) 2016-06-22
JP6082029B2 (ja) 2017-02-15

Similar Documents

Publication Publication Date Title
EP3596619B1 (en) Methods, devices and systems for maintaining consistency of metadata and data across data centers
US9646045B2 (en) Transaction processing system, method and program
EP3413215B1 (en) Dynamic snapshot isolation protocol selection
JP4522170B2 (ja) リレーショナルデータベースのインデックス追加プログラム,インデックス追加装置及びインデックス追加方法
EP2653986B1 (en) Client-side caching of a database transaction token.
US9171027B2 (en) Managing a multi-version database
US9218405B2 (en) Batch processing and data synchronization in cloud-based systems
US20130086018A1 (en) Transaction processing system, method, and program
US20170315882A1 (en) Protected write-back cache transaction replication
EP3519986B1 (en) Direct table association in in-memory databases
WO2023093245A1 (zh) 基于分布式文件系统的元数据查询方法、设备和存储介质
US10379779B2 (en) Concurrent, incremental, and generational mark and sweep garbage collection
WO2022206398A1 (en) Method and apparatus for reading data maintained in tree data structures
US8600962B2 (en) Transaction processing device, transaction processing method, and transaction processing program
JP6082029B2 (ja) 情報処理方法、情報処理装置、及び、プログラム
Cruz et al. A scalable file based data store for forensic analysis
JP5235483B2 (ja) データベースと仮想テーブルの整合性を維持する方法および装置。
US20150039558A1 (en) Database management method, database system and medium
US9390131B1 (en) Executing queries subject to different consistency requirements
KR101424568B1 (ko) 트랜잭션 재시작 가능한 클라이언트 장치와 데이터베이스 서버 및 방법
EP2402861A1 (en) Storage system
JP4951154B1 (ja) データベースの管理方法
JP6461101B2 (ja) データベースシステム、情報処理装置、方法およびプログラム
JP5181183B2 (ja) 変換装置、サーバシステム、変換方法およびプログラム
JP5967628B2 (ja) クエリを処理する装置及び方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12890487

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2014552858

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2012890487

Country of ref document: EP