Updating a partitioning column
AssigneeSap SE
InventorsChristian Bensberg, Lars Fricke, Martin Heidel, Holger Bischoff, Joern Schmidt, Edward-Robert Tyercha, Andreas Tonder
Life of this patent
Estimating the term…
Abstract
An update to a partitioning column for a partitioned table in a database can be performed by handling rows for which the update will not require moving to a different partition separately (e.g. “locally”) for each partition followed by re-inserting those rows that will require moving to a different partition and deleting them from the original partition. The re-inserted rows are directed to a correct partition by application of the partitioning criteria for the table. Methods, articles, and systems are described.
Claims15
A computer program product comprising a non-transitory machine-readable medium storing instructions that, when executed by at least one programmable processor, cause the at least one programmable processor to perform operations comprising:
- identifying a set of values in a partitioning column that will be updated by one or more operations of an update statement on a partitioned table in a database, the partitioned table being partitioned into a plurality of partitions via partitioning logic;
- determining which values of the set of values to be updated will remain in a same partition after being updated, the determining comprising evaluating the partitioning logic for the set of values to be updated;
- executing the one or more operations of the update statement separately on each partition of the plurality of partitions that comprises one or more of the values of the set of values that will remain in the partition after being updated;
- deleting, from the plurality of partitions, a set of rows containing other values of the set of values to be updated that will require moving to a different partition of the plurality of partitions once updated;
- and
- re-inserting the set of rows into the database table such that the one or more operations of the update statement are executed for the set of rows and the partitioning logic directs each row of the set of rows to a proper partition;
- wherein the update statement comprises one or more synchronization points, the one or more synchronization points acting to prevent the re-inserting until all partitions have had the one or more operations of the update statement locally executed.
A method for implementation by one or more data processors forming part of at least one computing system, the method comprising:
- identifying a set of values in a partitioning column that will be updated by one or more operations of an update statement on a partitioned table in a database, the partitioned table being partitioned into a plurality of partitions via partitioning logic;
- determining which values of the set of values to be updated will remain in a same partition after being updated, the determining comprising evaluating the partitioning logic for the set of values to be updated;
- executing the one or more operations of the update statement separately on each partition of the plurality of partitions that comprises one or more of the values of the set of values that will remain in the partition after being updated;
- deleting, from the plurality of partitions, a set of rows containing other values of the set of values to be updated that will require moving to a different partition of the plurality of partitions once updated;
- and
- re-inserting the set of rows into the database table such that the one or more operations of the update statement are executed for the set of rows and the partitioning logic directs each row of the set of rows to a proper partition;
- wherein the update statement comprises one or more synchronization points, the one or more synchronization points acting to prevent the re-inserting until all partitions have had the one or more operations of the update statement locally executed.
A system comprising:
- computer hardware comprising a programmable processor, the computer hardware being configured to perform operations comprising:
- identifying a set of values in a partitioning column that will be updated by one or more operations of an update statement on a partitioned table in a database, the partitioned table being partitioned into a plurality of partitions via partitioning logic;
- determining which values of the set of values to be updated will remain in a same partition after being updated, the determining comprising evaluating the partitioning logic for the set of values to be updated;
- executing the one or more operations of the update statement separately on each partition of the plurality of partitions that comprises one or more of the values of the set of values that will remain in the partition after being updated;
- deleting, from the plurality of partitions, a set of rows containing other values of the set of values to be updated that will require moving to a different partition of the plurality of partitions once updated;
- and
- re-inserting the set of rows into the database table such that the one or more operations of the update statement are executed for the set of rows and the partitioning logic directs each row of the set of rows to a proper partition;
- wherein the update statement comprises one or more synchronization points, the one or more synchronization points acting to prevent the re-inserting until all partitions have had the one or more operations of the update statement locally executed.
Dependencies are inferred from the claim text.