Subject Re: [ib-support] Performance: foreign keys, triggers..
Author Lele Gaifax
>>>>> Moreno Vandelli l'ha dit:

Moreno> The problem is that some recalculation like
Moreno> "articles-to-make", "materials-needed-to-produce-articles"
Moreno> or "strore-recalculations" needs something like 20 minutes
Moreno> each to be completed. I trace the use of indexes and I
Moreno> found that there are no significant "non-indexed-reads".
Moreno> It is also true that for 2500 items in "ARTICLE" table we
Moreno> have to recalculate a lot of stuffs,

You don't explain how is the calculation done: is there an SP doing
the job *inside* the server, or do you have an external app?

In my experience, 2500 items are a *very* small dataset: I'm used to
perform critical processing of 10k records in lot less time!

Moreno> [questions] 1) For "historical reasons" our database does
Moreno> not use foreign keys, so we have to do everything "by
Moreno> hand" with triggers. Can the "no-use" of FK decrease
Moreno> performance?

It does depend on the kind of data processing you are performing: are
there consistent insertions on those tables? Anyway, triggers are the
first place where an *optimal* code will benefit the whole db.

Moreno> 3) Using a real three layer strategy (with an
Moreno> application server between clients and fb database) to
Moreno> implement the same logic now realized in so-called
Moreno> "slow-stored-procedure", can result in some performance
Moreno> improvement?

Well, I already explained that I do not consider SPs "slow", generally
speaking. But I seriously doubt you can get even close to their speed
using anything external: just the fact that you must extract the data
before you can process it, and then in some way reenter the result
invalidates the benefit of an highly optimized external app.

ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
email: lele@... | -- Fortunato Depero, 1929.