Methods for concurrent execution of database operations

By determining the maximum number of free storage units for concurrent database operations within a time window, the method optimizes storage resource sharing and prevents conflicts, ensuring efficient and conflict-free execution of database operations.

JP7550849B2Active Publication Date: 2024-09-13INTERNATIONAL BUSINESS MACHINE CORPORATION
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2022517206
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-09-18
Filing Date
2020-08-21
Publication Date
2024-09-13
Estimated Expiration
2040-08-21

AI Technical Summary

Technical Problem

Existing database systems face conflicts and inefficiencies when performing concurrent operations, particularly during high-volume tasks like bulk loads, as they struggle to manage storage space allocation and release, leading to potential conflicts and performance degradation.

Method used

A method is introduced to determine the maximum number of free storage units that can be used by concurrent database operations, allowing for efficient sharing of storage resources by limiting the execution of maintenance operations within a defined time window, thereby optimizing performance and preventing conflicts.

Benefits of technology

This approach ensures smooth execution of concurrent database operations by preventing conflicts and optimizing storage resource usage, enhancing performance and avoiding failures in bulk loading scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007550849000003
    Figure 0007550849000003
  • Figure 0007550849000004
    Figure 0007550849000004
  • Figure 0007550849000005
    Figure 0007550849000005
Patent Text Reader

Abstract

The present disclosure relates to a method for executing concurrent database operations in a database system during a time window. The database operations are configured to use storage units of a storage space of the database system. The method includes determining a first usage rate of free storage units to be used by at least one first database operation and a second usage rate of free storage units to be used by a second database operation. The first usage rate and the second usage rate can be used to determine a maximum number of free storage units to be used by the second database operation during the time window. The second database operation can be executed according to the maximum number during the time window. The first database operation can be executed, and execution of the first database operation during the time window is limited to storage units of the storage space.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to the field of digital computer systems, and more particularly to a method for performing concurrent database operations in a database system. [Background technology]

[0002] A tenant can allocate space in a file system that is shared with other tenants. This allocation can affect the tenants that cannot use the space even if it is not currently being used by the first tenant. Therefore, a process may need to be run to release the free space. For example, if a tenant drops a table in the space's database, the allocated space must be released back to the file system. The system cannot automatically release the allocated space, some commands / statements must be executed to trigger the release. However, running the release process can result in conflicts with other concurrent workloads that are using the space. This becomes even more acute for high volume operations like bulk loads that require many new pages in a very short time window. Summary of the Invention

[0003] Various embodiments provide a method, a computer system and a computer program product for performing concurrent database operations in a database system as described by the subject matter of the independent claims. Advantageous embodiments are described in the dependent claims. The embodiments of the invention can be freely combined with one another if they are not mutually exclusive.

[0004] In one aspect, the present invention relates to a method for performing concurrent database operations in a database system during a time window, the database operations being configured to use storage units of a storage space of the database system, the method including: determining a first usage rate of free storage units to be used by at least one first database operation and a second usage rate of free storage units to be used by a second database operation, using the first usage rate and the second usage rate to determine a maximum number of free storage units to be used by the second database operation during the time window, performing the second database operation according to the maximum number during the time window, and performing the first database operation, wherein the performance of the first database operation during the time window is limited to storage units of the storage space.

[0005] In another aspect, the invention relates to a computer system for performing concurrent database operations in a database system during a time window, the database operations being configured to use storage units of a storage space of the database system, the computer system being configured to determine a first usage rate of free storage units to be used by at least one first database operation and a second usage rate of free storage units to be used by a second database operation, use the first usage rate and the second usage rate to determine a maximum number of free storage units to be used by the second database operation during the time window, perform the second database operation according to the maximum number during the time window, and perform the first database operation, the performance of the first database operation during the time window being limited to storage units of the storage space.

[0006] In another aspect, the present invention relates to a computer program product comprising a computer readable storage medium having computer readable program code embodied therein, the computer readable program code being configured to perform all the steps of the method according to the above embodiments.

[0007] Concurrent database operations can be configured to use a respective number of free storage units of the storage space. For example, a first database operation can be configured to use N1 free storage units during the time window, and a second database operation can be configured to use N2 free storage units during the time window. At least some of the N1 free storage units can be free pages that are created during the time window. The created free pages can be referred to as intermediate free pages that can be used by the first database operation during the time window. The first database operation can include a delete operation that creates intermediate free storage units for use by other requests of the first database operation. If the storage space comprises less than N2+N1 free storage units during the time window, the first database operation can end up being unable to use less than the required N1 free storage units. The present subject matter can prevent this by setting a maximum number of free storage units that can be used by the second database operation. Thus, the present subject matter allows for efficient use of available storage among different tenants of the database system. The present subject matter can optimize the execution of database operations that share storage resources.

[0008] Depending on the type of database operations on a storage space, the present subject matter can prevent severe fragmentation. For example, a first database operation can include a bulk load that inserts data into a storage space, while a second database operation reduces the size of the storage space. The present subject matter can avoid collisions between space reclamation and bulk loads. This collision avoidance can prevent performance degradation (e.g., avoiding the need to reallocate freed space for storage space) and can prevent bulk load failures.

