Reading whole db at startup (was Re: String lengths in the SQL backend)

Daniel Espinosa esodan at gmail.com
Thu Nov 20 23:27:03 EST 2008


If you look at libqof's code you'll find that all GC's QOF implementation is
based in store *all* data object in memory using a GHashTable using a string
for the object type and GUID for identification, any search for any object
is a foreach routine.

This implementation is good for XML data store, but for DB is quite poore
feature, becouse hides all DB's data manipulation and data integrity checks.

If GC could allow any other to access the data from the DB in a way of SQL
queries or DataModels, taking care about Accounts, Transactions, and other
objects for data consistency and integrity, could allows others to take lot
advantages.

2008/11/20 Phil Longstaff <plongstaff at rogers.com>

> On November 16, 2008 02:01:05 pm Derek Atkins wrote:
> > Phil Longstaff <plongstaff at rogers.com> writes:
> > >> Wait, the ENTIRE contents are read in?  Historically only "necessary
> > >> data" was read in.  That would be the Accounts and Commodities from
> > >> the main CoA.  The transactions were all loaded on demand.
> > >
> > > Yes.  I wanted to only read "necessary data".  However, my (admittedly
> > > incomplete) knowledge of the engine led me to the conclusion that parts
> > > of th engine assume that all data is present.  I couldn't get the
> account
> > > tree to show correct values, for example, unless all splits for an
> > > account were present.  I ended up just loading the whole database into
> > > memory.
> >
> > There should not be any dependence on reading in all the data from the
> DB.
> > The old PG Backend certainly did not, and it worked fine.  I think it got
> > around it by having checkpoints for things like running account balances,
> > so you only need to load "current" transactions, not all of them.
> >
> > If you're loading all data all the time then the only benefit to the DB
> > backend over the XML backend is save-on-commit.
>
> I was just looking at the pg backend code again.  In single user mode, it
> *did* read all of the transaction data at startup time.
>
> Phil
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>



-- 
Trabajar, la mejor arma para tu superación
"de grano en grano, se hace la arena" (R) (en trámite, pero para los cuates:
LIBRE)


More information about the gnucash-devel mailing list