Reducing update conflicts when maintaining views
AssigneeMicrosoft Technology Licensing, LLC
InventorsTengiz Kharatishvili, Wei Xiao, Stefano Stefani
Life of this patent
Estimating the term…
Abstract
Aspects of the subject matter described herein relate to reducing update conflicts when maintaining views. In aspects, a transaction in snapshot isolation may update a materialized view. Instead of being able to view the update within the transaction, the update is hidden to prevent the transaction from obtaining inconsistent data. When a transaction is not supposed to see an update to a materialized view that occurs within the transaction, additional information associated with the materialized view may indicate this. When a query of the materialized view is made within the transaction, the query engine may use the additional information to exclude data from the update in the result.
Claims20
A computer storage medium having computer-executable instructions, which when executed perform actions, comprising:
- within a transaction, making an update to a table in response to a first data modification that occurs after a beginning of the transaction and a second data modification committed by another transaction after the beginning of the transaction, the transaction having a view of data that existed as of the beginning of the transaction together with any changes the transaction has made to the data after the beginning of the transaction, the update occurring before the transaction completes;
- and
- before the transaction completes, without aborting the transaction, excluding the update from the transaction such that a query of the table within the transaction does not return the update made by the transaction, returning a result in response to the query based on data that existed as of the beginning of the transaction.
A method implemented at least in part by a computer, the method comprising:
- within a transaction, updating a table as a result of (i) the transaction and (ii) another transaction committed after a beginning of the transaction, the transaction having a view of data that existed as of the beginning of the transaction as modified by a change the transaction has made after the beginning of the transaction;
- within the transaction, querying the table;
- and
- in response to the querying, before the transaction completes, without aborting the transaction, excluding the update from the transaction thus returning a result that does not include information associated with the update to the table made by the transaction.
An apparatus, comprising:
- a computing system environment comprising a processing unit coupled to a system memory, the computing system environment further comprising:
- a transaction coordinator operable to provide isolation to transactions, the isolation providing a view to each transaction of data that existed at a time said transaction began;
- a table updater operable to update a table to include an indication that a transaction in which the table was updated is not allowed to see the update, wherein the indication comprises an identifier associated with the transaction, the identifier indicating that the update was caused by both (i) the transaction and (ii) another transaction committed after a beginning of the transaction;
- and
- a query engine operable to obtain data from the table in accordance with the indication, the query engine further operable to, in order to prevent the transaction from obtaining inconsistent data, based upon the identifier indicating that the update was caused by the transaction, exclude the update from the transaction such that a query of the table within the transaction does not return the update made by the transaction.
Dependencies are inferred from the claim text.