WO2015170386A1 - Database management system, computer system, and database management method - Google Patents

Database management system, computer system, and database management method Download PDF

Info

Publication number
WO2015170386A1
WO2015170386A1 PCT/JP2014/062378 JP2014062378W WO2015170386A1 WO 2015170386 A1 WO2015170386 A1 WO 2015170386A1 JP 2014062378 W JP2014062378 W JP 2014062378W WO 2015170386 A1 WO2015170386 A1 WO 2015170386A1
Authority
WO
WIPO (PCT)
Prior art keywords
data structure
data
transaction processing
transaction
priority
Prior art date
Application number
PCT/JP2014/062378
Other languages
French (fr)
Japanese (ja)
Inventor
有哉 礒田
敦 友田
知広 花井
一智 牛嶋
Original Assignee
株式会社日立製作所
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社日立製作所 filed Critical 株式会社日立製作所
Priority to PCT/JP2014/062378 priority Critical patent/WO2015170386A1/en
Publication of WO2015170386A1 publication Critical patent/WO2015170386A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures

Definitions

  • the present invention generally relates to transaction processing, for example, database consistency control technology.
  • Transaction processing is generally performed in a computer system.
  • a DBMS database management system
  • the DBMS controls the consistency of records that are input and output data. As a result, the user can always input / output the intended record.
  • Such DBMS consistency control is generally referred to as Tx (transaction) processing.
  • Tx transaction processing.
  • the Tx process is used when a plurality of reference and update instructions are realized atomically.
  • a plurality of instructions in a specified section are processed atomically by declaring the beginning and end of the instruction section to be executed atomically (Tx processing section).
  • the ACID property indicates atomicity, consistency, isolation, and durability.
  • Atomicity means that a plurality of instructions in the Tx processing section are all executed or not executed at all.
  • Consistency means not making a transition to a state other than the rules given to the database.
  • Independence means that the result of Tx processing is always the same as when Tx processing is executed sequentially.
  • Persistence means that if the Tx process is committed, the result of the Tx process can always be restored even if a failure occurs in the DBMS. As described above, the DBMS maintains the consistency of the Tx processing by satisfying the ACID characteristic.
  • Patent Document 1 For the problem of the lock mechanism, in Patent Document 1, the state before and after the record update is managed by a switch. Thereby, the state before and after the update of the record can be changed with a small number of processes. Further, according to Non-Patent Document 1, it is possible to make a reference lock unnecessary among two types of locks, that is, a reference lock and an update lock, by managing the visibility of records in time. In Patent Document 2, the processing speed is increased by providing a lock-free database management method.
  • Tx2 can refer to the commit result of Tx1 without waiting for the completion of the log process of Tx1, and the log process can be concealed.
  • Patent Documents 1 and 2 and Non-Patent Document 1 can be expected to improve the problem of reference lock and update lock.
  • the addition of a new state as in Patent Document 3 complicates the problem of reference lock and update lock. For this reason, a new lock mechanism for efficiently managing a plurality of states is required.
  • An object of the present invention is to visualize the updated data area at high speed.
  • the computer system receives a transaction processing instruction for updating one or more data areas of a plurality of data areas, and uses a data structure including a Tx state, which is a transaction processing state according to the transaction processing instruction, as the transaction processing instruction. Generate based on.
  • the computer system associates each of one or more data areas updated by transaction processing with a data structure.
  • the computer system executes transaction processing based on the data structure.
  • the updated data area can be visualized at high speed.
  • xxx table information may be described using the expression “xxx table”, but the information may be expressed in any data structure. That is, “xxx table” can be referred to as “xxx information” to indicate that the information does not depend on the data structure.
  • the subject of the process may be a processor in order to perform the determined process appropriately using a storage resource (for example, memory) and / or a communication interface.
  • the processing described with the functional unit as the subject may be processing performed by an apparatus including a processor.
  • the processor may include a hardware circuit that performs part or all of the processing.
  • the computer program may be installed on the device from a program source.
  • the program source may be, for example, a program distribution server or a storage medium that can be read by a computer.
  • the entire reference code is used (for example, TxID200A), but when the same element is described without being distinguished, only the common code among the reference codes is used. (For example, TxID200).
  • FIG. 1 is a functional block diagram of the overall outline of the system according to the embodiment.
  • the user 1000 sends an instruction to the computer system 1100 by accessing the computer system (for example, a large-scale computer system realized by a plurality of nodes 1200) 1100 from the computer system (for example, personal computer) 1110 through the network 1400. it can.
  • the user 1000 can also directly operate the computer system 1100.
  • the computer system 1100 has one or more nodes 1200.
  • the node 1200 is an example of a computer.
  • the nodes 1200 may be connected by a system bus 1101.
  • the node 1200 includes a storage device 1202, an input / output device 1203, and a processor 1201 connected to them.
  • the storage device 1202 includes a main storage device (for example, a DRAM (Dynamic Random Access Memory) and at least a main storage device) .
  • the input / output device 1203 may be a communication interface device or a man-machine interface device. (For example, an input device such as a keyboard and a pointing device and an output device such as a display device.)
  • an external storage device 1300 capable of communicating via the network 1400 may be provided outside the computer system 1100.
  • the DBMS may be executed by one or more nodes 1200 (one or more processors 1201).
  • the DBMS 1301 includes a query reception unit 1311 that receives a query, a query plan generation unit 1312 that generates a query plan that is an execution plan of the query, and a query execution that executes a query according to the query plan.
  • Tx executed in the Tx process corresponds to Tx of one query according to the query plan. That is, in this embodiment, one TxID (transaction ID) is allocated by the query execution unit 1313 for one query (one query plan).
  • At least two of these functional units 1311, 1312, and 1313 may be integrated, or at least one of these functional units 1311, 1312, and 1313 may be subdivided.
  • These functional units 1311, 1312, and 1313 are realized by executing the DBMS 1301 by one or more processors 1201.
  • a database referenced or updated by the DBMS 1301 exists in one or more storage devices 1202.
  • a so-called in-memory database is realized.
  • the storage device 1202 can acquire data faster than the external storage device 1300. Therefore, the storage device 1202 can acquire the lock on the acquired data at a higher speed than the external storage device 1300. Note that all or part of the database may exist in the external storage device 1300.
  • This embodiment is based on the following way of thinking, for example. That is, when changing one Tx state atomically, no lock is required.
  • the record state and the processing phase for each Tx can be synchronized (that is, the record can be managed for each Tx). Based on these, the state of Tx and the record are associated with each other, and the state of the plurality of records can be immediately changed as Tx intended by manipulating the state of Tx atomically. That is, the speed of visualization of the updated record can be realized.
  • this embodiment will be described in more detail.
  • FIG. 2 is a flowchart of the Tx process.
  • the DBMS 1301 performs Tx overall processing based on a Tx processing command (query) from the user 1000.
  • the DBMS 1301 declares Tx start (S100), performs Tx main processing (for example, a series of processes of reference, update, insertion, and aggregation) based on the Tx processing instruction (S120), and declares Tx end (S190).
  • Tx start S100
  • Tx main processing for example, a series of processes of reference, update, insertion, and aggregation
  • S120 declares Tx end (S190).
  • a lock “reservation” may be acquired by the query execution unit 1313 of the DBMS 1301. It is not always necessary to acquire a lock reservation. Whether or not a lock reservation is acquired is determined by a designated lock method (described later with reference to FIG. 9).
  • FIG. 3 is a flowchart of the end of Tx (S190 in FIG. 2).
  • the Tx end (S190) is a start (S150), a commit determination (S160) for confirming whether the Tx process maintains correct consistency, a persistence process (S170) for perpetuating the result of the Tx process, And end (S180).
  • the “permanent processing” is to transmit data before and after data update as a log to at least one of the storage device 1202, the external storage device 1300, and the different computer system 1110. As a result, data is not lost even when a failure occurs in the current DBMS 1301.
  • FIG. 4 is a flowchart of control related to commit determination (S160 in FIG. 3).
  • the commit determination (S160) starts (S161), the update lock determination for locking the record before the update (S162), and the consistency determination for checking whether the consistency of the Tx main process (S120) is maintained ( S163) and end (S164).
  • the update lock determination (S162) the query execution unit 1313 of the DBMS 1301 determines the lock (the lock is acquired). This is an indispensable process, unlike acquisition of a “reservation” of a lock.
  • the DBMS 1301 performs the Tx process by combining these processes S100, S120, and S190 so as to satisfy the ACID characteristic specified by the user 1000.
  • the Tx process is performed by the query execution unit 1313 of the DBMS 1301.
  • One Tx process is performed for one Tx processing instruction (query). It is also possible to execute a plurality of Tx processes in parallel.
  • One Tx process is performed by, for example, one processor core (or one thread assigned to one processor core).
  • FIG. 5 is a configuration diagram of TxID, record, and index.
  • At least one of the storage device 1202 and the external storage device 1300 stores the TxID 200, the record 250, and the index 450. These are managed by the DBMS 1301. Each of the record 250 and the index 450 is an example of a data area.
  • TxID 200 is a data structure.
  • the TxID 200 is a Tx processing command from the user 1000, Tx information 201 for storing the progress of the Tx processing, a Tx state 202 indicating the state of the Tx processing, and a priority indicating an index group for determining the priority of the Tx processing
  • a degree index group 203 is included.
  • the TxID 200 is generated, for example, when a query plan is generated.
  • Examples of the Tx state 202 include abort, lock, and commit.
  • the value of the Tx state 202 is a value corresponding to the current process among the reference numerals 661 to 666 shown in FIG.
  • the record 250 includes a header 251 having record management information, record data 252, and TxID information 253 and 254 for uniquely identifying the TxID 200.
  • the generated TxID information 253 is TxID 200 of Tx that generated the record 250 or reference information (for example, a pointer) to the TxID 200.
  • the update TxID information 254 is TxID 200 of Tx for updating this record 250 or reference information to the TxID 200.
  • the updated TxID information 254 is updated to the TxID information of the other Tx.
  • the index 450 includes a header 451 having index management information, a key 452 which is a key value of the index, and TxID information 453 and 454 for uniquely specifying the TxID 200, respectively.
  • the generated TxID information 453 is TxID 200 of Tx that generated the index 450 or reference information (for example, a pointer) to the TxID 200.
  • the update TxID 454 is TxID 200 of Tx for updating the index 450 or reference information to the TxID 200.
  • the Tx state 202 of the TxID 200 serves as two or more states of the TxID 200 state, the record 250 state, and the index 450 state. If the Tx state 202 of the TxID 200 indicated by the generated TxID information 253 (453) is a state before “commit”, the record (index) having the generated TxID information 253 (453) is the target Tx (this generated TxID information). Reference from Tx other than Tx) corresponding to TxID200 indicated by H.253 (453) is impossible.
  • Tx state 202 of TxID 200 indicated by the generated TxID information 253 (453) is in a state other than “commit”, the Tx other than the target Tx Can also be referenced.
  • Each of the TxID information 253, 254, 453, and 454 has information such as an address where the corresponding TxID 200 is arranged (for example, an address in the storage device 1202), or a unique ID of the TxID 200, so that the TxID information 253 is obtained.
  • TxID 200 can be specified based on at least one of H.254, 453, and 454.
  • FIG. 6 is a configuration diagram of the priority index group 203.
  • the priority index group 203 is a set of a plurality of indices (items), and each of the plurality of indices is used to determine the priority of Tx.
  • the priority index group 203 is used when an acquisition conflict (lock acquisition conflict) of the record 250 occurs in a plurality of Tx processes.
  • the priority index group 203 includes, for example, a priority (310) indicating the high priority of the Tx process, a retry count (311) that is the number of times that the Tx process has failed due to a record acquisition conflict with another Tx process, Tx
  • the core number (312) of the processor core that executed the process the thread number (313) of the thread that executed the Tx process, the time when the Tx process was started, resumed or designated, or the time (314) indicating the ID unique to the Tx process ), Number of connected records (315) which is the number of records related to TxID, number of reference records (316) which is the number of records referred to in Tx processing, and number of inserted records which is the number of records inserted in Tx processing (317) and the number of updated records (318) that is the number of records updated in the Tx process. At least one of the plurality of indexes included in the priority index group 203 may be omitted or may be another index.
  • FIG. 7 is a diagram showing the relationship between TxID, records, and indexes.
  • the record 250 and the index 450 are associated with the TxID 200.
  • the TxID 200A specified from the TxID information 253 or 254 in each of the records 250A and 250C is associated with the records 250A and 250C
  • the TxID 200A specified from the TxID information 453 or 454 in the index 450 is specified.
  • the TxID 200B specified from the TxID information 253 or 254 in the record 250B is associated with the record 250B.
  • the number of lock acquisitions depends on the number of records (and indexes).
  • FIG. 8 is a configuration diagram of the priority determination method management table.
  • the priority determination method management table 801 is stored in one or more storage devices 1202 (see FIG. 1).
  • the priority determination method management table 801 has a column 500 and columns 501A, 501B,.
  • the indicators (items) 510 to 518 in the column 500 have the same definitions (meaning) as the indicators (items) 310 to 318 in the column 300 shown in FIG.
  • Each of the columns 501A, 501B,... Indicates a priority determination method (hereinafter also referred to as “P method”).
  • P method a priority determination method
  • the number corresponding to the item indicates the weight of the item in the priority determination. The smaller the number, the higher the weight. Therefore, for example, “P method 1” in the column 501A is a method for performing priority determination in the order of priority, time, and core number.
  • the query execution unit 1313 compares priorities 301 of a plurality of TxIDs 200. If all of the priorities 301 are different, the priority determination ends. On the other hand, when the priorities 301 of at least two TxIDs 200 are the same, the query execution unit 1313 compares the times 314 of the at least two TxIDs 200 next. In this way, according to the definition of the adopted P method, the indicators are compared until the same priority does not exist for a plurality of priorities corresponding to a plurality of TxIDs.
  • FIG. 9 is a configuration diagram of the lock method management table.
  • the lock method management table 901 is stored in one or more storage devices 1202 (see FIG. 1).
  • the lock method management table 901 has a column 600 and columns 601A, 601B,.
  • Column 600 shows the states of S100 to S190. That is, the rows 611A, 611B,... Correspond to the states of S100 to S190, respectively.
  • Each of the columns 601A, 601B,... Indicates a lock method (hereinafter also referred to as “L method”).
  • confirmation and connection are performed during the process of the Tx main process (S120).
  • “Confirmation” refers to determining the priority of whether the connection between the TxID 200 and the record 250 is possible. For example, when the first TxID 200A and the second TxID 200B are connected to the record 250A (see, for example, FIG. 7), the query execution unit 1313 performs the priority determination. When the priority of TxID 200A is higher (when TxID 200A wins the priority determination), query execution unit 1313 records information for specifying TxID 200A in TxID information 253 of record 250A. The record of such information is “connection”. That is, the series of processes corresponds to “confirmation” and “connection”.
  • the state transition is performed during the process of Tx termination (S190).
  • “State transition” is to update the Tx state 202 of the TxID 200.
  • the Tx state 202 is updated from the Tx main process (S120) to the Tx end (S190).
  • the state of the plurality of records 250A and 250C and the index 450 connected to the TxID 200A can be changed simultaneously in one process.
  • a plurality of L methods can be generated. Since a desired L method can be specified from a plurality of L methods, lock acquisition according to the lock method according to the attribute of the Tx process (for example, the time length required from the start to the end), the load of the computer system 1100, and the like can be expected.
  • the L method 2 since the priority confirmation determination is not performed, “confirmation” (that is, priority determination) is unnecessary.
  • the L method 2 is selected for Tx processing that is to be preferentially executed. This is because executing the state transition before the start of the Tx main process 611B can prevent the target Tx process from being aborted from another Tx process.
  • FIG. 10 is a schematic explanatory diagram of the locking method.
  • Tx processing N 1, 2, 3
  • the Tx processes 1 to 3 proceed as time (t) elapses.
  • states 661 to 666 are shown as examples of states.
  • the priority determination may be performed only for a state in which the Tx processes are the same or a Tx process having a lower comparison target. Specifically, for example, when the designated (selected) L method indicates a procedure including “confirmation”, the priority determination is performed based on whether the Tx process has the same progress state or the comparison target. It is performed only for the lower Tx process, and the comparison target may not be performed for the upper Tx process. As a result, it is possible to avoid that the upper Tx process is aborted by the lower Tx process and cannot be committed. “Lower” means that the current progress state is reached by the end of Tx, for example, Tx1 and Tx3 viewed from Tx2.
  • “upper” means that the state is in a new progress state due to the end of Tx, for example, Tx2 viewed from Tx3. For example, if the comparison target is the upper Tx process 3, even if the priority of the lower Tx process 1 is high, the lower Tx process 1 is lost in the priority determination.
  • FIG. 11 is a configuration diagram of an example of a Tx instruction.
  • the Tx processing command 700 is a command issued by the computer system 1110 operated by the user 1000 to the DBMS 1301 executed by the computer system 1100.
  • the Tx processing instruction 700 includes an instruction body 701.
  • the instruction body 701 shows details of Tx processing.
  • the Tx processing instruction 700 may include at least one of the P method 702 and the L method 703.
  • the P method 702 indicates a priority determination method designated by the user 1000 (or an application program executed by the computer system 1110)
  • the L method 703 is determined by the user 1000 (or an application program executed by the computer system 1110).
  • the designation is performed by the Tx processing instruction 700. Therefore, it is not necessary to perform an operation different from the issuance of the Tx processing instruction 700.
  • the DBMS 1301 executes the processing described with reference to FIGS. 2 to 4 based on the Tx processing instruction 700.
  • the association between the TxID and the record is controlled based on the relationship between the Tx processes (same state, lower level or higher level) and the designated P mode and L mode.
  • FIG. 12 is a configuration diagram of an example of the method selection management table.
  • the method selection management table 1201 is stored in one or more storage devices 1202 (see FIG. 1).
  • the designated P method and L method are registered for each of the application ranges 811A, 811B,.
  • Scope of application includes “user”, “database” and “Tx”. That is, a set of P method and L method can be specified in units of each user, each database, and each Tx.
  • the Tx processing according to the Tx processing instruction from the user always specifies the user regardless of the database to be processed and the Tx to be executed.
  • Tx processing is performed on the basis of the completed P method and L method.
  • different P methods and different L methods can coexist for one database.
  • the index for comparison is specified by referring to the priority determination method management table 801 using the designated P method as a key, and the lock method management table using the designated L method as a key.
  • the lock acquisition procedure is specified.
  • Tx processing for that database is always specified for that database regardless of the user who issued the Tx processing command or Tx to be executed. Tx processing is performed on the basis of the completed P method and L method.
  • the Tx processing is performed based on the specified P method and L method. Even in this case, different P methods and different L methods can coexist for one database.
  • the specification of the P method and the L method in Tx units is dynamically performed (for example, specified in the Tx processing instruction), and the specification of the P method and the L method in any unit of the user and the database is static. (For example, registered in the method selection management table 1201 in advance). If a dynamic designation is made although a static designation is made, the dynamic designation may always be adopted by the query execution unit 1313, or the dynamic designation and the static designation may be adopted. The query execution unit 1313 may determine which of the dynamic designation and the static designation is adopted based on a policy for determining which one is to be adopted.
  • the P method and the L method may be created and specified based on a predetermined standard.
  • Tx processing with many references specifically, a Tx process performed in accordance with a Tx process instruction 700 that meets a condition that there are many references (a condition defined in advance).
  • the following processing may be performed by the DBMS 1301 (for example, the query execution unit 1313). That is, a setting may be made so that the number of reference records per unit time is maximized.
  • a P method a P method in which 1: time, 2: reference record number, 3: core number, and 4: thread number are set in descending order of weight may be specified.
  • L method 1 (see FIG. 9) may be designated as the L method. This is because priority determination can be performed (for example, when “L method 2” is selected, another Tx process is forcibly aborted (so-called first come first served), and priority determination is performed. Not) According to the index “number of reference records”, the TxID having the larger number of reference records 316 (see FIG. 6) wins the priority determination.
  • Tx processing with many updates specifically, Tx processing (typically committing many updates) performed in accordance with a Tx processing instruction 700 that conforms to a condition with many updates (predefined conditions).
  • Tx processing with many updates is detected by the DBMS 1301 (for example, the query execution unit 1313)
  • the following processing may be performed by the DBMS 1301 (for example, the query execution unit 1313). That is, a setting that maximizes the number of updates and inserted records per unit time may be performed.
  • a P method in which 1: time, 2: update record number, 3: insert record number, 4: core number, and 5: thread number may be specified in descending order of weight.
  • the combination of the core number and the thread number is a set for making the priority unique, and can be substituted if there is another index for making the priority unique.
  • L method 1 (see FIG. 9) may be designated as the L method. This is because priority determination can be performed.
  • the TxID having the larger number of reference records wins the priority determination.
  • the TxID with the larger number of update records 318 (see FIG. 6) wins the priority determination.
  • Tx processing with many insertions for example, as a P method, 1: time, 2: number of inserted records, 3: number of updated records, 4: core number, and 5: thread number are set in descending order of weight.
  • the P method may be specified.
  • the association between Tx and record is changed based on the result of the priority determination.
  • high-speed lock detection can be realized. That is, in general, the lock determination is performed in S162, but in this embodiment, it is determined at the time of S120 whether or not there is a possibility that a lock can be acquired by the lock reservation that can be performed in the Tx main process of S120. it can.
  • deadlock since there is no overlap among the plurality of priorities corresponding to the plurality of TxIDs (since the priorities are uniquely set), deadlock can be avoided.
  • TxID200F TxID200F
  • the query receiving unit 1311 receives the Tx processing instruction 700 (query). Thereby, Tx processing is started (S100).
  • the query plan generation unit 1312 generates a query plan based on the Tx processing instruction 700, and at that time, generates a TxID (structure) 200 (hereinafter, 200F).
  • the query execution unit 1313 uses the TxID 200F based on the query plan, and executes the processes of FIGS. 2 to 4 according to the TxID 200F.
  • the query execution unit 1313 determines whether the state of TxID 200 (hereinafter, 200T) of the connection destination (update TxID information 254) of the target record is the same as TxID 200F or whether TxID 200T is lower than TxID 200F.
  • the query execution unit 1313 determines whether the TxID 200F and TxID 200T are in accordance with the P method specified for the TxID 200F (for example, the P method specified for each user, each database, or each Tx). Priority determination of which priority is higher is performed. When TxID 200F wins in the priority determination, the query execution unit 1313 acquires a lock according to the L method specified for TxID 200F (for example, the L method specified for each user, each database, or each Tx) ( Get lock reservation).
  • the L method specified for TxID 200F for example, the L method specified for each user, each database, or each Tx
  • the query execution unit 1313 changes the Tx state 202 of the TxID 200T lost in the priority determination to “Abort”, and uses the updated TxID information 254 in the target record as information for specifying the TxID 200F. Update.
  • the process from the start of the Tx process to this step is the Tx main process (S120).
  • the query execution unit 1313 proceeds to the update lock determination (S162 in FIG. 4).
  • the Tx state 202 of the TxID 200F is changed to “update lock determination 663”. If the Tx state 202 of the TxID 200F is “Abort”, the query execution unit 1313 performs an abort process.
  • the query execution unit 1313 performs consistency determination (S163 in FIG. 4). If the result of the consistency determination (S163) is positive, the query execution unit 1313 changes the Tx state 202 of the TxID 200F to “consistency determination 664”. If the Tx state 202 of the TxID 200F is “Abort”, the query execution unit 1313 performs an abort process.
  • the commit determination including S162 and S163 ends, and then the query execution unit 1313 performs a persistence process (S170 in FIG. 3). After confirming that the log has been made permanent, the query execution unit 1313 changes the Tx state 202 of the TxID 200F to “permanent processing 665”.
  • the query execution unit 1313 performs Tx termination (S190 in FIG. 2) of Tx corresponding to TxID 200F.
  • the query execution unit 1313 changes the Tx state 202 of the TxID 200F to “Tx end 666 (commit)”.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

