发明名称 Constraint processing
摘要 Constraint processing for a relational database generates primary (e.g., based on primary key values) and constraint index records (e.g., based on foreign key values) during table load operations that are then sorted in a manner that rapidly and unambiguously identifies rows that fail the specified constraint test. Rows so identified may be deleted to maintain the constraint (e.g., referential) integrity of a child table. In one case, child table row data may be processed in constraint key order, eliminating the need first load the child table with row data and then delete those rows that subsequently fail the integrity test.
申请公布号 US9449067(B2) 申请公布日期 2016.09.20
申请号 US201113027131 申请日期 2011.02.14
申请人 BMC Software, Inc. 发明人 Blaicher Chistopher Youngs;Tenberg Kerry Charles;Bright Randol Keith
分类号 G06F17/30 主分类号 G06F17/30
代理机构 Brake Hughes Bellermann LLP 代理人 Brake Hughes Bellermann LLP
主权项 1. A method to process a constraint in a database having a table that is both a parent and a child with respect to a referential constraint relationship, comprising: generating a primary index record for each loaded row of data associated with a parent table, each of said primary index records including a table identifier, a primary key associated with the row of data, and a first flag value; generating a referential index record for each loaded row of data associated with a child table, each of said referential index records including a parent table identifier, a foreign key associated with the row of data, and a second flag value, the second flag value having a value different than the first flag value; sorting the primary index records and the referential index records based on the table identifier, the primary key, and the first flag value of the primary index records, and the parent table identifier, the foreign key, and the second flag value of the referential index records, wherein, by selecting the first flag value to be different than the second flag value, referential index records associated with the child table having the same foreign key are grouped together and one primary index record whose primary key corresponds to the foreign key of the referential index records immediately precedes the group of referential index records; and deleting those rows associated with each referential index record whose foreign key does not match the primary key of an immediately prior primary index record.
地址 Houston TX US