Subject Re: [firebird-support] Re: Speed up on recalculation procedure
Author Ann Harrison
Ongky,


> When i recalculate stock card first I delete the records and then I
> rebuild
> it with data collected from another tables. The stock card is to store
> the summary of stock
> transaction.
>

Can you drop the stock card table instead? That would require that no
running connection have touched the table and introduce the need to backup
and restore the database periodically because there's a limit to the number
of tables you can create in a Firebird database, but it would avoid garbage
collection and be faster than deleting the contents row by row.

>
> So the procedure work by deleting old records and then create new
> records with insert command.
>
> The problem is after records deleted from stock card table it create
> garbage collection and slow down
> the process when the procedure start to rebuild the stock card by
> inserting new records into it.
>

How many records are you talking about? Dozens? Hundreds? Millions?

>
> Is there any command that I could use to disabled garbage collection
> before I start
> the recalculation process?
>

No, and even if there were, using it would be a bad idea. Although garbage
collection takes time, it slows the database less than leaving lots of
unusable record versions in the database.

An alternative is to run SuperServer with the garbage collection option set
to use a separate thread.

Good luck,

Ann


[Non-text portions of this message have been removed]