This computer system receives a transaction processing instruction for updating one or more data regions of a plurality of data regions, and generates, on the basis of the transaction processing instruction, a data structure including Tx states, which are transaction processing states assumed according to the transaction processing instruction. The computer system then associates each of the one or more data regions, which are to be updated through transaction processing, with the data structure. The computer system then performs transaction processing on the basis of the data structure.

Description

データベース管理システム、計算機システム及びデータベース管理方法Database management system, computer system, and database management method
 本発明は、概して、トランザクション処理に関し、例えば、データベースの一貫性制御技術に関する。 The present invention generally relates to transaction processing, for example, database consistency control technology.
 トランザクションの処理は、一般に、計算機システムにおいて行われる。トランザクションを処理するシステムとして、具体的には、例えば、DBMS(データベースマネージメントシステム)が知られている。DBMSは、入出力するデータであるレコードの一貫性を制御する。これにより、ユーザは常に意図したレコードを入出力することが可能となる。このようなDBMSの一貫性制御を、一般に、Tx(トランザクション)処理と呼ぶ。Tx処理は、複数の参照、更新命令をアトミックに実現するときに用いられる。Tx処理では、アトミックに実行したい命令区間の始めと終わり(Tx処理区間)を宣言することにより、指定した区間の複数の命令をアトミックに処理する。 Transaction processing is generally performed in a computer system. Specifically, for example, a DBMS (database management system) is known as a system for processing transactions. The DBMS controls the consistency of records that are input and output data. As a result, the user can always input / output the intended record. Such DBMS consistency control is generally referred to as Tx (transaction) processing. The Tx process is used when a plurality of reference and update instructions are realized atomically. In Tx processing, a plurality of instructions in a specified section are processed atomically by declaring the beginning and end of the instruction section to be executed atomically (Tx processing section).
 Tx処理を実現するためには、ACID特性を満たす必要がある。ACID特性とは、原子性(Atomicity)、一貫性(Consistency)、独立性(Isolation)及び永続性(Durability)を示す。原子性とは、Tx処理区間の複数の命令を全て実行するか、全て実行させないことである。一貫性とは、データベースに与えられたルール以外の状態に遷移させないことである。独立性とは、Tx処理の結果は、必ずTx処理を逐次的に実行したときと同じになることをいう。永続性とは、Tx処理がコミットしていれば、DBMSに故障が発生していても必ずTx処理の結果を復元できることをいう。このように、DBMSでは、ACID特性を満たすことによって、Tx処理の一貫性を維持している。 To realize Tx processing, it is necessary to satisfy ACID characteristics. The ACID property indicates atomicity, consistency, isolation, and durability. Atomicity means that a plurality of instructions in the Tx processing section are all executed or not executed at all. Consistency means not making a transition to a state other than the rules given to the database. Independence means that the result of Tx processing is always the same as when Tx processing is executed sequentially. Persistence means that if the Tx process is committed, the result of the Tx process can always be restored even if a failure occurs in the DBMS. As described above, the DBMS maintains the consistency of the Tx processing by satisfying the ACID characteristic.
 しかし、高度な一貫性制御により、DBMSの処理能力が低下する課題がある。例えば、独立性を維持するためのロック機構、永続性を維持するためのログ機構が処理能力低下の原因となる。 However, there is a problem that the processing capacity of the DBMS decreases due to the high consistency control. For example, a lock mechanism for maintaining independence and a log mechanism for maintaining persistence cause a reduction in processing capability.
 ロック機構の課題に対し、特許文献1では、レコードの更新前後の状態をスイッチによって管理する。これにより、レコードの更新前後の状態を少ない処理数で変更できる。また、非特許文献1によれば、レコードの可視/不可視を時間で管理することによって、参照ロックと更新ロックの2種類あるロックのうち、参照ロックを不要にすることができる。特許文献2では、ロックフリーなデータベース管理方法を提供することによって、処理の高速化を実現している。 For the problem of the lock mechanism, in Patent Document 1, the state before and after the record update is managed by a switch. Thereby, the state before and after the update of the record can be changed with a small number of processes. Further, according to Non-Patent Document 1, it is possible to make a reference lock unnecessary among two types of locks, that is, a reference lock and an update lock, by managing the visibility of records in time. In Patent Document 2, the processing speed is increased by providing a lock-free database management method.
 ログ機構の課題に対し、特許文献3によれば、コミット前の未コミットな状態を定義することにより、未コミットな結果を参照することが可能となる。これにより、Tx1のログ処理の完了を待つことなく、Tx2がTx1のコミット結果を参照することができ、ログ処理を隠蔽することができる。 For the problem of the log mechanism, according to Patent Document 3, it is possible to refer to an uncommitted result by defining an uncommitted state before committing. Thus, Tx2 can refer to the commit result of Tx1 without waiting for the completion of the log process of Tx1, and the log process can be concealed.
