what is the table 'slots' good for

Klaus Dahlke klaus.dahlke at gmx.de
Tue Nov 27 16:06:27 EST 2012

On Sat, 24 Nov 2012 08:36:12 +0900
John Ralls <jralls at ceridwen.us> wrote:

> On Nov 24, 2012, at 6:43 AM, Klaus Dahlke <klaus.dahlke at gmx.de> wrote:
> > Dear all,
> > I use gnucash since many years with the postgresql backend. No inconsistencies or similar so far. The only problem I have that I experience some performance issues, especially one retrieveing data via HBCI or reconciling accounts.
> > 
> > To investigate a bit further I increased the log level of postgresql and found that during retrieval and reconciling that the 'slots' table is involved, e.g. some delete and insert statements with fairly old data ...
> > 
> > Actually, I don't reconcile all my accounts, typically only reconcile the bank and credit/debit cards accounts.
> > 
> > The slots table has now 18250 lines:
> > gnucash=# select count(slot_type) from slots;
> > count 
> > -------
> > 18250
> > (1 row)
> > 
> > 
> > gnucash=# select slot_type, count(slot_type) from slots group by slot_type;
> > slot_type | count 
> > -----------+-------
> >         6 |     8
> >         4 |  3292
> >         5 |  3144
> >         9 |  4827
> >         1 |  5876
> >        10 |  1103
> > (6 rows)
> > 
> > Could give some information what's the purpose of the slots table and whether the 'old' entries can be deleted?
> The Slots table holds key-value pair data (KVP)  from data structures throughout Gnucash. It's been the (unfortunate) practice through most of Gnucash 2's development to use KVP to add or extend new variables to Gnucash because doing so allows older versions of Gnucash to open the data file.
> Since you mentioned HCBI, it stores its Bayesian matching data in KVP, and that data can get quite large over time. It's hard to see what entries in the Slots table correspond to the Bayesian data, but quite easy from XML. If you want to delete it -- and that would mean that you'd have to re-train all of your import account assignments -- you can save your data as XML using File>Save As and edit the result. You'll want to turn off compression in preferences first. The HBCI elements are clearly named and are under the <Book> element; they should be near the top of the file after all of the <currency> elements. 
> Do note that editing the Gnucash data file voids the warranty, so be very careful, and check the results carefully in Gnucash before re-saving it to Postgres and using it for new transactions.
> Regards,
> John Ralls

Hi John,
thanks for the info. It seems that also within postgresql the entires in questions are easy to identify. The entries in the field 'name' of the slots table start with 'import-map/' (typically HCBI) or with 'import-map-bayes' (Bayesian filter). I will give it a try on a test database later.


More information about the gnucash-user mailing list