[0009] In the following, by way of example only, an embodiment of the invention is described in more detail with reference to the drawings, in which: FIG. [Brief description of the drawings]

[0010] [Figure 1] FIG. 1 illustrates a data processing system. [Diagram 2] 1 is a flowchart of a method for performing concurrent database operations in a database system according to an example of the present disclosure. [Diagram 3] 1 is a flow chart of a method for determining the maximum number of free storage units that may be used by a database operation that is occurring simultaneously with another database operation. [Figure 4] 1 is a flow chart of a method for determining the maximum number of free storage units that may be used by a database operation that is occurring simultaneously with another database operation. [Diagram 5] FIG. 1 illustrates a computerized system suitable for implementing one or more of the method steps included in the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0011] The description of various embodiments of the present invention is provided for illustrative purposes and is not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations that do not depart from the scope and spirit of the described embodiments will be apparent to those skilled in the art. The terminology used in this specification has been selected to best explain the principles, practical applications, or technical improvements over the art found in the marketplace of the embodiments, or to enable others skilled in the art to understand the embodiments disclosed herein.

[0012] A database system may comprise one or more databases. A database of the multiple databases comprises a storage space, i.e. the storage space is allocated for the database. The storage space may be a storage location where the actual data underlying the database objects of the database can be maintained. The storage space serves to allocate storage for data to be stored in the database. The storage space may be a collection of pages, e.g. a file. The storage space may be a table space, an index space or a virtual memory. The storage unit may be a page, e.g. a database operation may enable access to the database, for example. The storage unit may be associated with a status value indicating a status of the storage unit. The storage unit may be configured to contain data. The status of the storage unit indicates whether the storage unit is a free storage unit. A free storage unit is a storage unit that is not used by a database operation. A free storage unit may be either a free storage unit (e.g. not used at all) or a storage unit that contains data that was written by a database operation in the past, but that data is no longer being used, e.g. a storage unit that has not been used for a period of time that exceeds a defined maximum allowable period. For example, the storage unit may be configured to contain records. Each of these records can be mapped to a respective disk block in the database system. A data record or record is a collection of related data items such as the name, birth date, and class of a particular user. A data record represents an entity, which could be a user, object, or concept about which information is stored in the data record.

[0013] The database operation may be initiated, for example, by a user application, or the database operation may be a database system initiated database operation. The term "user" may refer to an entity, for example, an individual, a computer, or an application running on a computer that initiates a database operation, for example, to request to insert a data item. The first database operation may be initiated, for example, by a user application. The second database operation may be initiated by the database system. The database operation may use, for example, at least one page of the storage space. The use of the page may include, for example, modifying the page. The modification of the page may include inserting one or more records into the page, and / or deleting one or more records from the page, and / or changing one or more records in the page, and / or changing the state of the page. The database system may comprise multiple storage spaces, and individual storage spaces of these multiple storage spaces are allocated, i.e., assigned, to a respective one or more database operations. A database operation may use storage units of the storage space assigned to that database operation, and if there are no storage units in that storage space to be used by the database operation, the database operation may request allocation of additional storage units. However, requesting such additional storage units can take a long time and therefore can slow down the execution of database operations.

[0014] The terms "first" and "second" as used herein are meant as labels for the nouns they precede, and do not imply any type of order (e.g., spatial, temporal, logical) unless clearly defined to be so. According to one embodiment, the first database operation may begin prior to the initiation of the second database operation. This may be advantageous in the case of a database system that periodically performs maintenance database operations. For example, the second database operation may be a maintenance database operation that is periodically performed on the database system, e.g., the second database operation may be used to reclaim free pages. Because the second database operation is periodically performed, the execution of the second database operation may occur simultaneously with the execution of other database operations during the maintenance period. Because the maintenance operation is performed more frequently than other database operations, such as the first database operation, the maintenance operation may be limited to a given window of time when it will occur again at a later time. Thus, limiting maintenance operations that are performed periodically may be advantageous compared to limiting other database operations that may only occur once.

[0015] According to one embodiment, the second database operation can start at the same time as the first database operation starts or before. By starting earlier, the second database operation has the advantage of being the first to use the resources of the database system. Thus, by limiting the second database operation to a maximum number of free storage units during the time window, resources can be optimally shared between the database operations. Since the second database operation uses some resources before the first database operation starts, the second database operation can be limited during the time window so that the first database operation has enough resources.

[0016] In one example, the method may be performed automatically in response to a determination that the first database operation and the second database operation are or will be occurring simultaneously during a time window. This may enable a database system that functions autonomously. This may be particularly advantageous because space reclamation for tablespace may occur over a longer period of time (minutes) and it is unknown when a new bulk load will occur. By performing the method automatically, bulk loads may be taken into account whenever they occur.

[0017] According to one embodiment, each storage unit of the plurality of storage units is associated with a status value indicating whether the storage unit is allocated to the first database operation and the second database operation. The storage space comprises storage units allocated for the first database operation and the second database operation, and use of the storage unit by the second database operation includes changing the status value of the storage unit to indicate that the storage unit is not allocated to the first database operation. When a database operation accessing a given database is terminated or completed, the allocated storage units of that database operation are no longer available for allocation to that database operation and can be allocated (e.g., as they become free) for another database operation accessing the given database.