特許第4027055号Patent No. 4027055 US2011/0252000US2011 / 0252000 US8,407,195US8,407,195
 特許文献1、2、非特許文献1に開示の技術によって、参照ロックや更新ロックの課題を改善することが期待できる。ただし、特許文献3のような新たな状態が加わることによって、参照ロックや更新ロックの課題が複雑になる。このため、複数の状態を効率良く管理する新たなロック機構が必要となる。 The techniques disclosed in Patent Documents 1 and 2 and Non-Patent Document 1 can be expected to improve the problem of reference lock and update lock. However, the addition of a new state as in Patent Document 3 complicates the problem of reference lock and update lock. For this reason, a new lock mechanism for efficiently managing a plurality of states is required.
 上記に限らず、更新後のレコードを高速に可視化(参照可能な状態)にすることが望ましい。一般に、レコード毎にロックが取得されるようになっており、複数のレコードが更新される場合、それら複数のレコードの全てのロックの解放後に更新後の各レコードが可視化される。 Not limited to the above, it is desirable to visualize the updated record at high speed (in a referable state). Generally, a lock is acquired for each record, and when a plurality of records are updated, each updated record is visualized after releasing all locks of the plurality of records.
 上述のような課題は、DBMSに限らず、データ領域をトランザクション処理において更新する他の計算機システムにも有り得る。 The above-described problems are not limited to DBMS, but may be present in other computer systems that update data areas in transaction processing.
 本発明の目的は、更新後のデータ領域を高速に可視化することにある。 An object of the present invention is to visualize the updated data area at high speed.
 計算機システムは、複数のデータ領域のうちの1以上のデータ領域を更新するトランザクション処理命令を受け付け、そのトランザクション処理命令に従うトランザクション処理の状態であるTx状態を含んだデータ構造体をそのトランザクション処理命令に基づき生成する。計算機システムは、トランザクション処理により更新される1以上のデータ領域の各々をデータ構造体に関連付ける。計算機システムは、データ構造体を基にトランザクション処理を実行する。 The computer system receives a transaction processing instruction for updating one or more data areas of a plurality of data areas, and uses a data structure including a Tx state, which is a transaction processing state according to the transaction processing instruction, as the transaction processing instruction. Generate based on. The computer system associates each of one or more data areas updated by transaction processing with a data structure. The computer system executes transaction processing based on the data structure.
 更新後のデータ領域を高速に可視化できる。 ・ The updated data area can be visualized at high speed.
