×

Systems and methods for avoiding database anomalies when maintaining constraints and indexes in presence of snapshot isolation

  • US 7,653,665 B1
  • Filed: 09/13/2004
  • Issued: 01/26/2010
  • Est. Priority Date: 09/13/2004
  • Status: Active Grant
First Claim
Patent Images

1. A computer-implemented method for determining whether to abort a database transaction, said transaction occurring in a snapshot isolation level, the method comprising:

  • the computer creating a first database state comprising a virtual snapshot of the database upon initiation of the transaction;

    the computer processing the transaction using the first database state and concurrently processing one or more other transactions using the first database state;

    the computer determining whether an auxiliary table scan of the first database state is required to process said transaction;

    when an auxiliary table scan is required as part of a data modification query to ensure that logical data consistency is preserved, the computer reading said auxiliary table in a first snapshot view associated with said snapshot isolation level, said first snapshot view comprising committed data values existing in the first database state;

    the computer comparing at least one of said committed data values to at least one data value in a second snapshot view, said second snapshot view comprising a latest committed version of said auxiliary table;

    the computer adding a virtual column to each of one or more data items of the latest committed version of said auxiliary table, the virtual column containing a value indicating whether the data item of the latest committed version of said auxiliary table differs from a corresponding data item of the committed data values;

    the computer propagating the virtual column and the second snapshot view through the transaction to an operator responsible for indexed view maintenance or referential integrity constraint validation;

    the computer checking the virtual column of each data item of the latest committed version of said auxiliary table to determine if the virtual column value indicates that the data item of the latest committed version of said auxiliary table differs from a corresponding data item of the committed data values; and

    the computer aborting said transaction if the virtual column value of any data item of the latest committed version of said auxiliary table indicates that the data item of the latest committed version of said auxiliary table differs from a corresponding data item of the committed data values.

View all claims
  • 2 Assignments
Timeline View
Assignment View
    ×
    ×