[0018] This embodiment can be advantageously and smoothly integrated into existing systems for the following exemplary reasons: In the existing system, a database administrator runs a maintenance command at regular intervals, e.g., the time window is one interval of a plurality of intervals. A second database operation can be triggered by the maintenance command. The maintenance command can be run automatically, for example. This can result in the maintenance command being run simultaneously with one or more other active workloads of the first database operation. For example, a bulk load can insert a large amount of data into a table space while the size of the table space is reduced by the maintenance command. Conflicts between space reclamation and bulk load can be avoided by this embodiment. For example, this can prevent reallocation for table space for freed space or prevent bulk operation failure.

[0019] This embodiment can improve the use of free space. For example, if 10 tables, each with 1 terabyte (TB) of data, are added by a first database operation to a storage space, and 9 of those 10 tables are dropped, 9 TB of free space will exist in the storage space and cannot be used by the first database operation. In accordance with the present subject matter, this free space can be accessed by other files in the file system by making it available for use by a second database operation.

[0020] According to one embodiment, the determination of the maximum number is performed such that the first database operation can be performed on the storage unit without requiring allocation of the storage unit used by the second database operation, for example, the second database operation can reallocate the required page, so that the first database operation can be performed on the page of storage space without having to require reallocation of the page.

[0021] According to one embodiment, the method further includes providing a fixed number of free storage units of storage space that may be used by a first database operation according to a first usage rate during a time window, calculating a first number as a difference between the fixed number and the total number of free storage units of storage space that may be used by a second database operation during the time window, and calculating a second number of free storage units that may be used by the second database operation according to a second usage rate during the time window, where the determined number is the smallest number of the first number and the second number.

[0022] The fixed number of free pages may be an estimate of the free pages that may be used by the first database operation during the time window. Those free pages may be called intermediate free pages because the first database operation must use those free pages during the time window. Thus, only permanent free pages can be reallocated by the second database operation. The first number may be an estimate of the number of permanent free pages during the time window.

[0023] This embodiment may be advantageous because it may enable an accurate and reliable way to allow multiple database operations to occur simultaneously without conflict. A number of storage units are allocated to the first database operation before starting the first database operation. The first database operation may include, for example, multiple load and delete requests. During the execution of the first database operation, intermediate free pages may be created (e.g., by delete requests), but the first database operation needs those intermediate free pages for a time window. The fixed number of pages may include an estimate of those created intermediate free pages, so that the second database operation can only use permanent free pages. For example, a typical workload during a day may include 5000 load operations, each of which is compensated by an associated delete operation, and overall, the required space remains relatively constant. In this case, the reclaim operation may only be active if there are more delete requests than insert requests (and some pages will be permanently freed).

[0024] According to one embodiment, the method further includes providing a buffer with a fixed number of free storage units, the buffer being configured to comprise a different number of storage units. In one example, the buffer can be logically reserved. The second database operation can be configured to use the buffer, e.g., before starting the second database operation, to determine the number of free pages that the second database operation can use by subtracting the number of free pages of the buffer from the total number of free pages of the storage space. By providing a buffer of pages that are not freed and that is large enough to cover the normal fluctuations of insertions and deletions (contained in the first database operation) during the time window, the zigzag behavior of the storage size can be avoided. The contents of the buffer can be changed, e.g., for another iteration of the method, and the buffer size can be changed, e.g., when repeating the method for another pair of first and second database operations that are performed simultaneously in another time window. This can allow for systematic execution of the method.

[0025] According to one embodiment, the method further includes determining a total rate as a sum of the first usage rate and the second usage rate, determining a fraction of the second usage rate that is in the total rate, and multiplying the number of storage units in the storage space by the fraction, where the determined maximum number is a result of the multiplication. This embodiment can enable an accurate and reliable method for allowing multiple database operations to occur simultaneously without conflicts.

[0026] According to one embodiment, the determination of the maximum number of free storage units is performed before starting the first database operation. This can allow optimal execution of concurrent database operations. For example, this embodiment can speed up the execution of the first database operation compared to when the determination is performed during a time window, since a second database operation may exceed the maximum while the determination is being made. Furthermore, if a free page is already available in the storage space, using that page is faster than allocating a new page on the file system level.

[0027] According to one embodiment, the determination of the maximum number of free storage units is performed while the first database operation is being performed, which may save processing resources that would otherwise be required to perform the determination even if the first database operation has not started or if the first database operation has failed.

[0028] According to one embodiment, the determination of the first and second usage rates is performed using monitoring of data indicative of a processing history of database operations in a database system. Using data from the same database system on which the method is performed can enable an accurate and reliable estimation of the rates.

[0029] According to one embodiment, the first usage rate is a highest usage rate determined from the monitored data and the second usage rate is a lowest usage rate determined from the monitored data.

[0030] The first database operation may include multiple insert and / or delete and / or update requests or tasks. The first usage rate may, for example, indicate an amount of new data pages that can be written in a given time window. The first usage rate may, for example, be the highest rate for all bulk load operations included in the first database operation. The information used to determine the first usage rate and the second usage rate may be obtained from dedicated performance measurements or may be obtained by constantly monitoring the database system, collecting throughput and calculating maximum or minimum values.