一実施形態に係るシステムの全体概要の機能ブロック図である。It is a functional block diagram of the whole system outline concerning one embodiment. Tx全体処理のフローチャートである。It is a flowchart of a Tx whole process. Tx終了のフローチャートである。It is a flowchart of Tx end. コミット判定のフローチャートである。It is a flowchart of a commit determination. TxID、レコード及びインデックスの構成図である。It is a block diagram of TxID, a record, and an index. 優先度の構成図である。It is a block diagram of a priority. TxIDとレコード及びインデックスとの関係を示す図である。It is a figure which shows the relationship between TxID, a record, and an index. 優先度判定方式管理テーブルの構成図である。It is a block diagram of a priority determination system management table. ロック方式管理テーブルの構成図である。It is a block diagram of a locking system management table. ロック方式の概要説明図である。It is an outline explanatory view of a lock system. Tx命令の一例の構成図である。It is a block diagram of an example of a Tx instruction. 方式選択管理テーブルの一例の構成図である。It is a block diagram of an example of a system selection management table. DBMSの構成図である。It is a block diagram of DBMS.
 以下、図面を参照して、本発明の一実施形態が適用されたDBMSを実行する計算機システムを説明する。 Hereinafter, a computer system that executes a DBMS to which an embodiment of the present invention is applied will be described with reference to the drawings.
 また、以下の説明では、「×××テーブル」の表現にて情報を説明することがあるが、情報は、どのようなデータ構造で表現されていてもよい。すなわち、情報がデータ構造に依存しないことを示すために、「×××テーブル」を「×××情報」と呼ぶことができる。 In the following description, information may be described using the expression “xxx table”, but the information may be expressed in any data structure. That is, “xxx table” can be referred to as “xxx information” to indicate that the information does not depend on the data structure.
 また、以下の説明では、プログラムを実行することにより構成される機能部を主語として処理を説明する場合があるが、プログラムは、プロセッサ(例えばCPU(Central Processing Unit))によって実行されることで、定められた処理を、適宜に記憶資源(例えばメモリ)及び/又は通信インタフェイスを用いながら行うため、処理の主語がプロセッサとされてもよい。機能部を主語として説明された処理は、プロセッサを含む装置が行う処理としてもよい。また、プロセッサが、処理の一部又は全部を行うハードウェア回路を含んでもよい。コンピュータプログラムは、プログラムソースから装置にインストールされてもよい。プログラムソースは、例えば、プログラム配布サーバ、又は、計算機が読み取り可能な記憶メディアであってもよい。 Further, in the following description, there is a case where the processing is described by using a functional unit configured by executing the program as a subject, but the program is executed by a processor (for example, a CPU (Central Processing Unit)), The subject of the process may be a processor in order to perform the determined process appropriately using a storage resource (for example, memory) and / or a communication interface. The processing described with the functional unit as the subject may be processing performed by an apparatus including a processor. The processor may include a hardware circuit that performs part or all of the processing. The computer program may be installed on the device from a program source. The program source may be, for example, a program distribution server or a storage medium that can be read by a computer.
 また、以下の説明では、同一の要素を区別して説明する場合、参照符号の全体を使用するが(例えば、TxID200A)、同一の要素を区別しないで説明する場合、参照符号のうちの共通符号のみを使用する(例えば、TxID200)ことがある。 Further, in the following description, when the same element is described separately, the entire reference code is used (for example, TxID200A), but when the same element is described without being distinguished, only the common code among the reference codes is used. (For example, TxID200).
 図1は、実施形態に係るシステムの全体概要の機能ブロック図である。 FIG. 1 is a functional block diagram of the overall outline of the system according to the embodiment.
 ユーザ1000は、計算機システム(例えばパーソナルコンピュータ)1110からネットワーク1400を通じて、計算機システム(例えば複数のノード1200により実現される大規模計算機システム)1100にアクセスすることによって、計算機システム1100に命令を送ることができる。ユーザ1000は、計算機システム1100を直接操作することも可能である。 The user 1000 sends an instruction to the computer system 1100 by accessing the computer system (for example, a large-scale computer system realized by a plurality of nodes 1200) 1100 from the computer system (for example, personal computer) 1110 through the network 1400. it can. The user 1000 can also directly operate the computer system 1100.
 計算機システム1100は、1以上のノード1200を有する。ノード1200は、計算機の一例である。ノード1200間が、システムバス1101によって接続されていてもよい。ノード1200は、記憶装置1202、入出力装置1203及びそれらに接続されたプロセッサ1201を有する。記憶装置1202は、主記憶装置(例えばDRAM(Dynamic Random Access Memory)及び補助記憶装置のうちの少なくとも主記憶装置を含む。入出力装置1203は、通信インタフェイス装置でもよいし、マンマシンインタフェイス装置(例えば、キーボード及びポインティングデバイスのような入力装置と表示装置のような出力装置)でもよい。また、計算機システム1100の外部に、ネットワーク1400経由で通信可能な外部記憶装置1300があってもよい。 The computer system 1100 has one or more nodes 1200. The node 1200 is an example of a computer. The nodes 1200 may be connected by a system bus 1101. The node 1200 includes a storage device 1202, an input / output device 1203, and a processor 1201 connected to them. The storage device 1202 includes a main storage device (for example, a DRAM (Dynamic Random Access Memory) and at least a main storage device) .The input / output device 1203 may be a communication interface device or a man-machine interface device. (For example, an input device such as a keyboard and a pointing device and an output device such as a display device.) Further, an external storage device 1300 capable of communicating via the network 1400 may be provided outside the computer system 1100.
 DBMSは、1以上のノード1200(1以上のプロセッサ1201)で実行されてよい。例えば、図13に示すように、DBMS1301は、クエリを受け付けるクエリ受付部1311と、そのクエリの実行プランであるクエリプランを生成するクエリプラン生成部1312と、そのクエリプランに従いクエリを実行するクエリ実行部1313とを有する。Tx処理で実行されるTxは、クエリプランに従う1つのクエリのTxに対応する。つまり、本実施形態では、1つのクエリ(1つのクエリプラン)に対して1つのTxID(トランザクションID)がクエリ実行部1313により割り振られる。これらの機能部1311、1312及び1313のうちの少なくとも2つが統合されてもよいし、これらの機能部1311、1312及び1313のうちの少なくとも1つが細分化されてもよい。これらの機能部1311、1312及び1313は、DBMS1301が1以上のプロセッサ1201に実行されることにより実現される。 The DBMS may be executed by one or more nodes 1200 (one or more processors 1201). For example, as illustrated in FIG. 13, the DBMS 1301 includes a query reception unit 1311 that receives a query, a query plan generation unit 1312 that generates a query plan that is an execution plan of the query, and a query execution that executes a query according to the query plan. Part 1313. Tx executed in the Tx process corresponds to Tx of one query according to the query plan. That is, in this embodiment, one TxID (transaction ID) is allocated by the query execution unit 1313 for one query (one query plan). At least two of these functional units 1311, 1312, and 1313 may be integrated, or at least one of these functional units 1311, 1312, and 1313 may be subdivided. These functional units 1311, 1312, and 1313 are realized by executing the DBMS 1301 by one or more processors 1201.
 DBMS1301によって参照又は更新等されるデータベースは、1以上の記憶装置1202に存在する。本実施形態では、いわゆるインメモリデータベースが実現される。外部記憶装置1300より記憶装置1202の方が、高速にデータを取得することができる。
よって、外部記憶装置1300より記憶装置1202の方が、取得したデータに対して高速にロックを取得することができる。なお、データベースの全部又は一部が、外部記憶装置1300に存在してもよい。
A database referenced or updated by the DBMS 1301 exists in one or more storage devices 1202. In the present embodiment, a so-called in-memory database is realized. The storage device 1202 can acquire data faster than the external storage device 1300.
Therefore, the storage device 1202 can acquire the lock on the acquired data at a higher speed than the external storage device 1300. Note that all or part of the database may exist in the external storage device 1300.
 本実施形態は、例えば以下の考え方に基づいている。すなわち、1つのTx状態をアトミックに変更する場合、ロックは不要である。また、レコードの状態と、Tx毎の処理フェーズは同期可能である(つまり、Tx毎にレコードを管理可能である)。これらを基に、Txの状態とレコードとを関連付け、Txの状態をアトミックに操作することで、複数のレコードの状態をTxが意図したように即座に変更できる。つまり、更新後レコードの可視化の高速化を実現できる。以下、本実施形態をより詳細に説明する。 This embodiment is based on the following way of thinking, for example. That is, when changing one Tx state atomically, no lock is required. The record state and the processing phase for each Tx can be synchronized (that is, the record can be managed for each Tx). Based on these, the state of Tx and the record are associated with each other, and the state of the plurality of records can be immediately changed as Tx intended by manipulating the state of Tx atomically. That is, the speed of visualization of the updated record can be realized. Hereinafter, this embodiment will be described in more detail.
 図2は、Tx処理のフローチャートである。 FIG. 2 is a flowchart of the Tx process.
 DBMS1301は、ユーザ1000からのTx処理命令(クエリ)に基づいてTx全体処理を行う。DBMS1301は、Tx開始(S100)を宣言して、Tx処理命令に基づくTxメイン処理(例えば、参照、更新、挿入及び集計の一連の処理)を行い(S120)、Tx終了を宣言する(S190)。なお、S120のTxメイン処理において、更新又は削除の処理の場合、DBMS1301のクエリ実行部1313により、ロックの「予約」の取得が行われることがある。ロックの予約の取得は、必ずしも必要としない。ロックの予約の取得が行われるか否かは、指定されているロック方式により決まる(後に図9を参照して説明)。 The DBMS 1301 performs Tx overall processing based on a Tx processing command (query) from the user 1000. The DBMS 1301 declares Tx start (S100), performs Tx main processing (for example, a series of processes of reference, update, insertion, and aggregation) based on the Tx processing instruction (S120), and declares Tx end (S190). . In the Tx main process of S120, in the case of an update or deletion process, a lock “reservation” may be acquired by the query execution unit 1313 of the DBMS 1301. It is not always necessary to acquire a lock reservation. Whether or not a lock reservation is acquired is determined by a designated lock method (described later with reference to FIG. 9).
 図3は、Tx終了(図2のS190)のフローチャートである。 FIG. 3 is a flowchart of the end of Tx (S190 in FIG. 2).
 Tx終了(S190)は、開始(S150)、Tx処理が正しい整合性を保持しているかの確認であるコミット判定(S160)、Tx処理の結果を永続化させるための永続化処理(S170)、及び終了(S180)から成る。なお、「永続化処理」とは、データの更新前後をログとして、記憶装置1202、外部記憶装置1300、及び、異なる計算機システム1110のうちの少なくとも1つに送信することである。これにより、現行のDBMS1301で障害が発生した際にもデータを失わずに済む。 The Tx end (S190) is a start (S150), a commit determination (S160) for confirming whether the Tx process maintains correct consistency, a persistence process (S170) for perpetuating the result of the Tx process, And end (S180). The “permanent processing” is to transmit data before and after data update as a log to at least one of the storage device 1202, the external storage device 1300, and the different computer system 1110. As a result, data is not lost even when a failure occurs in the current DBMS 1301.
 図4は、コミット判定(図3のS160)に関する制御のフローチャートである。 FIG. 4 is a flowchart of control related to commit determination (S160 in FIG. 3).
 コミット判定(S160)は、開始(S161)、更新前のレコードをロックするための更新ロック判定(S162)、Txメイン処理(S120)の整合性を保持できているか確認するための整合性判定(S163)、及び終了(S164)から成る。なお、更新ロック判定(S162)において、DBMS1301のクエリ実行部1313により、ロックが確定する(ロックが取得される)。これは、ロックの「予約」の取得と異なり、必須の処理である。 The commit determination (S160) starts (S161), the update lock determination for locking the record before the update (S162), and the consistency determination for checking whether the consistency of the Tx main process (S120) is maintained ( S163) and end (S164). In the update lock determination (S162), the query execution unit 1313 of the DBMS 1301 determines the lock (the lock is acquired). This is an indispensable process, unlike acquisition of a “reservation” of a lock.
 DBMS1301は、ユーザ1000が指示するACID特性を満たすように、これらの処理S100、S120及びS190を組み合わせて、Tx処理を行う。Tx処理は、DBMS1301のクエリ実行部1313により行われる。1つのTx処理命令(クエリ)につき、1つのTx処理が行われる。複数のTx処理を並行して実行することも可能である。1つのTx処理は、例えば、1つのプロセッサコア(又は、1つのプロセッサコアに割り当てられた1つのスレッド)により行われる。 The DBMS 1301 performs the Tx process by combining these processes S100, S120, and S190 so as to satisfy the ACID characteristic specified by the user 1000. The Tx process is performed by the query execution unit 1313 of the DBMS 1301. One Tx process is performed for one Tx processing instruction (query). It is also possible to execute a plurality of Tx processes in parallel. One Tx process is performed by, for example, one processor core (or one thread assigned to one processor core).
 図5は、TxID、レコード及びインデックスの構成図である。 FIG. 5 is a configuration diagram of TxID, record, and index.
 記憶装置1202及び外部記憶装置1300の少なくとも1つが、TxID200、レコード250及びインデックス450を記憶する。これらはDBMS1301により管理される。レコード250及びインデックス450は、それぞれ、データ領域の一例である。 At least one of the storage device 1202 and the external storage device 1300 stores the TxID 200, the record 250, and the index 450. These are managed by the DBMS 1301. Each of the record 250 and the index 450 is an example of a data area.
 TxID200は、データ構造体である。TxID200は、ユーザ1000からのTx処理命令やTx処理の途中経過を記憶するTx情報201、Tx処理の状態を示すTx状態202、及び、Tx処理の優先度を決定するための指標群を示す優先度指標群203を含む。TxID200は、例えばクエリプラン生成時に生成される。Tx状態202として、例えば、アボート、ロック、及びコミット等がある。Tx状態202の値は、図10に示す参照符号661~666のうちの現行の処理と対応した値となる。 TxID 200 is a data structure. The TxID 200 is a Tx processing command from the user 1000, Tx information 201 for storing the progress of the Tx processing, a Tx state 202 indicating the state of the Tx processing, and a priority indicating an index group for determining the priority of the Tx processing A degree index group 203 is included. The TxID 200 is generated, for example, when a query plan is generated. Examples of the Tx state 202 include abort, lock, and commit. The value of the Tx state 202 is a value corresponding to the current process among the reference numerals 661 to 666 shown in FIG.
 レコード250は、レコードの管理情報を有するヘッダー251、レコードのデータであるデータ252、及び、それぞれTxID200を一意に特定するためのTxID情報253及び254を有する。生成TxID情報253は、このレコード250を生成したTxのTxID200又はそのTxID200への参照情報(例えばポインタ)である。更新TxID情報254は、このレコード250を更新するTxのTxID200又はそのTxID200への参照情報である。このレコード250を更新するTxが別のTxに変わる場合、更新TxID情報254が、その別のTxのTxID情報に更新される。 The record 250 includes a header 251 having record management information, record data 252, and TxID information 253 and 254 for uniquely identifying the TxID 200. The generated TxID information 253 is TxID 200 of Tx that generated the record 250 or reference information (for example, a pointer) to the TxID 200. The update TxID information 254 is TxID 200 of Tx for updating this record 250 or reference information to the TxID 200. When the Tx for updating the record 250 changes to another Tx, the updated TxID information 254 is updated to the TxID information of the other Tx.
 インデックス450は、インデックスの管理情報を有するヘッダー451、インデックスのキー値であるキー452、及び、それぞれTxID200を一意に特定するためのTxID情報453及び454を有する。生成TxID情報453は、このインデックス450を生成したTxのTxID200又はそのTxID200への参照情報(例えばポインタ)である。更新TxID454は、このインデックス450を更新するTxのTxID200又はそのTxID200への参照情報である。 The index 450 includes a header 451 having index management information, a key 452 which is a key value of the index, and TxID information 453 and 454 for uniquely specifying the TxID 200, respectively. The generated TxID information 453 is TxID 200 of Tx that generated the index 450 or reference information (for example, a pointer) to the TxID 200. The update TxID 454 is TxID 200 of Tx for updating the index 450 or reference information to the TxID 200.
 TxID200のTx状態202は、TxID200の状態とレコード250の状態とインデックス450の状態の2つ以上の状態を兼ねている。生成TxID情報253(453)が示すTxID200のTx状態202が「コミット」より前の状態であるならば、この生成TxID情報253(453)を有するレコード(インデックス)は、対象Tx(この生成TxID情報253(453)が示すTxID200に対応したTx)以外のTxから参照不可能である。但し、整合性の保証レベル(分離レベル)やTxの投機実行によっては、生成TxID情報253(453)が示すTxID200のTx状態202が「コミット」以外の状態の場合でも、対象Tx以外のTxからも参照可能となる。 The Tx state 202 of the TxID 200 serves as two or more states of the TxID 200 state, the record 250 state, and the index 450 state. If the Tx state 202 of the TxID 200 indicated by the generated TxID information 253 (453) is a state before “commit”, the record (index) having the generated TxID information 253 (453) is the target Tx (this generated TxID information). Reference from Tx other than Tx) corresponding to TxID200 indicated by H.253 (453) is impossible. However, depending on the consistency guarantee level (separation level) and speculative execution of Tx, even if the Tx state 202 of TxID 200 indicated by the generated TxID information 253 (453) is in a state other than “commit”, the Tx other than the target Tx Can also be referenced.
 TxID情報253、254、453及び454の各々は、対応するTxID200が配置されているアドレス(例えば記憶装置1202におけるアドレス)、又は、TxID200のユニークなIDのような情報を持つことで、TxID情報253、254、453及び454のうちの少なくとも1つを基にTxID200を特定できる。 Each of the TxID information 253, 254, 453, and 454 has information such as an address where the corresponding TxID 200 is arranged (for example, an address in the storage device 1202), or a unique ID of the TxID 200, so that the TxID information 253 is obtained. TxID 200 can be specified based on at least one of H.254, 453, and 454.
 図6は、優先度指標群203の構成図である。 FIG. 6 is a configuration diagram of the priority index group 203.
 優先度指標群203は、複数の指標(項目)の集合であり、それら複数の指標の各々は、Txの優先度を決定するために使用される。優先度指標群203は、複数のTx処理でレコード250の取得競合(ロック取得の競合)が発生した際に用いられる。優先度指標群203は、例えば、Tx処理の優先順位の高さを示す優先順位(310)、Tx処理が別のTx処理とのレコード取得競合によって失敗した回数であるリトライ回数(311)、Tx処理を実行したプロセッサコアのコア番号(312)、Tx処理を実行したスレッドのスレッド番号(313)、Tx処理を開始、再開、又は指定した時間、又は、Tx処理固有のIDを示す時間(314)、TxIDに関連しているレコードの数である接続レコード数(315)、Tx処理において参照したレコードの数である参照レコード数(316)、Tx処理において挿入したレコードの数である挿入レコード数(317)、及び、Tx処理において更新したレコードの数である更新レコード数(318)を含む。優先度指標群203が有する複数の指標のうちの少なくとも1つは、無くてもよいし、別の指標であってもよい。 The priority index group 203 is a set of a plurality of indices (items), and each of the plurality of indices is used to determine the priority of Tx. The priority index group 203 is used when an acquisition conflict (lock acquisition conflict) of the record 250 occurs in a plurality of Tx processes. The priority index group 203 includes, for example, a priority (310) indicating the high priority of the Tx process, a retry count (311) that is the number of times that the Tx process has failed due to a record acquisition conflict with another Tx process, Tx The core number (312) of the processor core that executed the process, the thread number (313) of the thread that executed the Tx process, the time when the Tx process was started, resumed or designated, or the time (314) indicating the ID unique to the Tx process ), Number of connected records (315) which is the number of records related to TxID, number of reference records (316) which is the number of records referred to in Tx processing, and number of inserted records which is the number of records inserted in Tx processing (317) and the number of updated records (318) that is the number of records updated in the Tx process. At least one of the plurality of indexes included in the priority index group 203 may be omitted or may be another index.
 図7は、TxIDとレコード及びインデックスとの関係を示す図である。 FIG. 7 is a diagram showing the relationship between TxID, records, and indexes.
 TxID200に、レコード250及びインデックス450が関連付けられる。具体的には、例えば、レコード250A及び250Cの各々におけるTxID情報253又は254から特定されるTxID200Aが、それらレコード250A及び250Cに関連付けられ、インデックス450内のTxID情報453又は454から特定されるTxID200Aが、そのインデックス450に関連付けられる。また、例えば、レコード250BにおけるTxID情報253又は254から特定されるTxID200Bが、そのレコード250Bに関連付けられる。一般に、Tx処理により更新される複数のレコード(及びインデックス)の各々についてロックが取得されるので、ロックの取得回数(演算回数)がレコード(及びインデックス)の数に依存するが、本実施形態では、1つのTxID200内のTx状態202を更新することで、その1つのTxID200に関連付けられている複数(又は1つ)のレコード(インデックス)のロックが取得される。これにより、必要な演算回数を減らすことができる。 The record 250 and the index 450 are associated with the TxID 200. Specifically, for example, the TxID 200A specified from the TxID information 253 or 254 in each of the records 250A and 250C is associated with the records 250A and 250C, and the TxID 200A specified from the TxID information 453 or 454 in the index 450 is specified. , Associated with the index 450. Further, for example, the TxID 200B specified from the TxID information 253 or 254 in the record 250B is associated with the record 250B. Generally, since a lock is acquired for each of a plurality of records (and indexes) updated by Tx processing, the number of lock acquisitions (number of operations) depends on the number of records (and indexes). By updating the Tx state 202 in one TxID 200, a lock of a plurality (or one) record (index) associated with the one TxID 200 is acquired. Thereby, the required number of calculations can be reduced.
 図8は、優先度判定方式管理テーブルの構成図である。 FIG. 8 is a configuration diagram of the priority determination method management table.
 優先度判定方式管理テーブル801は、1以上の記憶装置1202(図1参照)に記憶される。優先度判定方式管理テーブル801は、列500と列501A、501B、…とを有する。列500中の指標(項目)510~518は、図6に示した列300中の指標(項目)310~318とそれぞれ定義(意味)は同一である。 The priority determination method management table 801 is stored in one or more storage devices 1202 (see FIG. 1). The priority determination method management table 801 has a column 500 and columns 501A, 501B,. The indicators (items) 510 to 518 in the column 500 have the same definitions (meaning) as the indicators (items) 310 to 318 in the column 300 shown in FIG.
 列501A、501B、…の各々は、優先度判定方式(以下、「P方式」と言うことがある)を示す。列501A、501B、…の各々において、項目に対応した数字は、優先度判定における項目の重みを示す。数字が小さい程、重みが高い。従って、例えば、列501Aの「P方式1」は、優先順位、時間、コア番号の順に優先度判定を実施する方式である。複数のTxID(Tx処理)に対応した複数の優先度が全て異なった場合、言い換えれば、複数のTxIDに対応した複数の優先度に同じ優先度が無い場合、優先度判定は終了する。具体的には、例えば、「P方式1」が採用されている場合、まず、複数のTxID200の優先順位301がクエリ実行部1313により比較される。優先順位301が全て異なっている場合、優先度判定が終了する。一方、少なくとも2つのTxID200の優先順位301が同じ場合、次に、その少なくとも2つのTxID200の時間314がクエリ実行部1313により比較される。このように、採用されているP方式の規定に従い、複数のTxIDに対応した複数の優先度に同じ優先度が無くなるまで、指標の比較が行われる。 Each of the columns 501A, 501B,... Indicates a priority determination method (hereinafter also referred to as “P method”). In each of the columns 501A, 501B,..., The number corresponding to the item indicates the weight of the item in the priority determination. The smaller the number, the higher the weight. Therefore, for example, “P method 1” in the column 501A is a method for performing priority determination in the order of priority, time, and core number. When the plurality of priorities corresponding to the plurality of TxIDs (Tx processing) are all different, in other words, when the plurality of priorities corresponding to the plurality of TxIDs do not have the same priority, the priority determination ends. Specifically, for example, when “P method 1” is adopted, first, the query execution unit 1313 compares priorities 301 of a plurality of TxIDs 200. If all of the priorities 301 are different, the priority determination ends. On the other hand, when the priorities 301 of at least two TxIDs 200 are the same, the query execution unit 1313 compares the times 314 of the at least two TxIDs 200 next. In this way, according to the definition of the adopted P method, the indicators are compared until the same priority does not exist for a plurality of priorities corresponding to a plurality of TxIDs.
 図9は、ロック方式管理テーブルの構成図である。 FIG. 9 is a configuration diagram of the lock method management table.
 ロック方式管理テーブル901は、1以上の記憶装置1202(図1参照)に記憶される。ロック方式管理テーブル901は、列600と列601A、601B、…とを有する。 The lock method management table 901 is stored in one or more storage devices 1202 (see FIG. 1). The lock method management table 901 has a column 600 and columns 601A, 601B,.
 列600は、S100~S190の状態を示す。つまり、行611A、611B、…は、S100~S190の状態にそれぞれ対応する。 Column 600 shows the states of S100 to S190. That is, the rows 611A, 611B,... Correspond to the states of S100 to S190, respectively.
 列601A、601B、…の各々は、ロック方式(以下、「L方式」と言うことがある)を示す。 Each of the columns 601A, 601B,... Indicates a lock method (hereinafter also referred to as “L method”).
 例えば、「L方式1」によれば、Txメイン処理(S120)の処理中において、確認と接続が行なわれる。「確認」とは、TxID200とレコード250の接続が可能であるかを優先度判定することをいう。例えば、第1のTxID200Aと第2のTxID200Bがレコード250Aと接続するとき(例えば図7参照)、クエリ実行部1313が、優先度判定を実施する。TxID200Aの優先度がより高い場合(TxID200Aが優先度判定で勝った場合)、クエリ実行部1313は、TxID200Aを特定するための情報を、レコード250AのTxID情報253に記録する。このような情報の記録が「接続」である。つまり、これら一連の処理が、「確認」と「接続」に相当する。 For example, according to “L method 1”, confirmation and connection are performed during the process of the Tx main process (S120). “Confirmation” refers to determining the priority of whether the connection between the TxID 200 and the record 250 is possible. For example, when the first TxID 200A and the second TxID 200B are connected to the record 250A (see, for example, FIG. 7), the query execution unit 1313 performs the priority determination. When the priority of TxID 200A is higher (when TxID 200A wins the priority determination), query execution unit 1313 records information for specifying TxID 200A in TxID information 253 of record 250A. The record of such information is “connection”. That is, the series of processes corresponds to “confirmation” and “connection”.
 また、「L方式1」によれば、Tx終了(S190)の処理中において、状態遷移が行われる。「状態遷移」とは、TxID200のTx状態202を更新することである。例えば、Tx状態202をTxメイン処理(S120)からTx終了(S190)へと更新する。これにより、TxID200Aと接続されている複数のレコード250A及び250Cとインデックス450の状態を1処理で同時に変更することができる。 Further, according to the “L method 1”, the state transition is performed during the process of Tx termination (S190). “State transition” is to update the Tx state 202 of the TxID 200. For example, the Tx state 202 is updated from the Tx main process (S120) to the Tx end (S190). As a result, the state of the plurality of records 250A and 250C and the index 450 connected to the TxID 200A can be changed simultaneously in one process.
 これらの「確認」、「接続」及び「状態遷移」の組合せは複数通りあり、故に、複数のL方式を生成することができる。複数のL方式から所望のL方式を指定できるので、Tx処理の属性(例えば、開始から終了までに要する時間長)、計算機システム1100の負荷等に応じたロック方式に従うロック取得が期待できる。なお、「L方式2」では、優先度確認の判定が行われないため、「確認」(つまり優先度判定)は不要である。L方式2は、本実施形態では、優先的に実行したいTx処理について選択される。なぜなら、Txメイン処理611B開始前に状態遷移を実施することで、対象のTx処理が別のTx処理からアボートされることを防ぐことができるからである。 There are a plurality of combinations of these “confirmation”, “connection”, and “state transition”, and therefore, a plurality of L methods can be generated. Since a desired L method can be specified from a plurality of L methods, lock acquisition according to the lock method according to the attribute of the Tx process (for example, the time length required from the start to the end), the load of the computer system 1100, and the like can be expected. In the “L method 2”, since the priority confirmation determination is not performed, “confirmation” (that is, priority determination) is unnecessary. In this embodiment, the L method 2 is selected for Tx processing that is to be preferentially executed. This is because executing the state transition before the start of the Tx main process 611B can prevent the target Tx process from being aborted from another Tx process.
 図10は、ロック方式の概要説明図である。 FIG. 10 is a schematic explanatory diagram of the locking method.
 ここでは、複数のTx処理間で行われる優先度判定の対象を明確化する。また、ここでは、TxN(N=1,2,3)のTx処理を「Tx処理N」と記載する。Tx処理1~3は、時間(t)の経過に従い進む。ここでは、状態の一例として、状態661~666を示す。 Here, the target of priority determination performed between a plurality of Tx processes is clarified. Here, the Tx processing of TxN (N = 1, 2, 3) is referred to as “Tx processing N”. The Tx processes 1 to 3 proceed as time (t) elapses. Here, states 661 to 666 are shown as examples of states.
 優先度判定は、Tx処理間が同じ状態、又は、比較対象が下位のTx処理に対してのみ行われてよい。具体的には、例えば、指定されている(選択されている)L方式が「確認」を含む手順を示している場合、優先度判定は、Tx処理間が同じ進捗状態、又は、比較対象が下位のTx処理に対してのみ行われ、比較対象が上位のTx処理に対しては行われないでよい。これにより、上位のTx処理が下位のTx処理によりアボートされコミットできなくなるといったことを回避できる。「下位」とは、Tx終了により古い進捗状態にあることを意味し、例えば、Tx2からみたTx1及びTx3をいう。また、「上位」とは、Tx終了により新しい進捗状態にあることを意味し、例えば、Tx3からみたTx2をいう。例えば、比較対象が上位のTx処理3であれば、下位のTx処理1の優先度がたとえ高くても、下位のTx処理1は優先度判定で負けとなる。 The priority determination may be performed only for a state in which the Tx processes are the same or a Tx process having a lower comparison target. Specifically, for example, when the designated (selected) L method indicates a procedure including “confirmation”, the priority determination is performed based on whether the Tx process has the same progress state or the comparison target. It is performed only for the lower Tx process, and the comparison target may not be performed for the upper Tx process. As a result, it is possible to avoid that the upper Tx process is aborted by the lower Tx process and cannot be committed. “Lower” means that the current progress state is reached by the end of Tx, for example, Tx1 and Tx3 viewed from Tx2. Further, “upper” means that the state is in a new progress state due to the end of Tx, for example, Tx2 viewed from Tx3. For example, if the comparison target is the upper Tx process 3, even if the priority of the lower Tx process 1 is high, the lower Tx process 1 is lost in the priority determination.
 図11は、Tx命令の一例の構成図である。 FIG. 11 is a configuration diagram of an example of a Tx instruction.
 Tx処理命令700は、ユーザ1000により操作される計算機システム1110が、計算機システム1100で実行されるDBMS1301に対して発行する命令である。Tx処理命令700は、命令本体701を含む。命令本体701は、Tx処理の詳細を示す。 The Tx processing command 700 is a command issued by the computer system 1110 operated by the user 1000 to the DBMS 1301 executed by the computer system 1100. The Tx processing instruction 700 includes an instruction body 701. The instruction body 701 shows details of Tx processing.
 また、Tx処理命令700は、P方式702及びL方式703のうちの少なくとも1つを含んでよい。P方式702は、ユーザ1000(又は計算機システム1110で実行されるアプリケーションプログラム)により指定された優先度判定方式を示し、L方式703は、ユーザ1000(又は計算機システム1110で実行されるアプリケーションプログラム)により指定されたロック方式を示す。つまり、ユーザ1000(又は計算機システム1110で実行されるアプリケーションプログラム)が、Tx毎に、P方式及びL方式のうちの少なくとも一方をDBMS1301に指定することができる。その指定は、Tx処理命令700により行われ、故に、Tx処理命令700の発行と別段の操作を行う必要が無い。 Further, the Tx processing instruction 700 may include at least one of the P method 702 and the L method 703. The P method 702 indicates a priority determination method designated by the user 1000 (or an application program executed by the computer system 1110), and the L method 703 is determined by the user 1000 (or an application program executed by the computer system 1110). Indicates the specified lock method. That is, the user 1000 (or an application program executed on the computer system 1110) can designate at least one of the P method and the L method for the DBMS 1301 for each Tx. The designation is performed by the Tx processing instruction 700. Therefore, it is not necessary to perform an operation different from the issuance of the Tx processing instruction 700.
 DBMS1301は、Tx処理命令700に基づいて、図2~図4を参照して説明した処理を実行する。そして、その処理において、Tx処理間の関係(同じ状態、下位又は上位)と、指定されているP方式及びL方式とを基に、TxIDとレコードの関連付けが制御される。 The DBMS 1301 executes the processing described with reference to FIGS. 2 to 4 based on the Tx processing instruction 700. In this process, the association between the TxID and the record is controlled based on the relationship between the Tx processes (same state, lower level or higher level) and the designated P mode and L mode.
 図12は、方式選択管理テーブルの一例の構成図である。 FIG. 12 is a configuration diagram of an example of the method selection management table.
 方式選択管理テーブル1201は、1以上の記憶装置1202(図1参照)に記憶される。方式選択管理テーブル1201には、適用範囲811A、811B、…の各々について、指定されているP方式及びL方式が登録される。 The method selection management table 1201 is stored in one or more storage devices 1202 (see FIG. 1). In the method selection management table 1201, the designated P method and L method are registered for each of the application ranges 811A, 811B,.
 適用範囲として、「ユーザ」、「データベース」及び「Tx」等がある。つまり、P方式及びL方式の組は、ユーザ毎、データベース毎、及びTx毎、の単位で指定可能である。 Scope of application includes “user”, “database” and “Tx”. That is, a set of P method and L method can be specified in units of each user, each database, and each Tx.
 例えば、ユーザ単位でP方式及びL方式の組が指定されている場合、そのユーザからのTx処理命令に従うTx処理では、処理対象のデータベースや実行されるTxに関わらず、常に、そのユーザについて指定済のP方式及びL方式を基に、Tx処理が行われる。このケースでは、1つのデータベースについて、異なるP方式及び異なるL方式が共存可能である。なお、Tx処理において、指定されているP方式をキーに優先度判定方式管理テーブル801を参照することで比較対象の指標が特定され、且つ、指定されているL方式をキーにロック方式管理テーブル901を参照することでロック取得手順が特定される。 For example, when a combination of the P method and the L method is specified for each user, the Tx processing according to the Tx processing instruction from the user always specifies the user regardless of the database to be processed and the Tx to be executed. Tx processing is performed on the basis of the completed P method and L method. In this case, different P methods and different L methods can coexist for one database. In the Tx process, the index for comparison is specified by referring to the priority determination method management table 801 using the designated P method as a key, and the lock method management table using the designated L method as a key. By referring to 901, the lock acquisition procedure is specified.
 また、例えば、データベース単位でP方式及びL方式の組が指定されている場合、そのデータベースに対するTx処理では、Tx処理命令を出したユーザや実行されるTxに関わらず、常に、そのデータベースについて指定済のP方式及びL方式を基に、Tx処理が行われる。 Also, for example, when a combination of P method and L method is specified for each database, Tx processing for that database is always specified for that database regardless of the user who issued the Tx processing command or Tx to be executed. Tx processing is performed on the basis of the completed P method and L method.
 また、例えば、Tx単位でP方式及びL方式の組が指定されている場合、そのTx処理は、その指定されているP方式及びL方式を基に行われる。このケースでも、1つのデータベースについて、異なるP方式及び異なるL方式が共存可能である。 Also, for example, when a set of P method and L method is specified in units of Tx, the Tx processing is performed based on the specified P method and L method. Even in this case, different P methods and different L methods can coexist for one database.
 なお、Tx単位でのP方式及びL方式の指定は、動的に行われ(例えばTx処理命令において指定され)、ユーザ及びデータベースのいずれの単位でのP方式及びL方式の指定は、静的に行われる(例えば予め方式選択管理テーブル1201に登録される)。もし、静的な指定がされているのに動的な指定がされた場合には、常に動的な指定がクエリ実行部1313により採用されてもよいし、或いは、動的な指定と静的な指定のどちらを採用するかの判定のためのポリシを基に動的な指定と静的な指定のどちらを採用するかクエリ実行部1313により決められてもよい。 The specification of the P method and the L method in Tx units is dynamically performed (for example, specified in the Tx processing instruction), and the specification of the P method and the L method in any unit of the user and the database is static. (For example, registered in the method selection management table 1201 in advance). If a dynamic designation is made although a static designation is made, the dynamic designation may always be adopted by the query execution unit 1313, or the dynamic designation and the static designation may be adopted. The query execution unit 1313 may determine which of the dynamic designation and the static designation is adopted based on a policy for determining which one is to be adopted.
 また、P方式とL方式は、所定の基準を基に作成及び指定されてよい。 Also, the P method and the L method may be created and specified based on a predetermined standard.
 例えば、参照が多いTx処理、具体的には、参照が多いという条件(前もって定義された条件)に適合するTx処理命令700に従い行われるTx処理があるとする。参照が多いTx処理がDBMS1301(例えばクエリ実行部1313)により検出された場合、DBMS1301(例えばクエリ実行部1313)により、以下の処理が行われてよい。すなわち、単位時間当たりの参照レコード数が最大になるような設定が行われてよい。具体的には、例えば、P方式として、重みの高い順に、1:時間、2:参照レコード数、3:コア番号、及び、4:スレッド番号が設定されたP方式が指定されてよい。コア番号及びスレッド番号の組は、優先度が一意になるための組であり、優先度が一意になるための指標が他にあれば、代替可能である。また、L方式として、L方式1(図9参照)が指定されてよい。なぜなら、優先度判定を実施可能とするためである(例えば「L方式2」が選択されると、別Tx処理が強制的にアボートされてしまい(いわゆる早い者勝ちとなり)、優先度判定が実施されない)。なお、指標「参照レコード数」によれば、参照レコード数316(図6参照)が多い方のTxIDが、優先度判定で勝ちとなる。 For example, suppose that there is a Tx process with many references, specifically, a Tx process performed in accordance with a Tx process instruction 700 that meets a condition that there are many references (a condition defined in advance). When Tx processing with many references is detected by the DBMS 1301 (for example, the query execution unit 1313), the following processing may be performed by the DBMS 1301 (for example, the query execution unit 1313). That is, a setting may be made so that the number of reference records per unit time is maximized. Specifically, for example, as a P method, a P method in which 1: time, 2: reference record number, 3: core number, and 4: thread number are set in descending order of weight may be specified. The combination of the core number and the thread number is a set for making the priority unique, and can be substituted if there is another index for making the priority unique. Further, L method 1 (see FIG. 9) may be designated as the L method. This is because priority determination can be performed (for example, when “L method 2” is selected, another Tx process is forcibly aborted (so-called first come first served), and priority determination is performed. Not) According to the index “number of reference records”, the TxID having the larger number of reference records 316 (see FIG. 6) wins the priority determination.
 また、例えば、更新が多いTx処理、具体的には、更新が多いという条件(前もって定義された条件)に適合するTx処理命令700に従い行われるTx処理(典型的には、多くの更新をコミットしたいTx処理)があるとする。更新が多いTx処理がDBMS1301(例えばクエリ実行部1313)により検出された場合、DBMS1301(例えばクエリ実行部1313)により、以下の処理が行われてよい。すなわち、単位時間当たりの更新及び挿入レコード数が最大になるような設定が行われてよい。例えば、P方式として、重みの高い順に、1:時間、2:更新レコード数、3:挿入レコード数、4:コア番号、及び、5:スレッド番号が設定されたP方式が指定されてよい。コア番号及びスレッド番号の組は、優先度が一意になるための組であり、優先度が一意になるための指標が他にあれば、代替可能である。また、L方式として、L方式1(図9参照)が指定されてよい。なぜなら、優先度判定を実施可能とするためである。なお、指標「参照レコード数」によれば、参照レコード数が多い方のTxIDが、優先度判定で勝ちとなる。なお、指標「更新レコード数」によれば、更新レコード数318(図6参照)が多い方のTxIDが、優先度判定で勝ちとなる。また、指標「挿入レコード数」によれば、挿入レコード数317(図6参照)が多い方のTxIDが、優先度判定で勝ちとなる。なお、挿入が多いTx処理では、例えば、P方式として、重みの高い順に、1:時間、2:挿入レコード数、3:更新レコード数、4:コア番号、及び、5:スレッド番号が設定されたP方式が指定されてよい。 Also, for example, Tx processing with many updates, specifically, Tx processing (typically committing many updates) performed in accordance with a Tx processing instruction 700 that conforms to a condition with many updates (predefined conditions). Suppose that there is a Tx process). When Tx processing with many updates is detected by the DBMS 1301 (for example, the query execution unit 1313), the following processing may be performed by the DBMS 1301 (for example, the query execution unit 1313). That is, a setting that maximizes the number of updates and inserted records per unit time may be performed. For example, as the P method, a P method in which 1: time, 2: update record number, 3: insert record number, 4: core number, and 5: thread number may be specified in descending order of weight. The combination of the core number and the thread number is a set for making the priority unique, and can be substituted if there is another index for making the priority unique. Further, L method 1 (see FIG. 9) may be designated as the L method. This is because priority determination can be performed. According to the index “number of reference records”, the TxID having the larger number of reference records wins the priority determination. According to the index “number of update records”, the TxID with the larger number of update records 318 (see FIG. 6) wins the priority determination. Further, according to the index “number of inserted records”, the TxID having the larger number of inserted records 317 (see FIG. 6) wins in the priority determination. In Tx processing with many insertions, for example, as a P method, 1: time, 2: number of inserted records, 3: number of updated records, 4: core number, and 5: thread number are set in descending order of weight. The P method may be specified.
 以上のように、優先度判定の結果を基に、Txとレコードの関連付けが変更される。これにより、高速なロック検出を実現できる。すなわち、一般的には、S162でロック判定が行われるが、本実施形態では、S120のTxメイン処理で実施可能なロック予約によって、ロックを取得できる見込みがあるか否かをS120の時点で判定できる。また、複数のTxIDにそれぞれ対応した複数の優先度に重複が無いので(優先度が一意に設定されるので)デッドロックを避けることができる。 As described above, the association between Tx and record is changed based on the result of the priority determination. Thereby, high-speed lock detection can be realized. That is, in general, the lock determination is performed in S162, but in this embodiment, it is determined at the time of S120 whether or not there is a possibility that a lock can be acquired by the lock reservation that can be performed in the Tx main process of S120. it can. In addition, since there is no overlap among the plurality of priorities corresponding to the plurality of TxIDs (since the priorities are uniquely set), deadlock can be avoided.
 本実施形態で行われる処理の概要は、例えば以下の通りである(以下の説明では、対象のTxのTxID200を「TxID200F」と記載)。 The outline of the processing performed in this embodiment is as follows, for example (in the following description, the TxID 200 of the target Tx is described as “TxID200F”).
 すなわち、クエリ受付部1311が、Tx処理命令700(クエリ)を受信する。これにより、Tx処理が開始(S100)される。クエリプラン生成部1312が、そのTx処理命令700を基にクエリプランを生成し、その際に、TxID(構造体)200(以下、200F)を生成する。クエリ実行部1313が、クエリプランに基づいてTxID200Fを用い、TxID200Fに従い、図2~図4の処理を実行する。 That is, the query receiving unit 1311 receives the Tx processing instruction 700 (query). Thereby, Tx processing is started (S100). The query plan generation unit 1312 generates a query plan based on the Tx processing instruction 700, and at that time, generates a TxID (structure) 200 (hereinafter, 200F). The query execution unit 1313 uses the TxID 200F based on the query plan, and executes the processes of FIGS. 2 to 4 according to the TxID 200F.
 その際、クエリ実行部1313は、TxID200Fに接続したい複数のレコードのうち1以上のレコード(具体的には、1以上のレコードの各々更新TxID情報254)に他のTxIDに接続されていれば、その1以上のレコードの各々について、例えば以下の処理を行う。以下の説明では、1つのレコード(以下、対象レコード)を例に取る。
