SQL: the scary bit OR more realistically, welcome to the bit you don't understand yet
John Ralls
jralls at ceridwen.us
Thu Jan 1 22:50:52 EST 2015
> On Jan 1, 2015, at 11:30 AM, Wm <wm+gnc at tarrcity.demon.co.uk> wrote:
> I'm guessing what happened is that someone figured tables were expensive
> (they aren't with contemporary db's) and the gnc dev's just kept on
> putting more and more data into this one table
>
> I doubt anyone did it on purpose
Nope. We do it on purpose to make backward compatibility easier. A change to the schema (SQL or XML) makes the book unreadable by an older version, but adding a new key to KVP doesn't, so if possible we'll add a new storage feature in KVP instead. Since we load everything from the data store at startup the performance penalty is in most cases small.
That will be less of an advantage once we're using the database as a real database instead of a data store, but we'll still need to make some sort of arrangement for backward compatibility. Likely we'll rework the schema to a good 3-normal design then write a new sql backend for 2.6 that can read and write to it. Something similar was done with XML a long time ago. You can see the two implementations in gnc-backend-xml.
Regards,
John Ralls
More information about the gnucash-user
mailing list