[0031] The second usage rate may be a minimum rate for reclaiming free pages, for example at least the amount of pages reclaimed in a given time window. The second usage rate may be calculated by determining the amount of free pages in the storage space and the amount of free pages that can be reclaimed. In this way, the number of reclaimed pages may be limited such that at least as many free pages remain available as a bulk load can satisfy during the time required to reclaim the space.

[0032] According to one embodiment, a storage space is allocated for a first database operation and a second database operation, where the first database operation is a database operation that stores data in the storage space and the second database operation is a database operation that reallocates storage units of the storage space, thereby allowing free pages to be maintained as a resource available for concurrent workloads and only those portions that will not be used by the concurrent workload in a particular time frame to be reclaimed.

[0033] According to one embodiment, the storage space is a table space, the storage unit is a page, the first database operation is a bulk load insert operation, and the second database operation is a page reclaim operation.

[0034] According to one embodiment, the database, DB, system is DB2, DB2 LUW for Linux, UNIX(R) and Windows(R).

[0035] These embodiments allow the present subject matter to be smoothly integrated into existing DB2 LUW systems. DB2 LUW uses table spaces as containers for physically storing tables. Table spaces are structured in pages. Pages are used for different tables, and some of these pages may be used, but the data on those pages has been deleted (either individual rows or entire tables have been dropped) and those pages become free pages. To remedy this situation, DB2 LUW provides a maintenance command to reclaim the free pages. This command can be defined as follows: ALTER TABLESPACE<table_space_name> REDUCE <n>This command specifies the number of pages to free up space. In this case, it indicates the number of pages by which the table space will be narrowed.

[0036] 1 shows a diagram of a data processing system 100. The data processing system 100 includes a client system 101 and a database system 103. The client system 101 is connected to the database system 103 via a network 102. The network 102 may be implemented in a wired manner, for example, or in a wireless manner using wireless protocols and technologies such as WiFi, WiMax, and the like.

[0037] The client system 101 may comprise one or more client applications 105. Each of these client applications 105 may be configured to access data in the database system 103. To that end, the client applications 105 may be linked with a DB2 Universal Database Client Library that allows communication with a database system supporting, for example, the DB2 system. The DB2 Universal Database Client Library may provide the functionality required for the client applications 105 to access the database system 103.

[0038] An application of the applications 105 can be configured to initiate a database action or operation. For example, a TCP / IP communication can be established between the application 105 and one of the agents 107 of the database system 103. The agent 107 of the database system 103 can be configured to control the activities in the database system 103. In particular, the agent 107 can perform most of the data processing on behalf of the application 105. If the database system 103 has multiple processors or is part of a partitioned database, multiple subagents 109 can be assigned. The agent 107 distributes database requests to the subagents 109. The subagents 109 perform the requests for the application 105.

[0039] The database system 103 may comprise one or more storage spaces 110 for one or more databases of the database system 103. The storage spaces 110 may be allocated or assigned disk space on a hard disk 111 as shown in Figure 1. Each disk space may comprise pages that can be used to store table data.

[0040] FIG. 2 is a flow chart of a method for performing concurrent database operations in a database system during a time window. The database operations may use storage units of the storage space. The use of the storage units may include use of at least a free storage unit of the storage space, e.g., a first database operation may continue using the storage unit that started using the storage unit in a time window prior to the current time window. The storage space may be, for example, a table space of a database. The storage space is allocated or associated with at least one database operation of the plurality of database operations. For example, the storage space may be assigned to a first database operation of the plurality of database operations.

[0041] Each database operation of the plurality of database operations can be configured to use a certain number of free storage units per time unit, i.e., each database operation can have a usage rate of the free storage units. Using a free storage unit can include, for example, writing data to the free storage unit, or reusing the free storage unit. Reusing a free storage unit can include reallocating the free storage unit so that it belongs to another storage space, for example, so that it can be assigned to another database operation.

[0042] The first database operation may include, for example, one or more load requests or tasks, for example, the first database operation may include N load requests, for example, N=5000. The load requests may insert data into the free storage units or may overwrite data in the storage units. The second database operation may be a reclaim database operation. The reclaim database operation may be configured to reallocate, i.e., reassign, the free storage units.

[0043] The second database operation may be performed periodically, for example in the database system. For example, the second database operation may be configured to run at a defined time interval, for example every Monday, from 10:00 am to 11:00 am every day. The method may be performed during at least a portion of the time interval. The time window may be one of a plurality of time intervals.

[0044] A first usage rate of free storage units to be used by the first database operation may be determined in step 201. The first usage rate is the number of free storage units that the first database operation uses during a given unit of time. The first usage rate may be estimated in step 201 using historical data including, for example, log records of database operations similar to the first database operation. Database operations may be similar if they include the same type of request (e.g., an insert request) and / or are initiated by the same application and / or are performed during the same time period. In another example, the first usage rate may be user-defined, for example, determining the first usage rate may include receiving a user input indicating the first usage rate.

[0045] A first database operation may include multiple bulk load requests that need to occur simultaneously. The total rate of all concurrent bulk loads is bounded by the maximum input / output operations per second (IOPS) enabled by the database system hardware, so that all the loads together can only process a maximum number of storage units per time interval. The first usage rate may be defined as that maximum number of pages per time interval. That is, if multiple bulk loads occur simultaneously, they will compete for resources and the load rate will decrease for both. If multiple loads achieve a faster combined load rate, then that combined value may be the first usage rate.

