Subject Re: [firebird-support] Re: Performance
Author Aage Johansen
pokka_chi wrote:
> Aage Johansen wrote:
>> When you experience "query is slow the first time" _and_ "fast the
>> next time", you should check whether "garbage collection" happened in
>> the first run.
>> Did you already eliminate this scenario?
> How do I eliminate this scenario? How do I eliminate the first time
> sluggishness?

It depends. It might be (a lot of) back versions of records that is
"garbage collected" because your query touches those records. Do you
use "Commit retaining"? If so, see if you can use (hard) "Commit",
and see if this helps.
The back versions are created by updates and deletes, and they are
garbage collected when someone reads the records (after active
transactions no longer could be interested in those back
versions). However, CommitRetaining inhibits this. (Isn't there an
article/FAQ/something on this somewhere on the IBPhoenix site? -
Should it be?).
In your case, if your first query initiates the garbage collecting
process this can explain why it is slow and why the next ones are
fast (there's simply no more back versions (garbage)).
I believe Ann and Helen (and probably others) have explained this
better many times on this NG (and others) - maybe a search in the
archives could clear up this.

Aage J.