・クエリ実行部1313は、対象レコードの接続先(更新TxID情報254)のTxID200(以下、200T)の状態がTxID200Fと同じか或いはTxID200TがTxID200Fより下位かどうかを判定する。
・その判定の結果が肯定であれば、クエリ実行部1313は、TxID200Fについて指定されているP方式(例えば、ユーザ単位、データベース単位又はTx単位で指定されているP方式)に従い、TxID200FとTxID200Tのどちらの優先度が高いかの優先度判定を行う。
・TxID200Fが優先度判定で勝った場合、クエリ実行部1313は、TxID200Fについて指定されているL方式(例えば、ユーザ単位、データベース単位又はTx単位で指定されているL方式)に従い、ロックを取得(ロックの予約を取得)する。具体的には、例えば、クエリ実行部1313は、優先度判定で負けたTxID200TのTx様態202を「アボート」に変更し、且つ、対象レコード内の更新TxID情報254を、TxID200Fを特定する情報に更新する。
At that time, if the query execution unit 1313 is connected to another TxID in one or more records (specifically, updated TxID information 254 of each of the one or more records) among a plurality of records to be connected to the TxID 200F, For example, the following processing is performed for each of the one or more records. In the following description, one record (hereinafter, target record) is taken as an example.
The query execution unit 1313 determines whether the state of TxID 200 (hereinafter, 200T) of the connection destination (update TxID information 254) of the target record is the same as TxID 200F or whether TxID 200T is lower than TxID 200F.
If the result of the determination is affirmative, the query execution unit 1313 determines whether the TxID 200F and TxID 200T are in accordance with the P method specified for the TxID 200F (for example, the P method specified for each user, each database, or each Tx). Priority determination of which priority is higher is performed.
When TxID 200F wins in the priority determination, the query execution unit 1313 acquires a lock according to the L method specified for TxID 200F (for example, the L method specified for each user, each database, or each Tx) ( Get lock reservation). Specifically, for example, the query execution unit 1313 changes the Tx state 202 of the TxID 200T lost in the priority determination to “Abort”, and uses the updated TxID information 254 in the target record as information for specifying the TxID 200F. Update.
 Tx処理が開始してからここまでの処理が、Txメイン処理(S120)である。 The process from the start of the Tx process to this step is the Tx main process (S120).
 クエリプランに基づいた全てのTxメイン処理(S120)を終えた場合、クエリ実行部1313は、更新ロック判定(図4のS162)に進む。ここでは、TxID200FのTx状態202を「更新ロック判定663」に変更する。もし、TxID200FのTx状態202が「アボート」であれば、クエリ実行部1313がアボート処理を実施する。 When all the Tx main processes (S120) based on the query plan are finished, the query execution unit 1313 proceeds to the update lock determination (S162 in FIG. 4). Here, the Tx state 202 of the TxID 200F is changed to “update lock determination 663”. If the Tx state 202 of the TxID 200F is “Abort”, the query execution unit 1313 performs an abort process.
 次に、クエリ実行部1313は、整合性判定(図4のS163)を実施する。整合性判定(S163)の結果が肯定であれば、クエリ実行部1313は、TxID200FのTx状態202を「整合性判定664」に変更する。もし、TxID200FのTx状態202が「アボート」であれば、クエリ実行部1313は、アボート処理を実施する。 Next, the query execution unit 1313 performs consistency determination (S163 in FIG. 4). If the result of the consistency determination (S163) is positive, the query execution unit 1313 changes the Tx state 202 of the TxID 200F to “consistency determination 664”. If the Tx state 202 of the TxID 200F is “Abort”, the query execution unit 1313 performs an abort process.
 S162及びS163を含んだコミット判定(図3のS160)が終了し、次に、クエリ実行部1313は、永続化処理(図3のS170)を実施する。クエリ実行部1313は、ログが永続化されたことを確認後に、TxID200FのTx状態202を「永続化処理665」に変更する。 The commit determination including S162 and S163 (S160 in FIG. 3) ends, and then the query execution unit 1313 performs a persistence process (S170 in FIG. 3). After confirming that the log has been made permanent, the query execution unit 1313 changes the Tx state 202 of the TxID 200F to “permanent processing 665”.
 最後に、クエリ実行部1313は、TxID200Fに対応したTxのTx終了(図2のS190)を実施する。ここでは、クエリ実行部1313は、TxID200FのTx状態202を「Tx終了666(コミット)」に変更する。 Finally, the query execution unit 1313 performs Tx termination (S190 in FIG. 2) of Tx corresponding to TxID 200F. Here, the query execution unit 1313 changes the Tx state 202 of the TxID 200F to “Tx end 666 (commit)”.
 以上、一実施形態を説明したが、本発明は、この実施形態に限定されるものでなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。 As mentioned above, although one embodiment was described, it cannot be overemphasized that this invention can be variously changed in the range which is not limited to this embodiment and does not deviate from the summary.
 1100:計算機システム 1100: Computer system