[0046] A second usage rate of the free storage units to be used by the second database operation may be determined in step 203. The second usage rate indicates the number of storage units that are reclaimed at least within the time window.

[0047] The first usage rate and the second usage rate can be used to determine a maximum number of free storage units to be used by the second database operation during the time window in step 205. Figures 3 and 4 provide an exemplary method for determining a maximum number of free storage units to be used by the second database operation.

[0048] In step 207, the second database operation may be performed during the time window according to the determined maximum number, i.e., the second database operation may not use more than the determined maximum number of free storage units during the time window.

[0049] In step 209, a first database operation can be executed during the time window, and the execution of the first database operation is limited to the storage units of the storage space. Since the determined maximum number limits the second database operation to a predefined number of storage units, this leaves enough storage units to be used by the first database operation during the time window without having to request additional storage units. That is, the execution of the first database operation is limited to the storage units of the storage space. This can prevent any potential intrusions on pages that may be used by concurrent operations (such as bulk loads).

[0050] The first database operation can begin before the time window, i.e., during the time window, the first database operation continues its execution. In another example, the first database operation can begin execution at the beginning of the time window.

[0051] FIG. 3 is a flow chart of a method for determining the maximum number of free storage units that may be used by a database operation that is occurring simultaneously with another database operation.

[0052] In step 301, a fixed number of free storage units of storage space can be determined. The storage space can be, for example, a table space and the storage units can be pages. The fixed number of free storage units of storage space can be a number of storage units that can be used by a first database operation using a first usage rate during a time window. A buffer can be used for this. The buffer can be reserved (e.g. logically) for the first database operation. In the same time window required for a bulk load (of the first database operation) to fill this buffer, a space reclamation by a second database operation can release excess free storage units back to the file system. This ensures that the space reclamation does not take longer than the bulk load requires, and also assumes that the worst case of space reclamation is slow and that the bulk load is as fast as possible. Thus, as explained with reference to FIG. 2, the first usage rate is determined as the highest rate and the second usage rate is determined as the lowest rate.

[0053] In step 303, a first number may be calculated as the difference between a fixed number and a total number of free storage units in the storage space. The first number is the number of storage units available for reclamation. The first number may be defined as total_num_reclaimable_pages = num_free_pages - num_pages_in_buffer, where num_pages_in_buffer is a fixed number of pages and num_free_pages is the total number of free storage units in the storage space.

[0054] In step 305, a second number of free storage units that can be used by a second database operation during the time window according to a second usage rate can be determined. The second number can be defined as num_reclaimable_pages = load_time * reclaim_speed (in pages / s), where load_time is the (minimum) time that a bulk load would require to fill the buffer, and can also be defined as load_time = num_pages_in_buffer / load_speed, where load_speed is the first usage rate. Load_time can be used as an upper bound to calculate the (maximum) amount of pages that can be reclaimed in that time window (the second number).

[0055] In step 307, a maximum number of free pages that can be used (e.g., reclaimed) by the second database operation can be determined as the smallest number of the first number and the second number. This can limit the number of reclaimable pages. The maximum number can be defined as num_reclaimable_pages = min(num_reclaimable_pages, total_num_reclaimable_pages), where min() represents a function that calculates the minimum of the two numbers.

[0056] FIG. 4 is a flow chart of a method for determining the maximum number of free storage units that may be used by a database operation that is occurring simultaneously with another database operation.

[0057] The method in Figure 4 does not use a buffer. The method in Figure 4 can be used as a safety measure. The method in Figure 4 may be based on the division of the number of free pages between spatial reclamation and (potential) bulk loads.

[0058] In step 401, a total speed may be determined as the sum of the first usage speed and the second usage speed. The total speed may be defined as summed_speed = reclaim_speed + load_speed. The reclaim speed is the second usage speed and the load speed is the first usage speed. As an example, assume that the minimum reclaim speed is 250 pages / s and the maximum load speed is 1250 pages / s. In this case, the total number of pages modified by either bulk load or reclaim is 1500 pages / s.

[0059] In step 403, a fraction of the second usage speed that exists in the total speed can be determined. In step 405, the total number of free storage units in the storage space can be multiplied by the fraction. This results in a number of pages that can be defined as num_reclaimable_pages = num_free_pages * reclaim_speed / summed_speed. The fraction is defined as the ratio of the reclaimed speed to the total speed, reclaim_speed / summed_speed.

[0060] In step 407, the result of the multiplication in step 405 by the maximum number of free pages (or the determined maximum number) that may be used by the second database operation may be provided as num_reclaimable_pages.

[0061] FIG. 5 illustrates a general purpose computerized system suitable for implementing the method steps contained in this disclosure.

[0062] It will be appreciated that the methods described herein are at least partially non-interactive and automated by a computerized system such as a server or embedded system. However, in exemplary embodiments, the methods described herein may be implemented in a (partially) interactive system. These methods may further be implemented in software 522 (including firmware 522), hardware (processor) 505, or a combination thereof. In exemplary embodiments, the methods described herein are implemented in software as executable programs and executed by a special purpose or general purpose digital computer such as a personal computer, a workstation, a minicomputer, or a mainframe computer. Thus, most general purpose systems 101 include a general purpose computer 501.

