Subject Re: [firebird-support] Re: foreign keys ans slow insert
Author Martijn Tonies
> > > 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.

Nope, not valid.

> 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.

As I told German, it might be that the new index structure from Arno
improves this behaviour.

That is, IF this is the problem - for which I assume that Helen is right.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com