Claims (15)

  1.  データベースの複数のデータ領域のうちの1以上のデータ領域を更新するトランザクション処理命令を受け付ける受付部と、
     前記トランザクション処理命令に従うトランザクション処理の状態であるTx状態を含んだデータ構造体を前記トランザクション処理命令に基づき生成し、前記トランザクション処理により更新される前記1以上のデータ領域の各々を前記データ構造体に関連付け、前記データ構造体を基にトランザクション処理を実行する実行部と
    を有するデータベース管理システム。
    A reception unit that receives a transaction processing instruction for updating one or more data areas of a plurality of data areas of the database;
    A data structure including a Tx state that is a state of transaction processing according to the transaction processing instruction is generated based on the transaction processing instruction, and each of the one or more data areas updated by the transaction processing is stored in the data structure. And a database management system having an execution unit that executes transaction processing based on the data structure.
  2.  前記実行部は、第1のトランザクション処理により更新される1以上のデータ領域のうちの第1のデータ領域が、生成済みの第2のデータ構造体に関連付けられている場合、前記第2のデータ構造体が含むTx状態である第2のTx状態を基に、前記第1のトランザクション処理に対応した第1のデータ構造体に前記第1のデータ領域を前記第2のデータ構造体に代えて関連付けるか否かを制御する、
    請求項1記載のデータベース管理システム。
    When the first data area among the one or more data areas updated by the first transaction process is associated with the generated second data structure, the execution unit executes the second data Based on the second Tx state which is the Tx state included in the structure, the first data area is replaced with the second data structure in the first data structure corresponding to the first transaction processing. Control whether to associate,
    The database management system according to claim 1.
  3.  前記実行部は、前記1以上のデータ領域の各々を前記データ構造体に関連付けを、複数の関連付け方式のうちの指定された関連付け方式に従い実行し、
     前記複数の関連付け方式の各々は、前記1以上のデータ領域の各々を前記データ構造体に関連付ける手順を定義した方式である、
    請求項1記載のデータベース管理システム。
    The execution unit executes associating each of the one or more data areas with the data structure according to a designated association method among a plurality of association methods,
    Each of the plurality of association methods is a method that defines a procedure for associating each of the one or more data areas with the data structure.
    The database management system according to claim 1.
  4.  第1のトランザクション処理により更新される1以上のデータ領域のうちの第1のデータ領域が、生成済みの第2のデータ構造体に関連付けられており、且つ、前記指定された関連付け方式が示す手順に優先度を判定することが含まれている場合、前記実行部は、
      前記第2のデータ構造体と前記第1のトランザクション処理に対応した第1のデータ構造体とを基に、前記第1のトランザクション処理と前記第2のデータ構造体に対応した第2のトランザクション処理の優先度を判定する優先度判定を行い、
      前記第1のトランザクションの優先度がより高い場合に、前記第1のデータ構造体に前記第1のデータ領域を前記第2のデータ構造体に代えて関連付ける、
    請求項3記載のデータベース管理システム。
    A procedure in which a first data area among one or more data areas updated by a first transaction process is associated with a generated second data structure, and indicated by the designated association method Is included in determining the priority, the execution unit,
    Based on the second data structure and the first data structure corresponding to the first transaction process, the first transaction process and the second transaction process corresponding to the second data structure. Priority determination to determine the priority of
    Associating the first data area with the first data structure instead of the second data structure when the priority of the first transaction is higher;
    The database management system according to claim 3.
  5.  前記第2のトランザクション処理の進捗状態が、前記第1のトランザクション処理の進捗状態と同じか、或いは、前記第1のトランザクション処理より終了状態から古い進捗状態の場合に、前記実行部は、前記優先度判定を行い、
     前記第2のトランザクション処理の進捗状態が、前記第1のトランザクション処理より終了状態から新しい進捗状態の場合に、前記実行部は、前記優先度判定を行わない、
    請求項4記載のデータベース管理システム。
    When the progress state of the second transaction process is the same as the progress state of the first transaction process, or when the progress state is older than the end state than the first transaction process, the execution unit sets the priority Judgment degree,
    When the progress state of the second transaction process is a new progress state from the end state than the first transaction process, the execution unit does not perform the priority determination;
    The database management system according to claim 4.
  6.  前記データ構造体は、優先度判定に使用され得る複数の指標である優先度指標群を含み、
     前記実行部は、前記優先度判定を、複数の優先度判定方式のうちの指定された優先度判定方式に従い実行する、
    請求項4記載のデータベース管理システム。
    The data structure includes a priority index group that is a plurality of indexes that can be used for priority determination,
    The execution unit executes the priority determination according to a specified priority determination method among a plurality of priority determination methods.
    The database management system according to claim 4.
  7.  関連付け方式の指定は、ユーザ単位及びトランザクション処理単位のうちの少なくとも1つの単位で行われる、
    請求項3記載のデータベース管理システム。
    The designation of the association method is performed in at least one unit of the user unit and the transaction processing unit.
    The database management system according to claim 3.
  8.  前記トランザクション処理命令に前記指定された関連付け方式が含まれている、
    請求項7記載のデータベース管理システム。
    The transaction processing instruction includes the specified association method;
    The database management system according to claim 7.
  9.  第1のトランザクション処理により更新される1以上のデータ領域のうちの第1のデータ領域が、生成済みの第2のデータ構造体に関連付けられている場合、前記実行部は、
      前記第2のデータ構造体と前記第1のトランザクション処理に対応した第1のデータ構造体とを基に、前記第1のトランザクション処理と前記第2のデータ構造体に対応した第2のトランザクション処理の優先度を判定する優先度判定を行い、
      前記第1のトランザクションの優先度がより高い場合に、前記第1のデータ構造体に前記第1のデータ領域を前記第2のデータ構造体に代えて関連付ける、
    請求項1記載のデータベース管理システム。
    When the first data area among the one or more data areas updated by the first transaction process is associated with the generated second data structure, the execution unit includes:
    Based on the second data structure and the first data structure corresponding to the first transaction process, the first transaction process and the second transaction process corresponding to the second data structure. Priority determination to determine the priority of
    Associating the first data area with the first data structure instead of the second data structure when the priority of the first transaction is higher;
    The database management system according to claim 1.
  10.  前記データ構造体が関連付けられたデータ領域には、そのデータ領域を生成したトランザクション処理のデータ構造体と、そのデータ領域を最近更新したトランザクション処理のデータ構造体とのうちの少なくとも1つが関連付けられる、
    請求項1記載のデータベース管理システム。
    The data area associated with the data structure is associated with at least one of a data structure of a transaction process that generated the data area and a data structure of a transaction process that recently updated the data area,
    The database management system according to claim 1.
  11.  前記データ構造体は、優先度判定に使用され得る複数の指標である優先度指標群を含み、
     前記実行部は、前記優先度判定を、複数の優先度判定方式のうちの指定された優先度判定方式に従い実行し、
     前記複数の優先度判定方式の各々では、使用する指標の重みが定義されており、
     前記実行部は、前記優先度判定を、前記指定された優先度判定方式で定義されている指標重み順に、前記第1のデータ構造体に含まれている指標の値と前記第2のデータ構造体に含まれている指標の値を比較する、
    請求項9記載のデータベース管理システム。
    The data structure includes a priority index group that is a plurality of indexes that can be used for priority determination,
    The execution unit executes the priority determination according to a designated priority determination method among a plurality of priority determination methods,
    In each of the plurality of priority determination methods, a weight of an index to be used is defined,
    The execution unit performs the priority determination in the order of index weights defined by the designated priority determination method, and the index value and the second data structure included in the first data structure. Compare the values of the indicators contained in the body,
    The database management system according to claim 9.
  12.  優先度判定方式の指定は、ユーザ単位及びトランザクション処理単位のうちの少なくとも1つの単位で行われる、
    請求項11記載のデータベース管理システム。
    The specification of the priority determination method is performed in at least one of the user unit and the transaction processing unit.
    The database management system according to claim 11.
  13.  前記トランザクション処理命令に前記指定された優先度判定方式が含まれている、
    請求項12記載のデータベース管理システム。
    The transaction processing instruction includes the designated priority determination method;
    The database management system according to claim 12.
  14.  複数のデータ領域のうちの1以上のデータ領域を更新するトランザクション処理命令を受け付ける入出力装置と、
     前記トランザクション処理命令に従うトランザクション処理の状態であるTx状態を含んだデータ構造体を前記トランザクション処理命令に基づき生成し、前記トランザクション処理により更新される前記1以上のデータ領域の各々を前記データ構造体に関連付け、前記データ構造体を基にトランザクション処理を実行するプロセッサと
    を有する計算機システム。
    An input / output device that receives a transaction processing instruction for updating one or more data areas of the plurality of data areas;
    A data structure including a Tx state that is a state of transaction processing according to the transaction processing instruction is generated based on the transaction processing instruction, and each of the one or more data areas updated by the transaction processing is stored in the data structure. And a processor for executing transaction processing based on the data structure.
  15.  データベースの複数のデータ領域のうちの1以上のデータ領域を更新するトランザクション処理命令を受け付け、
     前記トランザクション処理命令に従うトランザクション処理の状態であるTx状態を含んだデータ構造体を前記トランザクション処理命令に基づき生成し、
     前記トランザクション処理により更新される前記1以上のデータ領域の各々を前記データ構造体に関連付け、
     前記データ構造体を基にトランザクション処理を実行する、
    データベース管理方法。
    Accepts a transaction processing instruction for updating one or more data areas of a plurality of data areas of a database;
    Generating a data structure including a Tx state which is a state of transaction processing according to the transaction processing instruction based on the transaction processing instruction;
    Associating each of the one or more data areas updated by the transaction process with the data structure;
    Performing transaction processing based on the data structure;
    Database management method.