[0063] In an exemplary embodiment, in the form of a hardware architecture shown in FIG. 5, the computer 401 includes a processor 505, a memory (main memory) 510 coupled to a memory controller 515, and one or more input and / or output (I / O) devices (or peripherals) 10, 545 communicatively coupled via a local input / output controller 535. The input / output controller 535 may be, but is not limited to, one or more buses or other wired or wireless connections known in the art. The input / output controller 535 may have additional elements such as controllers, buffers (caches), drivers, repeaters and receivers to enable communication, although omitted for brevity. Additionally, the local interface may include address, control and / or data connections to enable appropriate communication between the above components. As described herein, the I / O devices 10, 545 may generally include any generic cryptographic or smart card known in the art.

[0064] Processor 505 is a hardware device for, among other things, executing software stored in memory 510. Processor 505 may be any custom or commercially available processor, a central processing unit (CPU), a coprocessor among several processors associated with computer 501, a semiconductor-based microprocessor (in the form of a microchip or chip set), a microprocessor, or generally any device for executing software instructions.

[0065] The memory 510 may include any one or combination of volatile memory elements (e.g., random access memory (RAM, such as DRAM, SRAM, SDRAM, and the like)) and non-volatile memory elements (e.g., ROM, erasable programmable read-only memory (EPROM), electronically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM)). It should be noted that the memory 510 may have a distributed architecture, with various components located remotely from each other, but accessible by the processor 505.

[0066] The software in memory 510 may include one or more individual programs, each of which includes an ordered list of executable instructions for implementing logical functions, particularly functions included in embodiments of the present invention.

[0067] The software in memory 510 will also typically include a suitable operating system (OS) 511. The OS 511 essentially controls the execution of other computer programs.

[0068] The methods described herein may be in the form of a source program, an executable program (object code), a script, or any other entity that includes a set of instructions to be performed. If a source program, the program must be translated via a compiler, assembler, interpreter, etc., in order to operate properly in conjunction with the OS 511, and may or may not be contained within the memory 510. Additionally, the methods may be written in an object-oriented programming language having classes of data and methods, or a procedural programming language having routines, subroutines, or functions, or a combination thereof.

[0069] In an exemplary embodiment, a conventional keyboard 550 and mouse 555 may be coupled to the input / output controller 535. Other output devices, such as I / O device 545, may include input devices, such as, but not limited to, a printer, a scanner, a microphone, and the like. Finally, the I / O device 10, 545 may further include devices that communicate with both input and output, such as, but not limited to, a network interface card (NIC) or a modulator / demodulator (for accessing other files, devices, systems or networks), a radio frequency (RF) or other transceiver, a telephone interface, a bridge, a router, and the like. The I / O device 10, 545 may be any general-purpose cryptographic card or smart card known in the art. The system 101 may further include a display controller 525 coupled to the display 530. In an exemplary embodiment, the system 101 may further include a network interface for coupling to a network 566. The network 566 may be an IP-based network for communication between the computer 501 and any external servers, clients, and the like over a broadband connection. The network 566 transmits and receives data between the computer 501 and the external system 30, which may be included to perform some or all of the steps of the methods discussed herein. In an exemplary embodiment, the network 566 may be a managed IP network managed by a service provider. The network 566 may be implemented wirelessly, for example, using wireless protocols and technologies such as WiFi, WiMax, and the like. The network 566 may also be a packet-switched network, such as a local area network, a wide area network, a metropolitan area network, an Internet network, or other similar type of network environment.Network 566 may be a fixed wireless network, a wireless local area network (LAN), a wireless wide area network (WAN), a personal area network (PAN), a virtual private network (VPN), an intranet or other suitable network system and includes equipment for receiving and transmitting signals.

[0070] If the computer 501 is a PC, a workstation, an intelligent device, etc., the software in the memory 510 may further include a basic input output system (BIOS) 522. The BIOS is a set of basic software routines that initializes and tests the hardware at startup, starts the OS 511, and supports the transfer of data between hardware devices. The BIOS is stored in ROM so that the BIOS can be executed when the computer 501 is powered on.

[0071] When computer 501 is in operation, processor 505 is configured to execute software stored in memory 510 to communicate data to and from memory 510, and typically to control the operation of computer 501 in accordance with the software. The methods and OS 511 described herein are read, in whole or in part, typically in part, by processor 505, perhaps buffered within processor 505, and then executed.

[0072] 5, the methods may be stored on any computer-readable medium, such as storage device 520, for use by or in connection with any computer-related system or method. Storage device 520 may comprise disk storage, such as HDD storage.

[0073] Various embodiments are described in detail in the following numbered sections.

[0074] 1. A method for executing concurrent database operations in a database system during a time window, the database operations being configured to use storage units of a storage space of the database system, the method including: determining a first usage rate of free storage units to be used by at least one first database operation and a second usage rate of free storage units to be used by a second database operation; using the first usage rate and the second usage rate to determine a maximum number of free storage units to be used by the second database operation during the time window; executing the second database operation according to the maximum number during the time window; and executing the first database operation, wherein execution of the first database operation during the time window is limited to storage units of the storage space.

