Subject | Re: Speed up on recalculation procedure |
---|---|
Author | y_ongky_s |
Post date | 2012-10-11T02:38:06Z |
Hello Ann,
Thanks for your reply.
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.
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.
Is there any command that I could use to disabled garbage collection
before I start
the recalculation process?
Regards,
Ongky
--- In firebird-support@yahoogroups.com, Ann Harrison <aharrison@...>
wrote:
Thanks for your reply.
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.
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.
Is there any command that I could use to disabled garbage collection
before I start
the recalculation process?
Regards,
Ongky
--- In firebird-support@yahoogroups.com, Ann Harrison <aharrison@...>
wrote:
>application.
> On Wed, Oct 10, 2012 at 1:20 AM, y_ongky_s ongky74@... wrote:
>
> >
> > I have a stored procedure used to recalculate stock card on my
> >which
> > The procedure is counting by date. I mean if the user recalculate
> > from beginning of month than if there are data already in the
> > stock card table will be deleted and then the procedure will
> > insert record into the stock card date by date until current date.
> >
> > After deleting record the firebird will increase garbage collection
> > slowing down the process. Is it true?be
> >
>
> It's a little hard to tell. If you really mean "stock card table will
> deleted", dropping a table doesn't cause garbage collection. Ifyou're
> deleting or updating records, yes you are creating new versions ofrecords.
> When those versions are mature - meaning that no running transactionneeds
> the older version - the old versions become "garbage" and will causebut not
> garbage collection. Yes, garbage collection slows down the system,
> as much as letting old versions build up, filling pages with uselessstuff.
>the
>
> My question is how to speed up the process. I mean is it possible run
> > process without any transaction active that will create garbagecollection.
> >garbage
>
> As long as you never delete or update records, you'll never have
> collection. I don't understand exactly what you're doing, so thismay
> make no sense. To avoid garbage collection, you might try keeping theold
> card stock records and just creating new ones. You could create a newcard
> stock table every month or quarter or year and have a view likeold
> 'CurrentCardStockView" that points to the most current table. When an
> table ceases to be interesting, drop it.wonder how
>
> Good luck,
>
> Ann
>
> For those who haven't sat through the record version lecture and
> a delete could cause a new version of a record, remember thatversioning is
> used for snapshotting, concurrency control, and failure recovery. Soa
> delete can't just get rid of a record. Instead, it creates a verysmall
> record saying "this record is deleted" and pointing to the next olderremove
> record version. When the delete is mature, garbage collection will
> the old versions and the deleted stub.
>
>
> [Non-text portions of this message have been removed]
>