Menu

#117 JackCess MDB file size increase

2.0.9
wont-fix
nobody
None
5
2015-02-02
2015-02-02
No

There's a nasty problem where using an MDB file to write rows in it and then cleaning them multiple times makes the MDB file increase in size.
In the end you might get a 60MB file containing only an empty table.

Initially thought it had to do with setAutoSync() function but instead it seems to be irrelevant, this problem is present both in 1.X version and 2.X versions.

Below a test which adds and then cleans rows for 100 times, after executing it the MDB file will increase of several MBytes.

1 Attachments

Discussion

  • James Ahlborn

    James Ahlborn - 2015-02-02

    This isn't really a bug. This is how access databases work. This is why Access has the "compact and repair" operation. Deletion of a row just marks the row as deleted, but does not actually physically remove the data from the database.

    If you try this with Microsoft Access, you'll probably see similar behavior (although it's possible that in some optimistic scenarios Access may "auto-compact", dunno for sure).

     

    Last edit: James Ahlborn 2015-02-02
  • Marco Arigoni

    Marco Arigoni - 2015-02-02

    Is there any way to completely remove rows from the database?
    I need to be able to reset a database file without switching to Windows "compact and repair" function.
    Currently my file increases up to a limit where my application doesn't work anymore.

     
  • James Ahlborn

    James Ahlborn - 2015-02-02

    Unfortunately, not currently. There is an open enhancement request for this:

    https://sourceforge.net/p/jackcess/feature-requests/17/

    If your database doesn't have any foreign key relationships, you could just implement "copying" yourself (read tables from one db file, copy to a new one). This is essentially what "compact and repair does".

     
  • James Ahlborn

    James Ahlborn - 2015-02-02
    • status: open --> wont-fix
     
  • James Ahlborn

    James Ahlborn - 2015-02-02

    Closing this as it is essentially a duplicate of feature enhancement #17.

     

Log in to post a comment.

MongoDB Logo MongoDB