[0075] 2. The method of clause 1, wherein each storage unit of the plurality of storage units is associated with a status value indicating whether the storage unit is allocated to the first database operation and the second database operation, the storage space comprising storage units allocated for the first database operation and the second database operation, and use of the storage unit by the second database operation includes changing the status value to indicate that the storage unit is unallocated.

[0076] 3. The method of clause 2, wherein the determination is performed such that the first database operation is performed on the storage unit without requiring allocation of the storage unit used by the second database operation.

[0077] 4. Any of the methods of paragraphs 1 to 3, providing a fixed number of free storage units of storage space that may be used by a first database operation according to a first usage rate during a time window; calculating a first number as a difference between a fixed number and a total number of free storage units of the storage space; calculating a second number of free storage units available for use by a second database operation according to the second usage rate during the time window; and wherein the determined maximum number is the smallest number of the first number and the second number.

[0078] 5. The method of clause 4, further comprising providing a buffer configured to comprise a fixed number of free storage units, the buffer being configured to comprise a different number of storage units.

[0079] 6. The method of clause 1, 2 or 3, further comprising determining a total rate as the sum of the first usage rate and the second usage rate, determining a fraction of the second usage rate that is present in the total rate, and multiplying the fraction by the total number of free storage units in the storage space, wherein the determined maximum number is a result of the multiplication.

[0080] 7. The method of any of clauses 1 to 6, wherein execution of the first database operation is initiated prior to initiating the second database operation.

[0081] 8. The method of any of clauses 1 to 6, wherein execution of the first database operation is initiated simultaneously with or after initiation of the second database operation.

[0082] 9. Any of the methods of clauses 1 to 8, wherein the determination of the maximum number of free storage units is performed prior to commencing the first database operation.

[0083] 10. Any of the methods of clauses 1 to 8, wherein the determination of the maximum number of free storage units is performed while performing the first database operation.

[0084] 11. Any of the methods of clauses 1 to 10, wherein the determination of the first usage rate and the second usage rate is performed using monitoring of data indicative of a processing history of database operations in the database system.

[0085] 12. The method of clause 11, wherein the first usage rate is a maximum usage rate determined from the monitored data and the second usage rate is a minimum usage rate determined from the monitored data.

[0086] 13. Any of the methods of clauses 1 to 12, wherein the storage space is allocated for a first database operation and a second database operation, the first database operation being a database operation that stores data in the storage space, and the second database operation being a database operation that reallocates storage units of the storage space.

[0087] 14. Any of the methods of clauses 1 to 13, wherein the storage space is a table space, the storage unit is a page, the first database operation is a bulk load insert operation, and the second database operation is a page reclamation operation.

[0088] 15. The method of clause 14, wherein the database, DB, system is DB2, DB2 LUW for Linux, UNIX(R) and Windows(R).

[0089] 16. The method of any of clauses 1 to 15, wherein the method is performed automatically in response to determining that the first database operation and the second database operation are concurrent database operations during the time window.

[0090] Aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer readable program instructions.

[0091] The present invention may be a system, method, and / or computer program product, which may include one or more computer-readable storage media having computer-readable program instructions thereon for causing a processor to implement aspects of the present invention.

[0092] A computer readable storage medium may be a tangible device capable of holding and storing instructions for use by an instruction execution device. A computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. A non-exhaustive list of more specific examples of computer readable storage media includes portable computer diskettes, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROMs or flash memories), static random access memories (SRAMs), portable compact disk read-only memories (CD-ROMs), digital versatile disks (DVDs), memory sticks, floppy disks, mechanical coding devices such as punch cards or grooved ridge structures having instructions recorded thereon, and any suitable combination thereof. As used herein, computer readable storage media should not be interpreted as being essentially transitory signals, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., light pulses passing through a fiber optic cable) or electrical signals transmitted through wires.

[0093] The computer readable program instructions described herein may be downloaded from a computer readable storage medium into each computing / processing device or may be downloaded to an external computer or storage device over a network, such as the Internet, a local area network, a wide area network, or a wireless network, or a combination thereof. The network may comprise copper transmission cables, optical transmission fiber, wireless transmission, routers, firewalls, switches, gateway computers, or edge servers, or a combination thereof. A network adapter card or network interface of each computing / processing device receives the computer readable program instructions from the network and transfers the computer readable program instructions to a computer readable storage medium within the respective computing / processing device for storage.

[0094] The computer readable program instructions for carrying out the operations of the present invention may be either assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk®, C++, and the like, and conventional procedural programming languages ​​such as the “C” programming language, or similar programming languages. The computer readable program instructions may run entirely on the user's computer, partly on the user's computer as an independent software package, partly on the user's computer and partly on a remote computer, or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or wide area network (WAN), or the connection may be made to an external computer (e.g., via the Internet using an Internet Service Provider). In some embodiments, state information of the computer readable program instructions may be utilized to personalize electronic circuitry to implement aspects of the invention, such that electronic circuitry including, for example, programmable logic circuitry, field programmable gate arrays (FPGAs) or programmable logic arrays (PLAs) may execute the computer readable program instructions.

[0095] Aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer readable program instructions.