PCT/JP2014/062378 2014-05-08 2014-05-08 Database management system, computer system, and database management method WO2015170386A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2014/062378 WO2015170386A1 (en) 2014-05-08 2014-05-08 Database management system, computer system, and database management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2014/062378 WO2015170386A1 (en) 2014-05-08 2014-05-08 Database management system, computer system, and database management method

Publications (1)

Publication Number Publication Date
WO2015170386A1 true WO2015170386A1 (en) 2015-11-12

Family

ID=54392255

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2014/062378 WO2015170386A1 (en) 2014-05-08 2014-05-08 Database management system, computer system, and database management method

Country Status (1)

Country Link
WO (1) WO2015170386A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04264638A (en) * 1990-10-23 1992-09-21 Digital Equip Corp <Dec> System and method for controlling rule-driven transaction
JP2007133858A (en) * 2005-09-30 2007-05-31 Coware Inc Scheduling in multicore architecture
US20110078385A1 (en) * 2009-09-30 2011-03-31 Yosef Lev System and Method for Performing Visible and Semi-Visible Read Operations In a Software Transactional Memory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04264638A (en) * 1990-10-23 1992-09-21 Digital Equip Corp <Dec> System and method for controlling rule-driven transaction
JP2007133858A (en) * 2005-09-30 2007-05-31 Coware Inc Scheduling in multicore architecture
US20110078385A1 (en) * 2009-09-30 2011-03-31 Yosef Lev System and Method for Performing Visible and Semi-Visible Read Operations In a Software Transactional Memory

