10.07.2015 Views

Ingres 9.2 Migration Guide - Actian

Ingres 9.2 Migration Guide - Actian

Ingres 9.2 Migration Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ANSI/ISO Constraint EnhancementsANSI/ISO Constraint Enhancements <strong>Ingres</strong> referential and unique/primary key constraints result in the creation ofindexes “under-the-covers” to improve the performance of the constraintenforcement mechanisms. Prior to Release 2.5, these indexes were plain B-tree indexes stored in the default location of the database. However, B-tree isnot always the best choice (for example, hash is better for many unique keyapplications), and use of the default location can degrade performance if manylarge indexes are created.<strong>Ingres</strong> II 2.5 solves these and other problems by including a “with” clause forconstraint definition. The “with” clause allows the overriding of default indexoptions with anything normally coded in an index creation “with” clause. Forexample, the index structure and location, as well as fillfactor and other indexoptions can be explicitly specified for each constraint. The “with” clause appliesto column and table constraints defined with both the create and alter tablestatements. A unique/primary key constraint can be generated to use the basetable structure for its enforcement rather than a separate secondary index.<strong>Ingres</strong> II 2.5 also introduces the ANSI/ISO notion of referential actions for thedefinition of referential (foreign key) constraints. In releases prior to <strong>Ingres</strong> II2.5, the attempt to delete a referenced row for which matching referencingrows exist, or to update the primary key of a referenced row to some othervalue while matching referencing rows still exist for the old value, was metwith an error and the request was aborted. Either operation had to bepreceded by a delete of the matching referencing rows or an update of theforeign keys to some value that exists in another referenced row.<strong>Ingres</strong> II 2.5 allows the definition of referential actions for each referentialconstraint, which defines alternative actions to be taken in the circumstancesdefined above. A separate action can be defined for both the delete case(deletion of a referenced row with matching referencing rows) and the updatecase (updating the key of a referenced row with matching referencing rows).The options include cascade, in which case the delete or update is cascaded tothe matching referencing rows (so that the referencing rows are also deletedor updated to the same value), and set null, in which case the foreign key ofthe matching referencing rows is set to null. These actions permit a morecomplete definition of the semantics of the referential relationship and allowthe application to execute more efficiently.210 <strong>Migration</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!