[0096] These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer or other programmable data processing device to produce a machine, such that the instructions, executed by the processor of the computer or other programmable data processing device, create means for implementing the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams. These computer readable program instructions may also be stored in a computer readable storage medium capable of directing a computer, programmable data processing device or other device, or combination thereof, to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture containing instructions implementing aspects of the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams.

[0097] The computer readable program instructions may also be loaded into a computer, other programmable data processing apparatus or other device to cause the computer, other programmable apparatus or other device to perform a series of operational steps, such that the instructions, which execute on a computer, other programmable apparatus or other device, implement the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams, thereby creating a computer-implemented process.

[0098] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowcharts or block diagrams may represent a module, segment, or portion of instructions, including one or more executable instructions for implementing one or more specified logical functions. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may in fact be executed substantially simultaneously, or the blocks may sometimes be executed in the reverse order depending on the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations of blocks in the block diagrams and / or flowchart illustrations, may be realized by a dedicated hardware-based system that performs the specified functions or actions, or a combination of dedicated hardware and computer instructions.< / n>

Claims

1. A method for a processor to execute a database operation in a database system during a time window, the database operation being configured to use a storage unit of a storage space of the database system, the method executed by the processor comprising: determining a first usage rate of free storage units to be used by at least one first database operation and a second usage rate of free storage units to be used by a second database operation; using the first usage rate and the second usage rate to determine a maximum number of free storage units to be used by the second database operation during the time window; performing the second database operation according to the maximum number during the time window; and and executing the first database operation, wherein the execution of the first database operation during the time window is limited to the storage units of the storage space.

2. 2. The processor-implemented method of claim 1, wherein each storage unit of the plurality of storage units is associated with a status value indicating whether the storage unit is allocated to the first database operation and the second database operation, the storage space comprises storage units allocated for the first database operation and the second database operation, and use of a storage unit by the second database operation includes a change in the status value to indicate that the storage unit is not allocated.

3. 3. The processor-implemented method of claim 1, wherein the determination is performed such that the first database operation is performed on a storage unit without requiring allocation of the storage unit used by the second database operation.

4. providing a fixed number of free storage units of said storage space that may be used by said first database operation according to said first usage rate during said time window; calculating a first number as a difference between said fixed number and a total number of free storage units of said storage space; calculating a second number of free storage units available for use by the second database operation during the time window according to the second usage rate; and 4. The processor-implemented method of claim 1, further comprising: wherein the determined maximum number is the smallest of the first number and the second number.

5. 5. The processor-implemented method of claim 4, further comprising providing a buffer configured to comprise the fixed number of free storage units, wherein the buffers are configured to comprise different numbers of storage units.

6. 5. The processor-implemented method of claim 4, further comprising: determining a total rate as a sum of the first usage rate and the second usage rate; determining a fraction of the second usage rate that is present in the total rate; and multiplying the total number of free storage units in the storage space by the fraction, wherein the determined maximum number is a result of the multiplication.

7. 7. The processor-implemented method of claim 1, wherein execution of the first database operation is initiated prior to commencing the second database operation.

8. 8. The processor-implemented method of claim 1, wherein execution of the first database operation is initiated simultaneously with or after initiation of the second database operation.

9. 9. The processor-implemented method of claim 1, wherein the determination of the maximum number of free storage units is performed prior to commencing the first database operation.

10. 10. The processor implemented method of claim 1, wherein the determination of the maximum number of free storage units is performed while performing the first database operation.

11. 11. The processor-implemented method of claim 1, wherein the determining of the first and second usage rates is performed using monitoring of data indicative of a processing history of database operations in the database system.

12. 12. The method executed by the processor of claim 1, wherein the first usage rate is a highest usage rate determined from monitored data, and the second usage rate is a lowest usage rate determined from monitored data.

13. 13. The processor-implemented method of claim 1, wherein the storage space is allocated for the first database operation and a second database operation, the first database operation being a database operation that stores data in the storage space, and the second database operation being a database operation that reallocates storage units of the storage space.

14. 14. The processor executed method of claim 1, wherein the storage space is a table space, the storage unit is a page, the first database operation is a bulk load insert operation, and the second database operation is a page reclaim operation.

15. 15. The processor executed method of claim 1, wherein the database system is DB2, DB2 LUW for Linux, UNIX and Windows.

16. 16. The processor-implemented method of claim 1, wherein the processor-implemented method is performed automatically in response to a determination that the first database operation and the second database operation are concurrent database operations during the time window.

17. A computer program product for causing a processor to carry out a method according to any one of claims 1 to 16.

18. 1. A computer system for performing database operations in a database system during a time window, the database operations being configured to use storage units of a storage space of the database system, the computer system comprising: determining a first usage rate of free storage units to be used by at least one first database operation and a second usage rate of free storage units to be used by a second database operation; using the first usage rate and the second usage rate to determine a maximum number of free storage units to be used by the second database operation during the time window; performing the second database operation according to the maximum number during the time window; and executing the first database operation, wherein execution of the first database operation during the time window is limited to the storage units of the storage space; 16. A computer system configured to:

19. 20. The computer system of claim 18, remotely connected to or contained within said database system.

Citation Information

Patent Citations

  • Page securing processing method for database

    JP2003330765A

  • Control apparatus and control method

    JP2018063470A