Similar Documents

Publication Publication Date Title
EP3117348B1 (en) Systems and methods to optimize multi-version support in indexes
EP3278239B1 (en) Processing database transactions in a distributed computing system
CN104793988B (en) The implementation method and device of integration across database distributed transaction
US8527501B2 (en) Method, system, and program for combining and processing transactions
US9367346B2 (en) Accelerating distributed transactions on key-value stores through dynamic lock localization
US8694733B2 (en) Slave consistency in a synchronous replication environment
EP3800558A1 (en) Database transaction processing method, client, and server
EP2738698A2 (en) Locking protocol for partitioned and distributed tables
US20150269215A1 (en) Dependency-aware transaction batching for data replication
US9460144B2 (en) Lock acceleration
US11269829B2 (en) Row level locking for columnar data
KR20180030115A (en) Method and architecture for providing database access control in a network having a distributed database system
US20160239529A1 (en) Methods and systems of splitting database indexes and digests
US9086911B2 (en) Multiprocessing transaction recovery manager
JP5772458B2 (en) Data management program, node, and distributed database system
CN111316255B (en) Data storage system and method for providing a data storage system
US20210365439A1 (en) Distributed transaction execution in distributed databases
US9229949B2 (en) Extensible and generic framework for managing resources for data warehousing loads
WO2018063923A1 (en) Intents and locks with intent
WO2020098682A1 (en) Systems and methods for managing shared database
US8180745B2 (en) Persistent object references to parallel database containers
WO2015170386A1 (en) Database management system, computer system, and database management method
US20110191549A1 (en) Data Array Manipulation
US10387416B2 (en) Querying a specified data storage layer of a data storage system
US8615769B2 (en) Data processing system, data processing method, and data processing program

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: 14891495

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14891495

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP