#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2017
    Posts
    1
    Rep Power
    0

    DB grows extreme


    Hello i am using Firebird 3.0
    My Database is about 3MB big.

    Every 5 seconds i update BLOB Field in one Table (The Blob size is between 10-100kB, and 20 records)
    And Every 5 seconds i write into a ring storage (i am storing the latest 1440 Values).
    These are done with updates, after written 1440 Values i restart with the index 1.

    Therefore no INSERT or DELTED ... i thought the database size should realy change.
    But yesterday i had a problem because the DB was about 3GB big!
    Now after 2 hours the Database is grown to 300MB. After Backup and restore the size shrinks to the original size.

    What is the problem? And how can i solve it?
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,474
    Rep Power
    1875
    https://firebirdsql.org/manual/gfix-housekeeping.html
    Perhaps tune your automatic GC sweeping?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2006
    Location
    Plovdiv. Bulgaria
    Posts
    242
    Rep Power
    17
    Firebird works with records' version because of the transactions. Every action you do creates new version of the record. So if you update 1000 times one record in 1 table, you'll have 1000 records of it, every one visible in its transaction, not 1. When all transactions commit, you will have 1 record in one table, with 1000 old records(garbage) invisible for the new transactions That's why the database grows. This, with combination with BLOB fields, which take much space you have your result. When you perform backup restore - the garbage is removed and you have one table with only 1 record with only 1 version of it.

IMN logo majestic logo threadwatch logo seochat tools logo