Subject Re: foreign keys ans slow insert
Author Svein Erling Tysvær
--- In firebird-support@yahoogroups.com, "Bamsemums" wrote:
> > CHECK (VALUE IS NULL OR VALUE IN('CASH', 'CHEQUE','CREDIT'));
>
> IMO, this really is a FB implementation problem.

I agree with Martijn, but the problem is that it doesn't help German
today to know that a future implementation of Firebird one day may fix
it! Today, updating indexes with lots of records is time consuming and
we end up writing something like

CHECK (VALUE IS NULL OR EXISTS(SELECT * FROM VALUETYPES WHERE
VALIDVALUE = :VALUE)); //Assuming this to be legal.

rather than use foreign keys for tables with lots of duplicates
whenever the table with the legal values is not subject to frequent
updating. Though I didn't think this affected inserts at all, just
updates and deletes.

Set