Subject RE: [firebird-support] Foreign Keys vs Performance
Author Rick Debay
Apply all foreign keys. It is better to be correct and slow than get a quick, incorrect answer. It also self-documents the data model.

Rick DeBay

-----Original Message-----
From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of fakuva
Sent: Tuesday, December 13, 2005 3:22 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Foreign Keys vs Performance

Hi,

I have a database with 34 tables. I have applied foreign keys for all the relations between the tables (a total number of 48 FK). Now I'm starting to wonder about the performance for this database. (I use IBExpert which creates corresponding index/constraint to all the FK, so the number of indexes is almost 90.)

Occasionally I insert/update 30.000 records in a batch operation. This operation mainly uses the table with the most FK's (7 FK). Will this operation be much slower with all the foreign keys?

What is recommended when using foreign keys (apply all fk's or apply fk where it's most needed?)?

Thanks in advance for any advice.

Bjørn Larsen








------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/67folB/TM
--------------------------------------------------------------------~->

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://firebird.sourceforge.net and click the Resources item on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Yahoo! Groups Links