It is perfectly possible to write your own action triggers to customize or extend referential behavior. Although the automatic triggers are flexible enough to cover most requirements, there is one special case where custom triggers are generally called for. This is the case where creation of the mandatory enforcing index on the foreign key column is undesirable because the index would be of very low selectivity.
Broadly, indexes of low selectivity occur where a small number of possible values is spread over a large table, or where only a few possible values are ever used in the actual table data. The resulting massive duplication of values in the index—described as long chains —can impact query performance severely as the table grows.
When writing custom referential triggers, you must make sure that your own triggers or your application code will preserve referential integrity when data in any key changes. Triggers are much safer than application code, since they centralize the data integrity rules in the database and enforce them for all types of access to the data, be it by program, utility tool, script, or server application layer.
Without formal cascading update and delete actions, your custom solution must take care of rows in child tables that will be affected by changes to or deletions of parent keys. For example, if a row is to be deleted from the referenced table, your solution must first delete all rows in all tables that refer to it through foreign keys.
Firebird Related Interview Questions
|RDBMS Interview Questions||MySQL Interview Questions|
|Linux Interview Questions||Mac OS X Deployment Interview Questions|
|Windows Administration Interview Questions||Windows Server 2003 Interview Questions|
|SQL Interview Questions||NoSQL Interview Questions|
|Advanced C++ Interview Questions|
Introduction To Client/server Architecture
About Firebird Data Types
Date And Time Types
Blobs And Arrays
From Drawing Board To Database
Creating And Maintaining A Database
Firebird’s Sql Language
Expressions And Predicates
Querying Multiple Tables
Ordered And Aggregated Sets
Overview Of Firebird Transactions In
Programming With Transactions
Introduction To Firebird Programming
Developing Psql Modules
Error Handling And Events
Security In The Operating Environment
Configuration And Special Features
Interactive Sql Utility (isql)
Database Backup And Restore (gbak)
Housekeeping Tool (gfix)
Understanding The Lock Manager
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.