using PostgreSQL

Geert Janssens janssens-geert at telenet.be
Sun Jan 12 16:02:33 EST 2014


On Sunday 12 January 2014 22:01:24 Per Johansson wrote:
> What about performance? It ought to be better using a database than an
> XML file.
> 
Performance in this case is similar. When you open your xml file or your postgresql database, 
the whole file/database are loaded into memory and stays there until you close the 
file/database again.

So there may be some differences in loading time, but not while working in the open book.

And regarding this load time, user reports have suggested that loading from the database is 
actually slower than loading from an xml file.

The other performance differences are in saving. With the db, each change is committed 
directly into the db. This makes gnucash a tiny bit slower while working in the open book in db 
compared to working in the open xml file. On the other hand the xml file needs to be saved at 
some point, which takes time you don't lose anymore with the db.

You may wonder why on earth did gnucash ever implement the backend db's then if there are 
so many drawbacks ? The original reason to do so was to prevent data loss by immediate write-
backs of each and every change.

Unfortunately even today this is still not guaranteed due to the way the code was written and 
incomplete test coverage. Most common uses of the program should work fine though. 
Unfortunately that's still like playing Russian roulette with your data because there may be 
corner cases and no one knows which ones...


Geert


More information about the gnucash-user mailing list