Subject Re: [firebird-support] FB uses 100% cpu
Author Ann W. Harrison
Guido Klapperich wrote:

>>there's usually another factor when you see that level of CPU
>>utilization: non-selective indexes. Ordinary garbage collection
>>imposes some overhead and will show up in performance. Garbage
>>collection on indexes with lots of duplicates will eat your CPU.
>
> But normally the garbage collection should stop after some time. THe
> problem, that I have, is that FB never stops using 100% CPU until I
> restart the FB-server.

Never? How long have you let it run?
>
>
>>You can look for indexes with large numbers of duplicates.
>
> All indexes with max dup > 10000 come from foreign keys and I don't want
> to delete the FK, because of the referential integrity.

In that case, Firebird 2 will fix the problem, but until it is released,
you're going to have to perform some mechanical maintenance. If you can
take your database off-line periodically,

1) drop the foreign key constraints that create non-selective indexes on
fields that change frequently, and those where the child (referencing)
records are frequently deleted

2) force a garbage collection on those tables - select count (*)

3) recreate the constraints.

or backup with garbage collection turned off and restore the whole database.


Regards,


Ann